@@ -3172,7 +3172,8 @@ static int test_wolfSSL_CertManagerLoadCABufferType(void)
31723172{
31733173 EXPECT_DECLS;
31743174#if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) && !defined(NO_TLS) && \
3175- !defined(NO_RSA) && !defined(WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION)
3175+ !defined(NO_RSA) && !defined(NO_SHA256) && \
3176+ !defined(WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION)
31763177#if defined(WOLFSSL_PEM_TO_DER)
31773178 const char* ca_cert = "./certs/ca-cert.pem";
31783179 const char* int1_cert = "./certs/intermediate/ca-int-cert.pem";
@@ -5125,12 +5126,14 @@ static int test_wolfSSL_CertRsaPss(void)
51255126 (HAVE_FIPS_VERSION > 2))) && (!defined(HAVE_SELFTEST) || \
51265127 (defined(HAVE_SELFTEST_VERSION) && (HAVE_SELFTEST_VERSION > 2)))
51275128 XFILE f = XBADFILE;
5129+ #ifndef NO_SHA256
51285130 const char* rsaPssSha256Cert = "./certs/rsapss/ca-rsapss.der";
51295131#ifdef WOLFSSL_PEM_TO_DER
51305132 const char* rsaPssRootSha256Cert = "./certs/rsapss/root-rsapss.pem";
51315133#else
51325134 const char* rsaPssRootSha256Cert = "./certs/rsapss/root-rsapss.der";
51335135#endif
5136+ #endif
51345137#if defined(WOLFSSL_SHA384) && defined(WOLFSSL_PSS_LONG_SALT) && \
51355138 RSA_MAX_SIZE >= 3072
51365139 const char* rsaPssSha384Cert = "./certs/rsapss/ca-3072-rsapss.der";
@@ -5148,13 +5151,16 @@ static int test_wolfSSL_CertRsaPss(void)
51485151 WOLFSSL_CERT_MANAGER* cm = NULL;
51495152
51505153 ExpectNotNull(cm = wolfSSL_CertManagerNew());
5154+ #ifndef NO_SHA256
51515155 ExpectIntEQ(WOLFSSL_SUCCESS,
51525156 wolfSSL_CertManagerLoadCA(cm, rsaPssRootSha256Cert, NULL));
5157+ #endif
51535158#if defined(WOLFSSL_SHA384) && RSA_MAX_SIZE >= 3072
51545159 ExpectIntEQ(WOLFSSL_SUCCESS,
51555160 wolfSSL_CertManagerLoadCA(cm, rsaPssRootSha384Cert, NULL));
51565161#endif
51575162
5163+ #ifndef NO_SHA256
51585164 ExpectTrue((f = XFOPEN(rsaPssSha256Cert, "rb")) != XBADFILE);
51595165 ExpectIntGT(bytes = (int)XFREAD(buf, 1, sizeof(buf), f), 0);
51605166 if (f != XBADFILE) {
@@ -5164,6 +5170,7 @@ static int test_wolfSSL_CertRsaPss(void)
51645170 wc_InitDecodedCert(&cert, buf, (word32)bytes, NULL);
51655171 ExpectIntEQ(wc_ParseCert(&cert, CERT_TYPE, VERIFY, cm), 0);
51665172 wc_FreeDecodedCert(&cert);
5173+ #endif
51675174
51685175#if defined(WOLFSSL_SHA384) && defined(WOLFSSL_PSS_LONG_SALT) && \
51695176 RSA_MAX_SIZE >= 3072
@@ -5177,6 +5184,9 @@ static int test_wolfSSL_CertRsaPss(void)
51775184#endif
51785185
51795186 wolfSSL_CertManagerFree(cm);
5187+
5188+ (void)buf;
5189+ (void)bytes;
51805190#endif
51815191
51825192 return EXPECT_RESULT();
@@ -9465,6 +9475,8 @@ static void run_wolfssl_client(void* args)
94659475
94669476static int test_wolfSSL_read_write(void)
94679477{
9478+ EXPECT_DECLS;
9479+ #ifndef NO_SHA256
94689480 /* The unit testing for read and write shall happen simultaneously, since
94699481 * one can't do anything with one without the other. (Except for a failure
94709482 * test case.) This function will call all the others that will set up,
@@ -9488,7 +9500,6 @@ static int test_wolfSSL_read_write(void)
94889500 func_args client_args;
94899501 func_args server_args;
94909502 THREAD_TYPE serverThread;
9491- EXPECT_DECLS;
94929503
94939504 XMEMSET(&client_args, 0, sizeof(func_args));
94949505 XMEMSET(&server_args, 0, sizeof(func_args));
@@ -9520,7 +9531,7 @@ static int test_wolfSSL_read_write(void)
95209531#ifdef WOLFSSL_TIRTOS
95219532 fdOpenSession(Task_self());
95229533#endif
9523-
9534+ #endif
95249535 return EXPECT_RESULT();
95259536}
95269537
@@ -25159,7 +25170,8 @@ static int test_wolfSSL_check_domain(void)
2515925170}
2516025171
2516125172#endif /* OPENSSL_EXTRA && HAVE_SSL_MEMIO_TESTS_DEPENDENCIES */
25162- #if defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && !defined(OPENSSL_COMPATIBLE_DEFAULTS)
25173+ #if defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
25174+ !defined(OPENSSL_COMPATIBLE_DEFAULTS) && !defined(NO_SHA256)
2516325175static const char* dn = NULL;
2516425176static int test_wolfSSL_check_domain_basic_client_ssl(WOLFSSL* ssl)
2516525177{
@@ -27881,8 +27893,8 @@ static int test_wolfSSL_SESSION(void)
2788127893{
2788227894 EXPECT_DECLS;
2788327895#if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) && \
27884- !defined(NO_RSA) && defined(HAVE_IO_TESTS_DEPENDENCIES ) && \
27885- !defined(NO_SESSION_CACHE)
27896+ !defined(NO_RSA) && ! defined(NO_SHA256 ) && \
27897+ defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(NO_SESSION_CACHE)
2788627898 WOLFSSL* ssl = NULL;
2788727899 WOLFSSL_CTX* ctx = NULL;
2788827900 WOLFSSL_SESSION* sess = NULL;
@@ -37669,7 +37681,7 @@ static int test_X509_LOOKUP_add_dir(void)
3766937681 *----------------------------------------------------------------------------*/
3767037682#if !defined(NO_CERTS) && (!defined(NO_WOLFSSL_CLIENT) || \
3767137683 !defined(WOLFSSL_NO_CLIENT_AUTH)) && !defined(NO_FILESYSTEM)
37672- #if !defined(NO_RSA) || defined(HAVE_ECC)
37684+ #if ( !defined(NO_RSA) || defined(HAVE_ECC)) && !defined(NO_SHA256 )
3767337685/* Use the Cert Manager(CM) API to generate the error ASN_SIG_CONFIRM_E */
3767437686#ifndef WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION
3767537687static int verify_sig_cm(const char* ca, byte* cert_buf, size_t cert_sz,
@@ -42047,6 +42059,7 @@ static int test_wolfSSL_dtls_stateless(void)
4204742059#ifdef HAVE_CERT_CHAIN_VALIDATION
4204842060#ifndef WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION
4204942061#ifdef WOLFSSL_PEM_TO_DER
42062+ #ifndef NO_SHA256
4205042063static int load_ca_into_cm(WOLFSSL_CERT_MANAGER* cm, char* certA)
4205142064{
4205242065 int ret;
@@ -42224,10 +42237,12 @@ static int test_chainJ(WOLFSSL_CERT_MANAGER* cm)
4222442237
4222542238 return ret;
4222642239}
42240+ #endif
4222742241
4222842242static int test_various_pathlen_chains(void)
4222942243{
4223042244 EXPECT_DECLS;
42245+ #ifndef NO_SHA256
4223142246 WOLFSSL_CERT_MANAGER* cm = NULL;
4223242247
4223342248 /* Test chain G (large chain with varying pathLens) */
@@ -42280,6 +42295,7 @@ static int test_various_pathlen_chains(void)
4228042295 ExpectNotNull(cm = wolfSSL_CertManagerNew());
4228142296 ExpectIntEQ(wolfSSL_CertManagerUnloadCAs(cm), WOLFSSL_SUCCESS);
4228242297 wolfSSL_CertManagerFree(cm);
42298+ #endif
4228342299
4228442300 return EXPECT_RESULT();
4228542301}
@@ -47311,7 +47327,8 @@ static int test_dtls13_bad_epoch_ch(void)
4731147327 (!defined(NO_OLD_TLS) && ((!defined(NO_AES) && !defined(NO_AES_CBC)) || \
4731247328 !defined(NO_DES3))) || !defined(WOLFSSL_NO_TLS12)) && \
4731347329 !defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) && \
47314- defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && !defined(NO_SESSION_CACHE)
47330+ defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
47331+ !defined(NO_SESSION_CACHE) && !defined(NO_SHA256)
4731547332static int test_short_session_id_ssl_ready(WOLFSSL* ssl)
4731647333{
4731747334 EXPECT_DECLS;
@@ -48616,8 +48633,9 @@ static int test_certreq_sighash_algos(void)
4861648633 EXPECT_DECLS;
4861748634#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && \
4861848635 !defined(WOLFSSL_MAX_STRENGTH) && defined(HAVE_ECC) && \
48619- defined(WOLFSSL_SHA384) && defined(WOLFSSL_AES_256) && \
48620- defined(HAVE_AES_CBC) && !defined(WOLFSSL_NO_TLS12)
48636+ !defined(NO_SHA256) && defined(WOLFSSL_SHA384) && \
48637+ defined(WOLFSSL_AES_256) && defined(HAVE_AES_CBC) && \
48638+ !defined(WOLFSSL_NO_TLS12)
4862148639 WOLFSSL_CTX *ctx_c = NULL;
4862248640 WOLFSSL_CTX *ctx_s = NULL;
4862348641 WOLFSSL *ssl_c = NULL;
@@ -49482,7 +49500,8 @@ static int test_self_signed_stapling(void)
4948249500static int test_tls_multi_handshakes_one_record(void)
4948349501{
4948449502 EXPECT_DECLS;
49485- #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12)
49503+ #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && \
49504+ !defined(WOLFSSL_NO_TLS12) && !defined(NO_SHA256)
4948649505 struct test_memio_ctx test_ctx;
4948749506 WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;
4948849507 WOLFSSL *ssl_c = NULL, *ssl_s = NULL;
@@ -49687,7 +49706,8 @@ static int test_read_write_hs(void)
4968749706{
4968849707
4968949708 EXPECT_DECLS;
49690- #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12)
49709+ #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && \
49710+ !defined(WOLFSSL_NO_TLS12) && !defined(NO_SHA256)
4969149711 WOLFSSL_CTX *ctx_s = NULL, *ctx_c = NULL;
4969249712 WOLFSSL *ssl_s = NULL, *ssl_c = NULL;
4969349713 struct test_memio_ctx test_ctx;
@@ -49966,7 +49986,8 @@ static int test_get_signature_nid(void)
4996649986}
4996749987
4996849988#ifndef WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION
49969- #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES)
49989+ #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
49990+ !defined(NO_SHA256)
4997049991static word32 test_tls_cert_store_unchanged_HashCaTable(Signer** caTable)
4997149992{
4997249993#ifndef NO_MD5
@@ -50059,7 +50080,8 @@ static int test_tls_cert_store_unchanged_ssl_ready(WOLFSSL* ssl)
5005950080static int test_tls_cert_store_unchanged(void)
5006050081{
5006150082 EXPECT_DECLS;
50062- #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES)
50083+ #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
50084+ !defined(NO_SHA256)
5006350085 test_ssl_cbf client_cbf;
5006450086 test_ssl_cbf server_cbf;
5006550087 int i;
@@ -50290,7 +50312,7 @@ static int test_wolfSSL_SSLDisableRead(void)
5029050312static int test_wolfSSL_inject(void)
5029150313{
5029250314 EXPECT_DECLS;
50293- #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES)
50315+ #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(NO_SHA256)
5029450316 size_t i;
5029550317 struct {
5029650318 method_provider client_meth;
@@ -50718,6 +50740,7 @@ TEST_CASE testCases[] = {
5071850740#endif
5071950741
5072050742 TEST_DECL(test_EVP_PKEY_rsa),
50743+ TEST_DECL(test_wc_RsaPSS_DigitalSignVerify),
5072150744 TEST_DECL(test_EVP_PKEY_ec),
5072250745 TEST_DECL(test_wolfSSL_EVP_PKEY_encrypt),
5072350746 TEST_DECL(test_wolfSSL_EVP_PKEY_sign_verify_rsa),
@@ -51061,7 +51084,6 @@ TEST_CASE testCases[] = {
5106151084 defined(WOLFSSL_PEM_TO_DER)
5106251085 TEST_DECL(test_various_pathlen_chains),
5106351086#endif
51064- TEST_DECL(test_wc_RsaPSS_DigitalSignVerify),
5106551087
5106651088 /*********************************
5106751089 * SSL/TLS API tests
@@ -51107,7 +51129,7 @@ TEST_DECL(test_wc_RsaPSS_DigitalSignVerify),
5110751129#if !defined(NO_CERTS) && (!defined(NO_WOLFSSL_CLIENT) || \
5110851130 !defined(WOLFSSL_NO_CLIENT_AUTH)) && !defined(NO_FILESYSTEM) && \
5110951131 !defined(WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION) && \
51110- (!defined(NO_RSA) || defined(HAVE_ECC))
51132+ (!defined(NO_RSA) || defined(HAVE_ECC)) && !defined(NO_SHA256)
5111151133 /* Use the Cert Manager(CM) API to generate the error ASN_SIG_CONFIRM_E */
5111251134 /* Bad certificate signature tests */
5111351135 TEST_DECL(test_EccSigFailure_cm),
0 commit comments