Fix for FIPS and CMAC init.

This commit is contained in:
David Garske
2021-03-12 12:01:11 -08:00
parent 697d34c80d
commit 7a020e4bb6

View File

@@ -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)