Skip to content

Commit b3031d2

Browse files
authored
Merge pull request #9255 from SparkiDev/tls13_cookie_hash
TLS 1.3 Cookie Hash: use stronger hash if no SHA-256
2 parents d9b52d8 + e14cc3a commit b3031d2

File tree

7 files changed

+96
-40
lines changed

7 files changed

+96
-40
lines changed

src/tls13.c

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static int DeriveKeyMsg(WOLFSSL* ssl, byte* output, int outputLen,
306306
int ret = WC_NO_ERR_TRACE(BAD_FUNC_ARG);
307307

308308
switch (hashAlgo) {
309-
#ifndef NO_WOLFSSL_SHA256
309+
#ifndef NO_SHA256
310310
case sha256_mac:
311311
ret = wc_InitSha256_ex(&digest.sha256, ssl->heap, ssl->devId);
312312
if (ret == 0) {
@@ -3611,14 +3611,21 @@ int CreateCookieExt(const WOLFSSL* ssl, byte* hash, word16 hashSz,
36113611
cookieSz += OPAQUE16_LEN;
36123612
}
36133613

3614-
#if !defined(NO_SHA) && defined(NO_SHA256)
3615-
cookieType = SHA;
3616-
macSz = WC_SHA_DIGEST_SIZE;
3617-
#endif /* NO_SHA */
36183614
#ifndef NO_SHA256
36193615
cookieType = WC_SHA256;
36203616
macSz = WC_SHA256_DIGEST_SIZE;
3621-
#endif /* NO_SHA256 */
3617+
#elif defined(WOLFSSL_SHA384)
3618+
cookieType = WC_SHA384;
3619+
macSz = WC_SHA384_DIGEST_SIZE;
3620+
#elif defined(WOLFSSL_TLS13_SHA512)
3621+
cookieType = WC_SHA512;
3622+
macSz = WC_SHA512_DIGEST_SIZE;
3623+
#elif defined(WOLFSSL_SM3)
3624+
cookieType = WC_SM3;
3625+
macSz = WC_SM3_DIGEST_SIZE;
3626+
#else
3627+
#error "No digest to available to use with HMAC for cookies."
3628+
#endif /* NO_SHA */
36223629

36233630
ret = wc_HmacInit(&cookieHmac, ssl->heap, ssl->devId);
36243631
if (ret == 0) {
@@ -6471,14 +6478,21 @@ int TlsCheckCookie(const WOLFSSL* ssl, const byte* cookie, word16 cookieSz)
64716478
return COOKIE_ERROR;
64726479
}
64736480

6474-
#if !defined(NO_SHA) && defined(NO_SHA256)
6475-
cookieType = SHA;
6476-
macSz = WC_SHA_DIGEST_SIZE;
6477-
#endif /* NO_SHA */
64786481
#ifndef NO_SHA256
64796482
cookieType = WC_SHA256;
64806483
macSz = WC_SHA256_DIGEST_SIZE;
6481-
#endif /* NO_SHA256 */
6484+
#elif defined(WOLFSSL_SHA384)
6485+
cookieType = WC_SHA384;
6486+
macSz = WC_SHA384_DIGEST_SIZE;
6487+
#elif defined(WOLFSSL_TLS13_SHA512)
6488+
cookieType = WC_SHA512;
6489+
macSz = WC_SHA512_DIGEST_SIZE;
6490+
#elif defined(WOLFSSL_SM3)
6491+
cookieType = WC_SM3;
6492+
macSz = WC_SM3_DIGEST_SIZE;
6493+
#else
6494+
#error "No digest to available to use with HMAC for cookies."
6495+
#endif /* NO_SHA */
64826496

64836497
if (cookieSz < ssl->specs.hash_size + macSz)
64846498
return HRR_COOKIE_ERROR;
@@ -8404,7 +8418,7 @@ int CreateRSAEncodedSig(byte* sig, byte* sigData, int sigDataSz,
84048418

84058419
/* Digest the signature data. */
84068420
switch (hashAlgo) {
8407-
#ifndef NO_WOLFSSL_SHA256
8421+
#ifndef NO_SHA256
84088422
case sha256_mac:
84098423
ret = wc_InitSha256(&digest.sha256);
84108424
if (ret == 0) {
@@ -8469,7 +8483,7 @@ static int CreateECCEncodedSig(byte* sigData, int sigDataSz, int hashAlgo)
84698483

84708484
/* Digest the signature data. */
84718485
switch (hashAlgo) {
8472-
#ifndef NO_WOLFSSL_SHA256
8486+
#ifndef NO_SHA256
84738487
case sha256_mac:
84748488
ret = wc_InitSha256(&digest.sha256);
84758489
if (ret == 0) {
@@ -13697,12 +13711,17 @@ int wolfSSL_send_hrr_cookie(WOLFSSL* ssl, const unsigned char* secret,
1369713711
return SIDE_ERROR;
1369813712

1369913713
if (secretSz == 0) {
13700-
#if !defined(NO_SHA) && defined(NO_SHA256)
13701-
secretSz = WC_SHA_DIGEST_SIZE;
13702-
#endif /* NO_SHA */
1370313714
#ifndef NO_SHA256
1370413715
secretSz = WC_SHA256_DIGEST_SIZE;
13705-
#endif /* NO_SHA256 */
13716+
#elif defined(WOLFSSL_SHA384)
13717+
secretSz = WC_SHA384_DIGEST_SIZE;
13718+
#elif defined(WOLFSSL_TLS13_SHA512)
13719+
secretSz = WC_SHA512_DIGEST_SIZE;
13720+
#elif defined(WOLFSSL_SM3)
13721+
secretSz = WC_SM3_DIGEST_SIZE;
13722+
#else
13723+
#error "No digest to available to use with HMAC for cookies."
13724+
#endif /* NO_SHA */
1370613725
}
1370713726

1370813727
if (secretSz != ssl->buffers.tls13CookieSecret.length) {

tests/api.c

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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

94669476
static 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)
2516325175
static const char* dn = NULL;
2516425176
static 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
3767537687
static 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
4205042063
static 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

4222842242
static 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)
4731547332
static 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)
4948249500
static 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)
4997049991
static 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)
5005950080
static 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)
5029050312
static 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),

tests/api/test_dtls.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,8 @@ int test_dtls_record_cross_boundaries(void)
12471247
}
12481248
#endif /* defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && defined(WOLFSSL_DTLS) */
12491249

1250-
#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12)
1250+
#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && \
1251+
!defined(WOLFSSL_NO_TLS12) && !defined(NO_SHA256)
12511252
/* This test that the DTLS record boundary check doesn't interfere with TLS
12521253
* records processing */
12531254
int test_records_span_network_boundaries(void)

tests/api/test_pkcs12.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int test_wc_i2d_PKCS12(void)
4242
EXPECT_DECLS;
4343
#if !defined(NO_ASN) && !defined(NO_PWDBASED) && defined(HAVE_PKCS12) \
4444
&& !defined(NO_FILESYSTEM) && !defined(NO_RSA) \
45-
&& !defined(NO_AES) && !defined(NO_SHA)
45+
&& !defined(NO_AES) && !defined(NO_SHA) && !defined(NO_SHA256)
4646
WC_PKCS12* pkcs12 = NULL;
4747
unsigned char der[FOURK_BUF * 2];
4848
unsigned char* pt;
@@ -163,6 +163,7 @@ int test_wc_PKCS12_create(void)
163163
{
164164
EXPECT_DECLS;
165165

166+
#ifndef NO_SHA256
166167
EXPECT_TEST(test_wc_PKCS12_create_once(-1, -1));
167168
#if !defined(NO_RC4) && !defined(NO_SHA)
168169
EXPECT_TEST(test_wc_PKCS12_create_once(PBE_SHA1_RC4_128, PBE_SHA1_RC4_128));
@@ -187,6 +188,7 @@ int test_wc_PKCS12_create(void)
187188
#if defined(HAVE_AES_CBC) && !defined(NO_AES) && !defined(NO_AES_256) && \
188189
!defined(NO_SHA) && defined(WOLFSSL_ASN_TEMPLATE) && !defined(NO_DES3)
189190
EXPECT_TEST(test_wc_PKCS12_create_once(PBE_AES256_CBC, PBE_SHA1_DES3));
191+
#endif
190192
#endif
191193

192194
(void) test_wc_PKCS12_create_once;

tests/api/test_rsa.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ int test_wc_RsaPrivateKeyDecode(void)
106106
int test_wc_RsaPublicKeyDecode(void)
107107
{
108108
EXPECT_DECLS;
109-
#if !defined(NO_RSA) && (defined(USE_CERT_BUFFERS_1024) || \
110-
defined(USE_CERT_BUFFERS_2048)) && !defined(HAVE_FIPS)
109+
#if !defined(NO_RSA) && !defined(NO_SHA256) && \
110+
(defined(USE_CERT_BUFFERS_1024) || defined(USE_CERT_BUFFERS_2048)) && \
111+
!defined(HAVE_FIPS)
111112
RsaKey keyPub;
112113
byte* tmp = NULL;
113114
word32 idx = 0;

0 commit comments

Comments
 (0)