From 8c1ab783a1f9a1351d4050a2d15a5f2dcf6da02d Mon Sep 17 00:00:00 2001 From: jordan Date: Wed, 29 Nov 2023 18:02:45 -0600 Subject: [PATCH] Add missing wc_AesInit calls: small cleanup. --- tests/api.c | 4 ++-- wolfcrypt/src/cmac.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/api.c b/tests/api.c index 3482a3064..155cd78c7 100644 --- a/tests/api.c +++ b/tests/api.c @@ -18165,7 +18165,7 @@ static int test_wc_GmacUpdate(void) #ifdef WOLFSSL_AES_192 ExpectNotNull(XMEMSET(&gmac, 0, sizeof(Gmac))); - ExpectIntEQ(wc_AesInit(&gmac.aes, NULL, INVALID_DEVID), 0); + ExpectIntEQ(wc_AesInit(&gmac.aes, HEAP_HINT, INVALID_DEVID), 0); ExpectIntEQ(wc_GmacSetKey(&gmac, key24, sizeof(key24)/sizeof(byte)), 0); ExpectIntEQ(wc_GmacUpdate(&gmac, iv2, sizeof(iv2), authIn2, sizeof(authIn2), tagOut2, sizeof(tag2)), 0); @@ -18174,7 +18174,7 @@ static int test_wc_GmacUpdate(void) #ifdef WOLFSSL_AES_256 ExpectNotNull(XMEMSET(&gmac, 0, sizeof(Gmac))); - ExpectIntEQ(wc_AesInit(&gmac.aes, NULL, INVALID_DEVID), 0); + ExpectIntEQ(wc_AesInit(&gmac.aes, HEAP_HINT, INVALID_DEVID), 0); ExpectIntEQ(wc_GmacSetKey(&gmac, key32, sizeof(key32)/sizeof(byte)), 0); ExpectIntEQ(wc_GmacUpdate(&gmac, iv3, sizeof(iv3), authIn3, sizeof(authIn3), tagOut3, sizeof(tag3)), 0); diff --git a/wolfcrypt/src/cmac.c b/wolfcrypt/src/cmac.c index f19ec639c..0461a7b55 100644 --- a/wolfcrypt/src/cmac.c +++ b/wolfcrypt/src/cmac.c @@ -137,7 +137,7 @@ int wc_InitCmac_ex(Cmac* cmac, const byte* key, word32 keySz, return BAD_FUNC_ARG; } - ret = wc_AesInit(&cmac->aes, NULL, devId); + ret = wc_AesInit(&cmac->aes, heap, devId); #if defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_CRYPT) cmac->useSWCrypt = useSW;