From 61371d403ad2c95c85d2da9866c270f82cb6f6d0 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Sun, 8 Oct 2023 18:02:52 -0500 Subject: [PATCH] minor fixes for AES-EAX implementation and test routines. --- wolfcrypt/src/aes.c | 2 +- wolfcrypt/test/test.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index cc00077cc..b4acb795b 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -12150,7 +12150,7 @@ int wc_AesEaxDecryptFinal(AesEax* eax, ^ eax->ciphertextCmacFinal[i]; } - if (ConstantCompare((const byte*)authTag, authIn, authInSz) != 0) { + if (ConstantCompare((const byte*)authTag, authIn, (int)authInSz) != 0) { ret = AES_EAX_AUTH_E; } else { diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index c984da74a..28124bd0b 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -674,7 +674,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t certpiv_test(void); WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_siv_test(void); #endif -#if defined(WOLFSSL_AES_EAX) +#if defined(WOLFSSL_AES_EAX) && \ + (!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST) WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_eax_test(void); #endif /* WOLFSSL_AES_EAX */ @@ -1439,7 +1440,8 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ #endif #endif -#if defined(WOLFSSL_AES_EAX) +#if defined(WOLFSSL_AES_EAX) && \ + (!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST) if ( (ret = aes_eax_test()) != 0) TEST_FAIL("AES-EAX test failed!\n", ret); else @@ -12996,7 +12998,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aesccm_test(void) #endif /* HAVE_AESCCM */ -#if defined(WOLFSSL_AES_EAX) +#if defined(WOLFSSL_AES_EAX) && \ + (!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST) WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_eax_test(void) {