Skip to content

Commit 19cba1c

Browse files
authored
Merge pull request #9527 from night1rider/CMAC-Compile-Issue
Fix wc_CmacFree() to use correct heap pointer from internal Aes structure
2 parents 6475106 + cf42d14 commit 19cba1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wolfcrypt/src/cmac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
*/
7272
int wc_CMAC_Grow(Cmac* cmac, const byte* in, int inSz)
7373
{
74-
return _wc_Hash_Grow(&cmac->msg, &cmac->used, &cmac->len, in, inSz, NULL);
74+
return _wc_Hash_Grow(&cmac->msg, &cmac->used, &cmac->len, in, inSz, cmac->aes.heap);
7575
}
7676
#endif /* WOLFSSL_HASH_KEEP */
7777

@@ -257,7 +257,7 @@ int wc_CmacFree(Cmac* cmac)
257257
/* TODO: msg is leaked if wc_CmacFinal() is not called
258258
* e.g. when multiple calls to wc_CmacUpdate() and one fails but
259259
* wc_CmacFinal() not called. */
260-
XFREE(cmac->msg, cmac->heap, DYNAMIC_TYPE_TMP_BUFFER);
260+
XFREE(cmac->msg, cmac->aes.heap, DYNAMIC_TYPE_TMP_BUFFER);
261261
#endif
262262
switch (cmac->type) {
263263
#if !defined(NO_AES) && defined(WOLFSSL_AES_DIRECT)

0 commit comments

Comments
 (0)