Skip to content

Commit f3fb63a

Browse files
committed
Add length check to Hmac_UpdateFinal_CT to prevent build error
1 parent 6f48e06 commit f3fb63a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/tls.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,9 @@ static int Hmac_UpdateFinal_CT(Hmac* hmac, byte* digest, const byte* in,
937937
word32 realLen;
938938
byte extraBlock;
939939

940+
if (macLen <= 0 || macLen > (int)sizeof(hmac->innerHash))
941+
return BAD_FUNC_ARG;
942+
940943
switch (hmac->macType) {
941944
#ifndef NO_SHA
942945
case WC_SHA:

0 commit comments

Comments
 (0)