Merge pull request #283 from ejohnstown/hmac-free

HMAC Free
pull/285/head
JacobBarthelmeh 2020-09-08 15:21:16 -06:00 committed by GitHub
commit a3dd039224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -5282,6 +5282,7 @@ static INLINE int CreateMac(WOLFSSH* ssh, const byte* in, word32 inSz,
ret = wc_HmacFinal(&hmac, digest);
if (ret == WS_SUCCESS)
WMEMCPY(mac, digest, SHA1_96_SZ);
wc_HmacFree(&hmac);
}
break;
@ -5299,6 +5300,7 @@ static INLINE int CreateMac(WOLFSSH* ssh, const byte* in, word32 inSz,
ret = wc_HmacUpdate(&hmac, in, inSz);
if (ret == WS_SUCCESS)
ret = wc_HmacFinal(&hmac, mac);
wc_HmacFree(&hmac);
}
break;
@ -5317,6 +5319,7 @@ static INLINE int CreateMac(WOLFSSH* ssh, const byte* in, word32 inSz,
ret = wc_HmacUpdate(&hmac, in, inSz);
if (ret == WS_SUCCESS)
ret = wc_HmacFinal(&hmac, mac);
wc_HmacFree(&hmac);
}
break;
@ -5385,6 +5388,7 @@ static INLINE int VerifyMac(WOLFSSH* ssh, const byte* in, word32 inSz,
default:
ret = WS_INVALID_ALGO_ID;
}
wc_HmacFree(&hmac);
}
return ret;