Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions wolfcrypt/src/cmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ static int _InitCmac_common(Cmac* cmac, const byte* key, word32 keySz,
#endif
XMEMSET(cmac, 0, sizeof(Cmac));

/* Stash heap so the cryptocb can read it from the zeroed cmac. */
#ifndef NO_AES
cmac->aes.heap = heap;
#else
cmac->heap = heap;
#endif

/* Store id/label on the Cmac struct so the crypto callback can
* inspect them to determine the hardware key slot. */
#ifdef WOLF_PRIVATE_KEY_ID
Expand Down
2 changes: 2 additions & 0 deletions wolfssl/wolfcrypt/cmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ struct Cmac {
byte digest[WC_AES_BLOCK_SIZE]; /* running digest */
byte k1[WC_AES_BLOCK_SIZE];
byte k2[WC_AES_BLOCK_SIZE];
#else
void* heap; /* fallback when no aes.heap is available */
#endif
word32 bufferSz;
word32 totalSz;
Expand Down
Loading