@@ -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();
@@ -9455,6 +9465,8 @@ static void run_wolfssl_client(void* args)
94559465
94569466static int test_wolfSSL_read_write(void)
94579467{
9468+ EXPECT_DECLS;
9469+ #ifndef NO_SHA256
94589470 /* The unit testing for read and write shall happen simultaneously, since
94599471 * one can't do anything with one without the other. (Except for a failure
94609472 * test case.) This function will call all the others that will set up,
@@ -9478,7 +9490,6 @@ static int test_wolfSSL_read_write(void)
94789490 func_args client_args;
94799491 func_args server_args;
94809492 THREAD_TYPE serverThread;
9481- EXPECT_DECLS;
94829493
94839494 XMEMSET(&client_args, 0, sizeof(func_args));
94849495 XMEMSET(&server_args, 0, sizeof(func_args));
@@ -9510,7 +9521,7 @@ static int test_wolfSSL_read_write(void)
95109521#ifdef WOLFSSL_TIRTOS
95119522 fdOpenSession(Task_self());
95129523#endif
9513-
9524+ #endif
95149525 return EXPECT_RESULT();
95159526}
95169527
@@ -25149,7 +25160,8 @@ static int test_wolfSSL_check_domain(void)
2514925160}
2515025161
2515125162#endif /* OPENSSL_EXTRA && HAVE_SSL_MEMIO_TESTS_DEPENDENCIES */
25152- #if defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && !defined(OPENSSL_COMPATIBLE_DEFAULTS)
25163+ #if defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
25164+ !defined(OPENSSL_COMPATIBLE_DEFAULTS) && !defined(NO_SHA256)
2515325165static const char* dn = NULL;
2515425166static int test_wolfSSL_check_domain_basic_client_ssl(WOLFSSL* ssl)
2515525167{
@@ -27846,8 +27858,8 @@ static int test_wolfSSL_SESSION(void)
2784627858{
2784727859 EXPECT_DECLS;
2784827860#if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) && \
27849- !defined(NO_RSA) && defined(HAVE_IO_TESTS_DEPENDENCIES ) && \
27850- !defined(NO_SESSION_CACHE)
27861+ !defined(NO_RSA) && ! defined(NO_SHA256 ) && \
27862+ defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(NO_SESSION_CACHE)
2785127863 WOLFSSL* ssl = NULL;
2785227864 WOLFSSL_CTX* ctx = NULL;
2785327865 WOLFSSL_SESSION* sess = NULL;
@@ -37634,7 +37646,7 @@ static int test_X509_LOOKUP_add_dir(void)
3763437646 *----------------------------------------------------------------------------*/
3763537647#if !defined(NO_CERTS) && (!defined(NO_WOLFSSL_CLIENT) || \
3763637648 !defined(WOLFSSL_NO_CLIENT_AUTH)) && !defined(NO_FILESYSTEM)
37637- #if !defined(NO_RSA) || defined(HAVE_ECC)
37649+ #if ( !defined(NO_RSA) || defined(HAVE_ECC)) && !defined(NO_SHA256 )
3763837650/* Use the Cert Manager(CM) API to generate the error ASN_SIG_CONFIRM_E */
3763937651#ifndef WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION
3764037652static int verify_sig_cm(const char* ca, byte* cert_buf, size_t cert_sz,
@@ -42012,6 +42024,7 @@ static int test_wolfSSL_dtls_stateless(void)
4201242024#ifdef HAVE_CERT_CHAIN_VALIDATION
4201342025#ifndef WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION
4201442026#ifdef WOLFSSL_PEM_TO_DER
42027+ #ifndef NO_SHA256
4201542028static int load_ca_into_cm(WOLFSSL_CERT_MANAGER* cm, char* certA)
4201642029{
4201742030 int ret;
@@ -42189,10 +42202,12 @@ static int test_chainJ(WOLFSSL_CERT_MANAGER* cm)
4218942202
4219042203 return ret;
4219142204}
42205+ #endif
4219242206
4219342207static int test_various_pathlen_chains(void)
4219442208{
4219542209 EXPECT_DECLS;
42210+ #ifndef NO_SHA256
4219642211 WOLFSSL_CERT_MANAGER* cm = NULL;
4219742212
4219842213 /* Test chain G (large chain with varying pathLens) */
@@ -42245,6 +42260,7 @@ static int test_various_pathlen_chains(void)
4224542260 ExpectNotNull(cm = wolfSSL_CertManagerNew());
4224642261 ExpectIntEQ(wolfSSL_CertManagerUnloadCAs(cm), WOLFSSL_SUCCESS);
4224742262 wolfSSL_CertManagerFree(cm);
42263+ #endif
4224842264
4224942265 return EXPECT_RESULT();
4225042266}
@@ -47276,7 +47292,8 @@ static int test_dtls13_bad_epoch_ch(void)
4727647292 (!defined(NO_OLD_TLS) && ((!defined(NO_AES) && !defined(NO_AES_CBC)) || \
4727747293 !defined(NO_DES3))) || !defined(WOLFSSL_NO_TLS12)) && \
4727847294 !defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) && \
47279- defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && !defined(NO_SESSION_CACHE)
47295+ defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
47296+ !defined(NO_SESSION_CACHE) && !defined(NO_SHA256)
4728047297static int test_short_session_id_ssl_ready(WOLFSSL* ssl)
4728147298{
4728247299 EXPECT_DECLS;
@@ -48581,8 +48598,9 @@ static int test_certreq_sighash_algos(void)
4858148598 EXPECT_DECLS;
4858248599#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && \
4858348600 !defined(WOLFSSL_MAX_STRENGTH) && defined(HAVE_ECC) && \
48584- defined(WOLFSSL_SHA384) && defined(WOLFSSL_AES_256) && \
48585- defined(HAVE_AES_CBC) && !defined(WOLFSSL_NO_TLS12)
48601+ !defined(NO_SHA256) && defined(WOLFSSL_SHA384) && \
48602+ defined(WOLFSSL_AES_256) && defined(HAVE_AES_CBC) && \
48603+ !defined(WOLFSSL_NO_TLS12)
4858648604 WOLFSSL_CTX *ctx_c = NULL;
4858748605 WOLFSSL_CTX *ctx_s = NULL;
4858848606 WOLFSSL *ssl_c = NULL;
@@ -49447,7 +49465,8 @@ static int test_self_signed_stapling(void)
4944749465static int test_tls_multi_handshakes_one_record(void)
4944849466{
4944949467 EXPECT_DECLS;
49450- #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12)
49468+ #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && \
49469+ !defined(WOLFSSL_NO_TLS12) && !defined(NO_SHA256)
4945149470 struct test_memio_ctx test_ctx;
4945249471 WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;
4945349472 WOLFSSL *ssl_c = NULL, *ssl_s = NULL;
@@ -49652,7 +49671,8 @@ static int test_read_write_hs(void)
4965249671{
4965349672
4965449673 EXPECT_DECLS;
49655- #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12)
49674+ #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && \
49675+ !defined(WOLFSSL_NO_TLS12) && !defined(NO_SHA256)
4965649676 WOLFSSL_CTX *ctx_s = NULL, *ctx_c = NULL;
4965749677 WOLFSSL *ssl_s = NULL, *ssl_c = NULL;
4965849678 struct test_memio_ctx test_ctx;
@@ -49931,7 +49951,8 @@ static int test_get_signature_nid(void)
4993149951}
4993249952
4993349953#ifndef WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION
49934- #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES)
49954+ #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
49955+ !defined(NO_SHA256)
4993549956static word32 test_tls_cert_store_unchanged_HashCaTable(Signer** caTable)
4993649957{
4993749958#ifndef NO_MD5
@@ -50024,7 +50045,8 @@ static int test_tls_cert_store_unchanged_ssl_ready(WOLFSSL* ssl)
5002450045static int test_tls_cert_store_unchanged(void)
5002550046{
5002650047 EXPECT_DECLS;
50027- #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES)
50048+ #if !defined(NO_CERTS) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
50049+ !defined(NO_SHA256)
5002850050 test_ssl_cbf client_cbf;
5002950051 test_ssl_cbf server_cbf;
5003050052 int i;
@@ -50255,7 +50277,7 @@ static int test_wolfSSL_SSLDisableRead(void)
5025550277static int test_wolfSSL_inject(void)
5025650278{
5025750279 EXPECT_DECLS;
50258- #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES)
50280+ #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(NO_SHA256)
5025950281 size_t i;
5026050282 struct {
5026150283 method_provider client_meth;
@@ -50683,6 +50705,7 @@ TEST_CASE testCases[] = {
5068350705#endif
5068450706
5068550707 TEST_DECL(test_EVP_PKEY_rsa),
50708+ TEST_DECL(test_wc_RsaPSS_DigitalSignVerify),
5068650709 TEST_DECL(test_EVP_PKEY_ec),
5068750710 TEST_DECL(test_wolfSSL_EVP_PKEY_encrypt),
5068850711 TEST_DECL(test_wolfSSL_EVP_PKEY_sign_verify_rsa),
@@ -51026,7 +51049,6 @@ TEST_CASE testCases[] = {
5102651049 defined(WOLFSSL_PEM_TO_DER)
5102751050 TEST_DECL(test_various_pathlen_chains),
5102851051#endif
51029- TEST_DECL(test_wc_RsaPSS_DigitalSignVerify),
5103051052
5103151053 /*********************************
5103251054 * SSL/TLS API tests
@@ -51072,7 +51094,7 @@ TEST_DECL(test_wc_RsaPSS_DigitalSignVerify),
5107251094#if !defined(NO_CERTS) && (!defined(NO_WOLFSSL_CLIENT) || \
5107351095 !defined(WOLFSSL_NO_CLIENT_AUTH)) && !defined(NO_FILESYSTEM) && \
5107451096 !defined(WOLFSSL_TEST_APPLE_NATIVE_CERT_VALIDATION) && \
51075- (!defined(NO_RSA) || defined(HAVE_ECC))
51097+ (!defined(NO_RSA) || defined(HAVE_ECC)) && !defined(NO_SHA256)
5107651098 /* Use the Cert Manager(CM) API to generate the error ASN_SIG_CONFIRM_E */
5107751099 /* Bad certificate signature tests */
5107851100 TEST_DECL(test_EccSigFailure_cm),
0 commit comments