Merge pull request #9028 from dgarske/md5_sha1

Fixes for building with MD5 and SHA1 to support Hash `WC_HASH_TYPE_MD5_SHA`
This commit is contained in:
JacobBarthelmeh
2025-07-24 10:41:22 -06:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -214,9 +214,9 @@ int test_wc_HashInit(void)
for (i = 0; i < notSupportedHashLen; i++) {
/* check for null ptr */
ExpectIntEQ(wc_HashInit(NULL, supportedHash[i]),
ExpectIntEQ(wc_HashInit(NULL, notSupportedHash[i]),
WC_NO_ERR_TRACE(BAD_FUNC_ARG));
ExpectIntEQ(wc_HashInit_ex(NULL, supportedHash[i], HEAP_HINT,
ExpectIntEQ(wc_HashInit_ex(NULL, notSupportedHash[i], HEAP_HINT,
INVALID_DEVID), WC_NO_ERR_TRACE(BAD_FUNC_ARG));
ExpectIntEQ(wc_HashInit(&hash, notSupportedHash[i]),

View File

@@ -137,6 +137,9 @@ typedef struct {
#elif defined(WOLFSSL_SHA384)
#define WC_MAX_DIGEST_SIZE WC_SHA384_DIGEST_SIZE
#define WC_MAX_BLOCK_SIZE WC_SHA384_BLOCK_SIZE
#elif !defined(NO_SHA) && !defined(NO_MD5)
#define WC_MAX_DIGEST_SIZE (WC_SHA_DIGEST_SIZE + WC_MD5_DIGEST_SIZE)
#define WC_MAX_BLOCK_SIZE WC_SHA_BLOCK_SIZE
#elif !defined(NO_SHA256)
#define WC_MAX_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
#define WC_MAX_BLOCK_SIZE WC_SHA256_BLOCK_SIZE