summaryrefslogtreecommitdiffstats
path: root/libtomcrypt/hashes/crypt_hash_is_valid.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtomcrypt/hashes/crypt_hash_is_valid.c')
-rw-r--r--libtomcrypt/hashes/crypt_hash_is_valid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libtomcrypt/hashes/crypt_hash_is_valid.c b/libtomcrypt/hashes/crypt_hash_is_valid.c
index 59320a3..4912eb2 100644
--- a/libtomcrypt/hashes/crypt_hash_is_valid.c
+++ b/libtomcrypt/hashes/crypt_hash_is_valid.c
@@ -9,6 +9,7 @@
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
+#include <ncr-int.h>
/**
@file crypt_hash_is_valid.c
@@ -22,7 +23,9 @@
*/
int hash_is_valid(const struct algo_properties_st *hash)
{
- return CRYPT_OK;
+ if (hash->can_digest == 0) return CRYPT_INVALID_ARG;
+
+ return CRYPT_OK;
}
/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_hash_is_valid.c,v $ */