From 7a020e4bb637db2a20624acac9bca3e31dc30868 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 12 Mar 2021 12:01:11 -0800 Subject: [PATCH] Fix for FIPS and CMAC init. --- wolfcrypt/test/test.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index a4e2eac95..00a0172f2 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -26767,8 +26767,15 @@ WOLFSSL_TEST_SUBROUTINE int cmac_test(void) XMEMSET(tag, 0, sizeof(tag)); tagSz = AES_BLOCK_SIZE; +#if !defined(HAVE_FIPS) || \ + defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 3) if (wc_InitCmac_ex(cmac, tc->k, tc->kSz, tc->type, NULL, HEAP_HINT, devId) != 0) +#else + if (wc_InitCmac(cmac, tc->k, tc->kSz, tc->type, NULL) != 0) +#endif + { ERROR_OUT(-12000, out); + } if (tc->partial) { if (wc_CmacUpdate(cmac, tc->m, tc->mSz/2 - tc->partial) != 0)