Skip to content

Commit e14cc3a

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 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 5804ba7 commit e14cc3a

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) {
@@ -3601,14 +3601,21 @@ 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+
#else
3617+
#error "No digest to available to use with HMAC for cookies."
3618+
#endif /* NO_SHA */
36123619

36133620
ret = wc_HmacInit(&cookieHmac, ssl->heap, ssl->devId);
36143621
if (ret == 0) {
@@ -6456,14 +6463,21 @@ int TlsCheckCookie(const WOLFSSL* ssl, const byte* cookie, word16 cookieSz)
64566463
return COOKIE_ERROR;
64576464
}
64586465

6459-
#if !defined(NO_SHA) && defined(NO_SHA256)
6460-
cookieType = SHA;
6461-
macSz = WC_SHA_DIGEST_SIZE;
6462-
#endif /* NO_SHA */
64636466
#ifndef NO_SHA256
64646467
cookieType = WC_SHA256;
64656468
macSz = WC_SHA256_DIGEST_SIZE;
6466-
#endif /* NO_SHA256 */
6469+
#elif defined(WOLFSSL_SHA384)
6470+
cookieType = WC_SHA384;
6471+
macSz = WC_SHA384_DIGEST_SIZE;
6472+
#elif defined(WOLFSSL_TLS13_SHA512)
6473+
cookieType = WC_SHA512;
6474+
macSz = WC_SHA512_DIGEST_SIZE;
6475+
#elif defined(WOLFSSL_SM3)
6476+
cookieType = WC_SM3;
6477+
macSz = WC_SM3_DIGEST_SIZE;
6478+
#else
6479+
#error "No digest to available to use with HMAC for cookies."
6480+
#endif /* NO_SHA */
64676481

64686482
if (cookieSz < ssl->specs.hash_size + macSz)
64696483
return HRR_COOKIE_ERROR;
@@ -8389,7 +8403,7 @@ int CreateRSAEncodedSig(byte* sig, byte* sigData, int sigDataSz,
83898403

83908404
/* Digest the signature data. */
83918405
switch (hashAlgo) {
8392-
#ifndef NO_WOLFSSL_SHA256
8406+
#ifndef NO_SHA256
83938407
case sha256_mac:
83948408
ret = wc_InitSha256(&digest.sha256);
83958409
if (ret == 0) {
@@ -8454,7 +8468,7 @@ static int CreateECCEncodedSig(byte* sigData, int sigDataSz, int hashAlgo)
84548468

84558469
/* Digest the signature data. */
84568470
switch (hashAlgo) {
8457-
#ifndef NO_WOLFSSL_SHA256
8471+
#ifndef NO_SHA256
84588472
case sha256_mac:
84598473
ret = wc_InitSha256(&digest.sha256);
84608474
if (ret == 0) {
@@ -13608,12 +13622,17 @@ int wolfSSL_send_hrr_cookie(WOLFSSL* ssl, const unsigned char* secret,
1360813622
return SIDE_ERROR;
1360913623

1361013624
if (secretSz == 0) {
13611-
#if !defined(NO_SHA) && defined(NO_SHA256)
13612-
secretSz = WC_SHA_DIGEST_SIZE;
13613-
#endif /* NO_SHA */
1361413625
#ifndef NO_SHA256
1361513626
secretSz = WC_SHA256_DIGEST_SIZE;
13616-
#endif /* NO_SHA256 */
13627+
#elif defined(WOLFSSL_SHA384)
13628+
secretSz = WC_SHA384_DIGEST_SIZE;
13629+
#elif defined(WOLFSSL_TLS13_SHA512)
13630+
secretSz = WC_SHA512_DIGEST_SIZE;
13631+
#elif defined(WOLFSSL_SM3)
13632+
secretSz = WC_SM3_DIGEST_SIZE;
13633+
#else
13634+
#error "No digest to available to use with HMAC for cookies."
13635+
#endif /* NO_SHA */
1361713636
}
1361813637

1361913638
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();
@@ -9455,6 +9465,8 @@ static void run_wolfssl_client(void* args)
94559465

94569466
static 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)
2515325165
static const char* dn = NULL;
2515425166
static 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
3764037652
static 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
4201542028
static 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

4219342207
static 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)
4728047297
static 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)
4944749465
static 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)
4993549956
static 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)
5002450045
static 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)
5025550277
static 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),

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)