diff --git a/wolfcrypt/src/hash.c b/wolfcrypt/src/hash.c index ed6342ae4f..f421f7188e 100644 --- a/wolfcrypt/src/hash.c +++ b/wolfcrypt/src/hash.c @@ -1143,7 +1143,7 @@ int wc_HashUpdate(wc_HashAlg* hash, enum wc_HashType type, const byte* data, return BAD_FUNC_ARG; #ifdef DEBUG_WOLFSSL - if (hash->type != type) { + if (hash->type != WC_HASH_TYPE_NONE && hash->type != type) { WOLFSSL_MSG("Hash update type mismatch!"); return BAD_FUNC_ARG; } @@ -1292,7 +1292,7 @@ int wc_HashFinal(wc_HashAlg* hash, enum wc_HashType type, byte* out) return BAD_FUNC_ARG; #ifdef DEBUG_WOLFSSL - if (hash->type != type) { + if (hash->type != WC_HASH_TYPE_NONE && hash->type != type) { WOLFSSL_MSG("Hash final type mismatch!"); return BAD_FUNC_ARG; } @@ -1443,7 +1443,7 @@ int wc_HashFree(wc_HashAlg* hash, enum wc_HashType type) return BAD_FUNC_ARG; #ifdef DEBUG_WOLFSSL - if (hash->type != type) { + if (hash->type != WC_HASH_TYPE_NONE && hash->type != type) { WOLFSSL_MSG("Hash free type mismatch!"); return BAD_FUNC_ARG; }