@@ -3148,7 +3148,8 @@ static int test_wolfSSL_CertManagerLoadCABufferType(void)
31483148{
31493149 EXPECT_DECLS;
31503150#if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) && !defined(NO_TLS) && \
3151- !defined(NO_RSA) && !defined(WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION)
3151+ !defined(NO_RSA) && !defined(NO_SHA256) && \
3152+ !defined(WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION)
31523153 const char* ca_cert = "./certs/ca-cert.pem";
31533154 const char* int1_cert = "./certs/intermediate/ca-int-cert.pem";
31543155 const char* int2_cert = "./certs/intermediate/ca-int2-cert.pem";
@@ -5089,8 +5090,10 @@ static int test_wolfSSL_CertRsaPss(void)
50895090 (HAVE_FIPS_VERSION > 2))) && (!defined(HAVE_SELFTEST) || \
50905091 (defined(HAVE_SELFTEST_VERSION) && (HAVE_SELFTEST_VERSION > 2)))
50915092 XFILE f = XBADFILE;
5093+ #ifndef NO_SHA256
50925094 const char* rsaPssSha256Cert = "./certs/rsapss/ca-rsapss.der";
50935095 const char* rsaPssRootSha256Cert = "./certs/rsapss/root-rsapss.pem";
5096+ #endif
50945097#if defined(WOLFSSL_SHA384) && defined(WOLFSSL_PSS_LONG_SALT) && \
50955098 RSA_MAX_SIZE >= 3072
50965099 const char* rsaPssSha384Cert = "./certs/rsapss/ca-3072-rsapss.der";
@@ -5104,13 +5107,16 @@ static int test_wolfSSL_CertRsaPss(void)
51045107 WOLFSSL_CERT_MANAGER* cm = NULL;
51055108
51065109 ExpectNotNull(cm = wolfSSL_CertManagerNew());
5110+ #ifndef NO_SHA256
51075111 ExpectIntEQ(WOLFSSL_SUCCESS,
51085112 wolfSSL_CertManagerLoadCA(cm, rsaPssRootSha256Cert, NULL));
5113+ #endif
51095114#if defined(WOLFSSL_SHA384) && RSA_MAX_SIZE >= 3072
51105115 ExpectIntEQ(WOLFSSL_SUCCESS,
51115116 wolfSSL_CertManagerLoadCA(cm, rsaPssRootSha384Cert, NULL));
51125117#endif
51135118
5119+ #ifndef NO_SHA256
51145120 ExpectTrue((f = XFOPEN(rsaPssSha256Cert, "rb")) != XBADFILE);
51155121 ExpectIntGT(bytes = (int)XFREAD(buf, 1, sizeof(buf), f), 0);
51165122 if (f != XBADFILE) {
@@ -5120,6 +5126,7 @@ static int test_wolfSSL_CertRsaPss(void)
51205126 wc_InitDecodedCert(&cert, buf, (word32)bytes, NULL);
51215127 ExpectIntEQ(wc_ParseCert(&cert, CERT_TYPE, VERIFY, cm), 0);
51225128 wc_FreeDecodedCert(&cert);
5129+ #endif
51235130
51245131#if defined(WOLFSSL_SHA384) && defined(WOLFSSL_PSS_LONG_SALT) && \
51255132 RSA_MAX_SIZE >= 3072
@@ -5133,6 +5140,9 @@ static int test_wolfSSL_CertRsaPss(void)
51335140#endif
51345141
51355142 wolfSSL_CertManagerFree(cm);
5143+
5144+ (void)buf;
5145+ (void)bytes;
51365146#endif
51375147
51385148 return EXPECT_RESULT();
@@ -9387,6 +9397,8 @@ static void run_wolfssl_client(void* args)
93879397
93889398static int test_wolfSSL_read_write(void)
93899399{
9400+ EXPECT_DECLS;
9401+ #ifndef NO_SHA256
93909402 /* The unit testing for read and write shall happen simultaneously, since
93919403 * one can't do anything with one without the other. (Except for a failure
93929404 * test case.) This function will call all the others that will set up,
@@ -9410,7 +9422,6 @@ static int test_wolfSSL_read_write(void)
94109422 func_args client_args;
94119423 func_args server_args;
94129424 THREAD_TYPE serverThread;
9413- EXPECT_DECLS;
94149425
94159426 XMEMSET(&client_args, 0, sizeof(func_args));
94169427 XMEMSET(&server_args, 0, sizeof(func_args));
@@ -9442,7 +9453,7 @@ static int test_wolfSSL_read_write(void)
94429453#ifdef WOLFSSL_TIRTOS
94439454 fdOpenSession(Task_self());
94449455#endif
9445-
9456+ #endif
94469457 return EXPECT_RESULT();
94479458}
94489459
@@ -25022,7 +25033,8 @@ static int test_wolfSSL_check_domain(void)
2502225033}
2502325034
2502425035#endif /* OPENSSL_EXTRA && HAVE_SSL_MEMIO_TESTS_DEPENDENCIES */
25025- #if defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && !defined(OPENSSL_COMPATIBLE_DEFAULTS)
25036+ #if defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
25037+ !defined(OPENSSL_COMPATIBLE_DEFAULTS) && !defined(NO_SHA256)
2502625038static const char* dn = NULL;
2502725039static int test_wolfSSL_check_domain_basic_client_ssl(WOLFSSL* ssl)
2502825040{
@@ -27719,8 +27731,8 @@ static int test_wolfSSL_SESSION(void)
2771927731{
2772027732 EXPECT_DECLS;
2772127733#if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) && \
27722- !defined(NO_RSA) && defined(HAVE_IO_TESTS_DEPENDENCIES ) && \
27723- !defined(NO_SESSION_CACHE)
27734+ !defined(NO_RSA) && ! defined(NO_SHA256 ) && \
27735+ defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(NO_SESSION_CACHE)
2772427736 WOLFSSL* ssl = NULL;
2772527737 WOLFSSL_CTX* ctx = NULL;
2772627738 WOLFSSL_SESSION* sess = NULL;
@@ -37507,7 +37519,7 @@ static int test_X509_LOOKUP_add_dir(void)
3750737519 *----------------------------------------------------------------------------*/
3750837520#if !defined(NO_CERTS) && (!defined(NO_WOLFSSL_CLIENT) || \
3750937521 !defined(WOLFSSL_NO_CLIENT_AUTH)) && !defined(NO_FILESYSTEM)
37510- #if !defined(NO_RSA) || defined(HAVE_ECC)
37522+ #if ( !defined(NO_RSA) || defined(HAVE_ECC)) && !defined(NO_SHA256 )
3751137523/* Use the Cert Manager(CM) API to generate the error ASN_SIG_CONFIRM_E */
3751237524#ifndef WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION
3751337525static int verify_sig_cm(const char* ca, byte* cert_buf, size_t cert_sz,
@@ -41876,6 +41888,7 @@ static int test_wolfSSL_dtls_stateless(void)
4187641888
4187741889#ifdef HAVE_CERT_CHAIN_VALIDATION
4187841890#ifndef WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION
41891+ #ifndef NO_SHA256
4187941892static int load_ca_into_cm(WOLFSSL_CERT_MANAGER* cm, char* certA)
4188041893{
4188141894 int ret;
@@ -42053,10 +42066,12 @@ static int test_chainJ(WOLFSSL_CERT_MANAGER* cm)
4205342066
4205442067 return ret;
4205542068}
42069+ #endif
4205642070
4205742071static int test_various_pathlen_chains(void)
4205842072{
4205942073 EXPECT_DECLS;
42074+ #ifndef NO_SHA256
4206042075 WOLFSSL_CERT_MANAGER* cm = NULL;
4206142076
4206242077 /* Test chain G (large chain with varying pathLens) */
@@ -42109,6 +42124,7 @@ static int test_various_pathlen_chains(void)
4210942124 ExpectNotNull(cm = wolfSSL_CertManagerNew());
4211042125 ExpectIntEQ(wolfSSL_CertManagerUnloadCAs(cm), WOLFSSL_SUCCESS);
4211142126 wolfSSL_CertManagerFree(cm);
42127+ #endif
4211242128
4211342129 return EXPECT_RESULT();
4211442130}
@@ -47139,7 +47155,8 @@ static int test_dtls13_bad_epoch_ch(void)
4713947155 (!defined(NO_OLD_TLS) && ((!defined(NO_AES) && !defined(NO_AES_CBC)) || \
4714047156 !defined(NO_DES3))) || !defined(WOLFSSL_NO_TLS12)) && \
4714147157 !defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) && \
47142- defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && !defined(NO_SESSION_CACHE)
47158+ defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
47159+ !defined(NO_SESSION_CACHE) && !defined(NO_SHA256)
4714347160static int test_short_session_id_ssl_ready(WOLFSSL* ssl)
4714447161{
4714547162 EXPECT_DECLS;
@@ -48444,8 +48461,9 @@ static int test_certreq_sighash_algos(void)
4844448461 EXPECT_DECLS;
4844548462#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && \
4844648463 !defined(WOLFSSL_MAX_STRENGTH) && defined(HAVE_ECC) && \
48447- defined(WOLFSSL_SHA384) && defined(WOLFSSL_AES_256) && \
48448- defined(HAVE_AES_CBC) && !defined(WOLFSSL_NO_TLS12)
48464+ !defined(NO_SHA256) && defined(WOLFSSL_SHA384) && \
48465+ defined(WOLFSSL_AES_256) && defined(HAVE_AES_CBC) && \
48466+ !defined(WOLFSSL_NO_TLS12)
4844948467 WOLFSSL_CTX *ctx_c = NULL;
4845048468 WOLFSSL_CTX *ctx_s = NULL;
4845148469 WOLFSSL *ssl_c = NULL;
@@ -49310,7 +49328,8 @@ static int test_self_signed_stapling(void)
4931049328static int test_tls_multi_handshakes_one_record(void)
4931149329{
4931249330 EXPECT_DECLS;
49313- #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12)
49331+ #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && \
49332+ !defined(WOLFSSL_NO_TLS12) && !defined(NO_SHA256)
4931449333 struct test_memio_ctx test_ctx;
4931549334 WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;
4931649335 WOLFSSL *ssl_c = NULL, *ssl_s = NULL;
@@ -49515,7 +49534,8 @@ static int test_read_write_hs(void)
4951549534{
4951649535
4951749536 EXPECT_DECLS;
49518- #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12)
49537+ #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && \
49538+ !defined(WOLFSSL_NO_TLS12) && !defined(NO_SHA256)
4951949539 WOLFSSL_CTX *ctx_s = NULL, *ctx_c = NULL;
4952049540 WOLFSSL *ssl_s = NULL, *ssl_c = NULL;
4952149541 struct test_memio_ctx test_ctx;
@@ -49794,7 +49814,8 @@ static int test_get_signature_nid(void)
4979449814}
4979549815
4979649816#ifndef WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION
49797- #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES)
49817+ #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
49818+ !defined(NO_SHA256)
4979849819static word32 test_tls_cert_store_unchanged_HashCaTable(Signer** caTable)
4979949820{
4980049821#ifndef NO_MD5
@@ -49887,7 +49908,8 @@ static int test_tls_cert_store_unchanged_ssl_ready(WOLFSSL* ssl)
4988749908static int test_tls_cert_store_unchanged(void)
4988849909{
4988949910 EXPECT_DECLS;
49890- #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES)
49911+ #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
49912+ !defined(NO_SHA256)
4989149913 test_ssl_cbf client_cbf;
4989249914 test_ssl_cbf server_cbf;
4989349915 int i;
@@ -50114,7 +50136,7 @@ static int test_wolfSSL_SSLDisableRead(void)
5011450136static int test_wolfSSL_inject(void)
5011550137{
5011650138 EXPECT_DECLS;
50117- #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES)
50139+ #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(NO_SHA256)
5011850140 size_t i;
5011950141 struct {
5012050142 method_provider client_meth;
@@ -50542,6 +50564,7 @@ TEST_CASE testCases[] = {
5054250564#endif
5054350565
5054450566 TEST_DECL(test_EVP_PKEY_rsa),
50567+ TEST_DECL(test_wc_RsaPSS_DigitalSignVerify),
5054550568 TEST_DECL(test_EVP_PKEY_ec),
5054650569 TEST_DECL(test_wolfSSL_EVP_PKEY_encrypt),
5054750570 TEST_DECL(test_wolfSSL_EVP_PKEY_sign_verify_rsa),
@@ -50884,7 +50907,6 @@ TEST_CASE testCases[] = {
5088450907#if defined(HAVE_CERT_CHAIN_VALIDATION) && !defined(WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION)
5088550908 TEST_DECL(test_various_pathlen_chains),
5088650909#endif
50887- TEST_DECL(test_wc_RsaPSS_DigitalSignVerify),
5088850910
5088950911 /*********************************
5089050912 * SSL/TLS API tests
@@ -50930,7 +50952,7 @@ TEST_DECL(test_wc_RsaPSS_DigitalSignVerify),
5093050952#if !defined(NO_CERTS) && (!defined(NO_WOLFSSL_CLIENT) || \
5093150953 !defined(WOLFSSL_NO_CLIENT_AUTH)) && !defined(NO_FILESYSTEM) && \
5093250954 !defined(WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION) && \
50933- (!defined(NO_RSA) || defined(HAVE_ECC))
50955+ (!defined(NO_RSA) || defined(HAVE_ECC)) && !defined(NO_SHA256)
5093450956 /* Use the Cert Manager(CM) API to generate the error ASN_SIG_CONFIRM_E */
5093550957 /* Bad certificate signature tests */
5093650958 TEST_DECL(test_EccSigFailure_cm),
0 commit comments