From e1c7385ccf47d8dec80a14bc9240434ec80609e2 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 12 May 2026 20:11:59 -0500 Subject: [PATCH] wolfcrypt/test/test.c: * in pbkdf2_test(), pwdbased_test(), and pkcs12_test(), add missing FIPS v7+ gates around stanzas that use wc_PBKDF_max_iterations_set() and wc_PBKDF_max_iterations_get() or depend on erroring for excessive PBKDF iterations (fixes #10050); * in ecc_test_buffers(), omit new corrupt HMAC tag test on FIPS itt = 0x7FFFFFFF (2,147,483,647). */ @@ -34587,6 +34592,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs12_test(void) ret = 0; /* rejection is the expected outcome */ } } +#endif /* !HAVE_SELFTEST && (!HAVE_FIPS || FIPS_VERSION_GE(7,0)) */ out: @@ -43255,6 +43261,8 @@ static wc_test_ret_t ecc_buffers_encrypt_test(ecc_key* cliKey, ecc_key* servKey, if (XMEMCMP(plain, in, inLen)) return WC_TEST_RET_ENC_NC; +#if !defined(HAVE_SELFTEST) && \ + (!defined(HAVE_FIPS) || FIPS_VERSION3_GE(6,0,0)) /* Negative test: corrupt HMAC tag in encrypted msg, expect * HASH_TYPE_E from wc_ecc_decrypt. */ out[x - 1] ^= 0x01; @@ -43262,6 +43270,7 @@ static wc_test_ret_t ecc_buffers_encrypt_test(ecc_key* cliKey, ecc_key* servKey, ret = wc_ecc_decrypt(servKey, tmpKey, out, x, plain, &y, NULL); if (ret != WC_NO_ERR_TRACE(HASH_TYPE_E)) return WC_TEST_RET_ENC_EC(ret); +#endif /* !HAVE_SELFTEST && (!HAVE_FIPS || FIPS_VERSION3_GE(6,0,0)) */ (void)tmpKey; return 0; diff --git a/wolfssl/wolfcrypt/memory.h b/wolfssl/wolfcrypt/memory.h index 1ea303a4e11..5de29648080 100644 --- a/wolfssl/wolfcrypt/memory.h +++ b/wolfssl/wolfcrypt/memory.h @@ -552,7 +552,7 @@ WOLFSSL_LOCAL int wc_debug_CipherLifecycleFree(void **CipherLifecycleTag, #if defined(WOLFSSL_LINUXKM) || defined(WC_SYM_RELOC_TABLES) || \ defined(WC_SYM_RELOC_TABLES_SUPPORT) - #include "linuxkm/linuxkm_memory.h" + #include "../../linuxkm/linuxkm_memory.h" #endif #ifdef __cplusplus