Skip to content

Commit 3876746

Browse files
authored
Merge pull request #10726 from JacobBarthelmeh/test
add macro guard around new test case for specific builds
2 parents 8167d16 + 1001428 commit 3876746

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

tests/api/test_ecc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,10 @@ int test_wc_ecc_shared_secret(void)
579579
} /* END tests_wc_ecc_shared_secret */
580580

581581
#if defined(HAVE_ECC) && defined(HAVE_ECC_DHE) && !defined(WC_NO_RNG) && \
582-
(defined(HAVE_ECC384) || defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES))
582+
(defined(HAVE_ECC384) || defined(HAVE_ECC521) || \
583+
defined(HAVE_ALL_CURVES)) && \
584+
(!defined(WOLFSSL_SP_521) || \
585+
((!defined(HAVE_FIPS) || FIPS_VERSION_GT(7,0)) && !defined(HAVE_SELFTEST)))
583586
/* Verify the output-buffer size contract of wc_ecc_shared_secret() at the
584587
* field-size boundary. The single-precision (SP) math secret generators for
585588
* P-384/P-521 historically validated the caller's buffer against the wrong
@@ -655,7 +658,10 @@ int test_wc_ecc_shared_secret_size_bounds(void)
655658
{
656659
EXPECT_DECLS;
657660
#if defined(HAVE_ECC) && defined(HAVE_ECC_DHE) && !defined(WC_NO_RNG) && \
658-
(defined(HAVE_ECC384) || defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES))
661+
(defined(HAVE_ECC384) || defined(HAVE_ECC521) || \
662+
defined(HAVE_ALL_CURVES)) && \
663+
(!defined(WOLFSSL_SP_521) || \
664+
((!defined(HAVE_FIPS) || FIPS_VERSION_GT(7,0)) && !defined(HAVE_SELFTEST)))
659665
WC_RNG rng;
660666
int rngInit = 0;
661667

tests/api/test_ossl_x509_str.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,7 @@ int test_X509_verify_cert_untrusted_inter(void)
15101510
#if defined(OPENSSL_EXTRA) && !defined(NO_RSA) && !defined(NO_CERTS) && \
15111511
defined(WOLFSSL_CERT_GEN) && defined(WOLFSSL_CERT_EXT) && \
15121512
!defined(NO_SHA256) && defined(USE_CERT_BUFFERS_2048) && \
1513-
!defined(NO_ASN_TIME)
1513+
!defined(NO_ASN_TIME) && !defined(ALLOW_INVALID_CERTSIGN)
15141514
/* Build a CA:TRUE intermediate signed by the 2048-bit test root
15151515
* (ca_cert_der_2048 / ca_key_der_2048). keyUsage == NULL omits the KeyUsage
15161516
* extension entirely. Returns the DER length, or <= 0 on failure. */
@@ -1619,7 +1619,9 @@ int test_X509_verify_cert_ca_no_keycertsign(void)
16191619
#if defined(OPENSSL_EXTRA) && !defined(NO_RSA) && !defined(NO_CERTS) && \
16201620
defined(WOLFSSL_CERT_GEN) && defined(WOLFSSL_CERT_EXT) && \
16211621
!defined(NO_SHA256) && defined(USE_CERT_BUFFERS_2048) && \
1622-
!defined(NO_ASN_TIME)
1622+
!defined(NO_ASN_TIME) && !defined(ALLOW_INVALID_CERTSIGN)
1623+
/* ALLOW_INVALID_CERTSIGN disables the keyCertSign enforcement that Case 1
1624+
* relies on, so the test is only meaningful when it is not defined. */
16231625
WC_RNG rng;
16241626
RsaKey caKey, intKey, leafKey;
16251627
int rngI = 0, caI = 0, intI = 0, leafI = 0;

0 commit comments

Comments
 (0)