Skip to content

Commit 68eec91

Browse files
authored
Merge pull request wolfSSL#8701 from JacobBarthelmeh/fuzz
init buffer before creating digest value
2 parents e6f8de7 + 43cdc1b commit 68eec91

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/internal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21574,6 +21574,7 @@ static WC_INLINE int VerifyMacEnc(WOLFSSL* ssl, const byte* input, word32 msgSz,
2157421574
WOLFSSL_ERROR_VERBOSE(VERIFY_MAC_ERROR);
2157521575
return VERIFY_MAC_ERROR;
2157621576
}
21577+
XMEMSET(verify, 0, WC_MAX_DIGEST_SIZE);
2157721578

2157821579
ret = ssl->hmac(ssl, verify, input, msgSz - digestSz, -1, content, 1, PEER_ORDER);
2157921580
ret |= ConstantCompare(verify, input + msgSz - digestSz, (int)digestSz);
@@ -21596,7 +21597,7 @@ static WC_INLINE int VerifyMac(WOLFSSL* ssl, const byte* input, word32 msgSz,
2159621597
word32 digestSz = MacSize(ssl);
2159721598
byte verify[WC_MAX_DIGEST_SIZE];
2159821599

21599-
21600+
XMEMSET(verify, 0, WC_MAX_DIGEST_SIZE);
2160021601
if (ssl->specs.cipher_type == block) {
2160121602
pad = input[msgSz - 1];
2160221603
padByte = 1;

0 commit comments

Comments
 (0)