From d0fd0a287bc0798f4da90e4cd94fb3832309c381 Mon Sep 17 00:00:00 2001 From: Anthony Hu Date: Thu, 8 Feb 2024 16:14:43 -0500 Subject: [PATCH 1/2] Fixup some gating in the tests. Found with: ./configure --enable-wolfclu --enable-asn=template 'CFLAGS=-DNO_ASN_TIME -DWOLFSSL_CUSTOM_OID -DHAVE_OID_ENCODING' --- wolfcrypt/test/test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index b0ba4eec8..829e260d0 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -15710,7 +15710,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t memory_test(void) #ifdef WOLFSSL_CERT_GEN static const char* rsaCaCertFile = CERT_ROOT "ca-cert.pem"; #endif - #if defined(WOLFSSL_ALT_NAMES) || defined(HAVE_PKCS7) + #if (defined(WOLFSSL_ALT_NAMES) || defined(HAVE_PKCS7)) \ + && !defined(NO_ASN_TIME) static const char* rsaCaCertDerFile = CERT_ROOT "ca-cert.der"; #endif #ifdef HAVE_PKCS7 @@ -18050,8 +18051,7 @@ static wc_test_ret_t rsa_certgen_test(RsaKey* key, RsaKey* keypub, WC_RNG* rng, if (ret < 0) { ERROR_OUT(WC_TEST_RET_ENC_EC(ret), exit_rsa); } - -#ifdef WOLFSSL_ALT_NAMES +#if defined(WOLFSSL_ALT_NAMES) || defined(HAVE_PKCS7) /* Get CA Cert for testing */ #ifdef USE_CERT_BUFFERS_1024 XMEMCPY(tmp, ca_cert_der_1024, sizeof_ca_cert_der_1024); From 00c3f5be2ef637aa49b60ef922b28d40c0799f92 Mon Sep 17 00:00:00 2001 From: Anthony Hu Date: Tue, 20 Feb 2024 21:50:03 -0500 Subject: [PATCH 2/2] A fixup --- wolfcrypt/test/test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 829e260d0..b51b1ad93 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -18070,6 +18070,7 @@ static wc_test_ret_t rsa_certgen_test(RsaKey* key, RsaKey* keypub, WC_RNG* rng, ERROR_OUT(WC_TEST_RET_ENC_ERRNO, exit_rsa); #endif /* USE_CERT_BUFFERS */ + #if defined(WOLFSSL_ALT_NAMES) #if !defined(NO_FILESYSTEM) && !defined(USE_CERT_BUFFERS_1024) && \ !defined(USE_CERT_BUFFERS_2048) && !defined(NO_ASN) ret = wc_SetAltNames(myCert, rsaCaCertFile); @@ -18091,7 +18092,8 @@ static wc_test_ret_t rsa_certgen_test(RsaKey* key, RsaKey* keypub, WC_RNG* rng, if (ret < 0) ERROR_OUT(WC_TEST_RET_ENC_EC(ret), exit_rsa); #endif -#endif /* WOLFSSL_ALT_NAMES */ + #endif /* WOLFSSL_ALT_NAMES */ +#endif /* WOLFSSL_ALT_NAMES || HAVE_PKCS7 */ /* Get CA Key */ #ifdef USE_CERT_BUFFERS_1024