@@ -34317,6 +34317,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pbkdf2_test(void)
3431734317 if (XMEMCMP(derived, verify, sizeof(verify)) != 0)
3431834318 return WC_TEST_RET_ENC_NC;
3431934319
34320+ #if !defined(HAVE_SELFTEST) && \
34321+ (!defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0))
3432034322 {
3432134323 int cur_pbkdf_limit = wc_PBKDF_max_iterations_set(iterations - 1);
3432234324 if (cur_pbkdf_limit <= 0)
@@ -34340,9 +34342,9 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pbkdf2_test(void)
3434034342 return WC_TEST_RET_ENC_EC(ret);
3434134343 ret = 0;
3434234344 }
34345+ #endif /* !HAVE_SELFTEST) && (!HAVE_FIPS || FIPS_VERSION3_GE(7,0,0)) */
3434334346
3434434347 return ret;
34345-
3434634348}
3434734349#endif /* HAVE_PBKDF2 && !NO_SHA256 && !NO_HMAC */
3434834350
@@ -34397,7 +34399,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pwdbased_test(void)
3439734399 return ret;
3439834400#endif
3439934401#if defined(HAVE_PKCS12) && !defined(NO_ASN) && !defined(NO_PWDBASED) && \
34400- !defined(NO_HMAC) && !defined(NO_CERTS) && !defined(WOLFSSL_NO_MALLOC)
34402+ !defined(NO_HMAC) && !defined(NO_CERTS) && !defined(WOLFSSL_NO_MALLOC) && \
34403+ !defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || FIPS_VERSION_GE(7,0))
3440134404 /* Test that a crafted PKCS#12 with INT_MAX MAC iterations is rejected
3440234405 * immediately rather than hanging in DoPKCS12Hash(). */
3440334406 {
@@ -34445,7 +34448,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pwdbased_test(void)
3444534448 return ret;
3444634449 }
3444734450#endif /* HAVE_PKCS12 && !NO_ASN && !NO_PWDBASED && !NO_HMAC && !NO_CERTS && */
34448- /* !WOLFSSL_NO_MALLOC */
34451+ /* !WOLFSSL_NO_MALLOC && */
34452+ /* !HAVE_SELFTEST && (!HAVE_FIPS || FIPS_VERSION_GE(7,0)) */
3444934453#ifdef HAVE_SCRYPT
3445034454 ret = scrypt_test();
3445134455#endif
@@ -34543,6 +34547,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs12_test(void)
3454334547 goto out;
3454434548 }
3454534549
34550+ #if !defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || FIPS_VERSION_GE(7,0))
3454634551 /* Test that a crafted PKCS#12 with INT_MAX MAC iterations is rejected
3454734552 * immediately rather than hanging in DoPKCS12Hash(). This is a 90-byte
3454834553 * minimal PKCS#12 with mac->itt = 0x7FFFFFFF (2,147,483,647). */
@@ -34587,6 +34592,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t pkcs12_test(void)
3458734592 ret = 0; /* rejection is the expected outcome */
3458834593 }
3458934594 }
34595+ #endif /* !HAVE_SELFTEST && (!HAVE_FIPS || FIPS_VERSION_GE(7,0)) */
3459034596
3459134597out:
3459234598
@@ -43255,13 +43261,16 @@ static wc_test_ret_t ecc_buffers_encrypt_test(ecc_key* cliKey, ecc_key* servKey,
4325543261 if (XMEMCMP(plain, in, inLen))
4325643262 return WC_TEST_RET_ENC_NC;
4325743263
43264+ #if !defined(HAVE_SELFTEST) && \
43265+ (!defined(HAVE_FIPS) || FIPS_VERSION3_GE(6,0,0))
4325843266 /* Negative test: corrupt HMAC tag in encrypted msg, expect
4325943267 * HASH_TYPE_E from wc_ecc_decrypt. */
4326043268 out[x - 1] ^= 0x01;
4326143269 y = 256;
4326243270 ret = wc_ecc_decrypt(servKey, tmpKey, out, x, plain, &y, NULL);
4326343271 if (ret != WC_NO_ERR_TRACE(HASH_TYPE_E))
4326443272 return WC_TEST_RET_ENC_EC(ret);
43273+ #endif /* !HAVE_SELFTEST && (!HAVE_FIPS || FIPS_VERSION3_GE(6,0,0)) */
4326543274
4326643275 (void)tmpKey;
4326743276 return 0;
0 commit comments