AESNI in FIPS mode does not support zero length inputs (#4411)

* AESNI in FIPS mode does not support zero length inputs

* Update note to specifically note AESNI
This commit is contained in:
Kaleb Himes
2021-09-19 16:29:15 -06:00
committed by GitHub
parent ffa13f314b
commit 9bd300e07d

View File

@ -15572,6 +15572,11 @@ static int test_wc_AesCbcEncryptDecrypt (void)
#endif
}
if (cbcE == 0) {
#if defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && \
(HAVE_FIPS_VERSION == 2) && defined(WOLFSSL_AESNI)
printf("Zero length inputs not supported with AESNI in FIPS mode (v2),"
" skip test");
#else
/* Test passing in size of 0 */
XMEMSET(enc, 0, sizeof(enc));
cbcE = wc_AesCbcEncrypt(&aes, enc, vector, 0);
@ -15581,6 +15586,7 @@ static int test_wc_AesCbcEncryptDecrypt (void)
for (i = 0; i < (int)sizeof(enc); i++)
cbcE |= enc[i];
}
#endif
}
printf(resultFmt, cbcE == 0 ? passed : failed);
if (cbcE != 0) {