Skip to content

Commit 39782ef

Browse files
committed
TLS 1.3 Cookie Hash: use stronger hash if no SHA-256
Order of preference, based on algorithms compiled in, to use with HMAC for TLS 1.3 cookie: 1. SHA-256 2. SHA-384 3. SHA-512 4. SM3 5. SHA-1 Make code compile and unittest pass when SHA-256 not compiled in. Certificates used for testing require SHA-256 so handshake testing fails.
1 parent 1247d2b commit 39782ef

File tree

7 files changed

+99
-41
lines changed

7 files changed

+99
-41
lines changed

src/tls13.c

Lines changed: 38 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) {
@@ -3601,14 +3601,22 @@ int CreateCookieExt(const WOLFSSL* ssl, byte* hash, word16 hashSz,
36013601
cookieSz += OPAQUE16_LEN;
36023602
}
36033603

3604-
#if !defined(NO_SHA) && defined(NO_SHA256)
3605-
cookieType = SHA;
3606-
macSz = WC_SHA_DIGEST_SIZE;
3607-
#endif /* NO_SHA */
36083604
#ifndef NO_SHA256
36093605
cookieType = WC_SHA256;
36103606
macSz = WC_SHA256_DIGEST_SIZE;
3611-
#endif /* NO_SHA256 */
3607+
#elif defined(WOLFSSL_SHA384)
3608+
cookieType = WC_SHA384;
3609+
macSz = WC_SHA384_DIGEST_SIZE;
3610+
#elif defined(WOLFSSL_TLS13_SHA512)
3611+
cookieType = WC_SHA512;
3612+
macSz = WC_SHA512_DIGEST_SIZE;
3613+
#elif defined(WOLFSSL_SM3)
3614+
cookieType = WC_SM3;
3615+
macSz = WC_SM3_DIGEST_SIZE;
3616+
#elif !defined(NO_SHA)
3617+
cookieType = SHA;
3618+
macSz = WC_SHA_DIGEST_SIZE;
3619+
#endif /* NO_SHA */
36123620

36133621
ret = wc_HmacInit(&cookieHmac, ssl->heap, ssl->devId);
36143622
if (ret == 0) {
@@ -6441,14 +6449,22 @@ int TlsCheckCookie(const WOLFSSL* ssl, const byte* cookie, word16 cookieSz)
64416449
return COOKIE_ERROR;
64426450
}
64436451

6444-
#if !defined(NO_SHA) && defined(NO_SHA256)
6445-
cookieType = SHA;
6446-
macSz = WC_SHA_DIGEST_SIZE;
6447-
#endif /* NO_SHA */
64486452
#ifndef NO_SHA256
64496453
cookieType = WC_SHA256;
64506454
macSz = WC_SHA256_DIGEST_SIZE;
6451-
#endif /* NO_SHA256 */
6455+
#elif defined(WOLFSSL_SHA384)
6456+
cookieType = WC_SHA384;
6457+
macSz = WC_SHA384_DIGEST_SIZE;
6458+
#elif defined(WOLFSSL_TLS13_SHA512)
6459+
cookieType = WC_SHA512;
6460+
macSz = WC_SHA512_DIGEST_SIZE;
6461+
#elif defined(WOLFSSL_SM3)
6462+
cookieType = WC_SM3;
6463+
macSz = WC_SM3_DIGEST_SIZE;
6464+
#elif !defined(NO_SHA)
6465+
cookieType = SHA;
6466+
macSz = WC_SHA_DIGEST_SIZE;
6467+
#endif /* NO_SHA */
64526468

64536469
if (cookieSz < ssl->specs.hash_size + macSz)
64546470
return HRR_COOKIE_ERROR;
@@ -8374,7 +8390,7 @@ int CreateRSAEncodedSig(byte* sig, byte* sigData, int sigDataSz,
83748390

83758391
/* Digest the signature data. */
83768392
switch (hashAlgo) {
8377-
#ifndef NO_WOLFSSL_SHA256
8393+
#ifndef NO_SHA256
83788394
case sha256_mac:
83798395
ret = wc_InitSha256(&digest.sha256);
83808396
if (ret == 0) {
@@ -8439,7 +8455,7 @@ static int CreateECCEncodedSig(byte* sigData, int sigDataSz, int hashAlgo)
84398455

84408456
/* Digest the signature data. */
84418457
switch (hashAlgo) {
8442-
#ifndef NO_WOLFSSL_SHA256
8458+
#ifndef NO_SHA256
84438459
case sha256_mac:
84448460
ret = wc_InitSha256(&digest.sha256);
84458461
if (ret == 0) {
@@ -13593,12 +13609,17 @@ int wolfSSL_send_hrr_cookie(WOLFSSL* ssl, const unsigned char* secret,
1359313609
return SIDE_ERROR;
1359413610

1359513611
if (secretSz == 0) {
13596-
#if !defined(NO_SHA) && defined(NO_SHA256)
13597-
secretSz = WC_SHA_DIGEST_SIZE;
13598-
#endif /* NO_SHA */
1359913612
#ifndef NO_SHA256
1360013613
secretSz = WC_SHA256_DIGEST_SIZE;
13601-
#endif /* NO_SHA256 */
13614+
#elif defined(WOLFSSL_SHA384)
13615+
secretSz = WC_SHA384_DIGEST_SIZE;
13616+
#elif defined(WOLFSSL_TLS13_SHA512)
13617+
secretSz = WC_SHA512_DIGEST_SIZE;
13618+
#elif defined(WOLFSSL_SM3)
13619+
secretSz = WC_SM3_DIGEST_SIZE;
13620+
#elif !defined(NO_SHA)
13621+
secretSz = WC_SHA_DIGEST_SIZE;
13622+
#endif /* NO_SHA */
1360213623
}
1360313624

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

tests/api.c

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

93889398
static 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)
2502625038
static const char* dn = NULL;
2502725039
static 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
3751337525
static 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
4187941892
static 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

4205742071
static 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)
4714347160
static 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)
4931049328
static 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)
4979849819
static 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)
4988749908
static 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)
5011450136
static 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),

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)