mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 14:00:48 +02:00
stash caller heap before cryptocb fires so InitCmac_* callbacks can honor it
This commit is contained in:
@@ -126,6 +126,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user