Skip to content

Commit 08d8a74

Browse files
committed
Test fixes
api.c: Update #ifdefs. sp_int.c: Fix free call when hardening is disabled.
1 parent e99bbf9 commit 08d8a74

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

tests/api.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59747,9 +59747,9 @@ static int test_wolfSSL_SESSION(void)
5974759747

5974859748
/* TLS v1.3 requires session tickets */
5974959749
/* CHACHA and POLY1305 required for myTicketEncCb */
59750-
#if defined(WOLFSSL_TLS13) && (!defined(HAVE_SESSION_TICKET) && \
59751-
!defined(WOLFSSL_NO_TLS12) || !(defined(HAVE_CHACHA) && \
59752-
defined(HAVE_POLY1305) && !defined(HAVE_AESGCM)))
59750+
#if !defined(WOLFSSL_NO_TLS12) && (!defined(WOLFSSL_TLS13) || \
59751+
!(defined(HAVE_SESSION_TICKET) && ((defined(HAVE_CHACHA) && \
59752+
defined(HAVE_POLY1305)) || defined(HAVE_AESGCM))))
5975359753
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method()));
5975459754
#else
5975559755
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()));
@@ -82532,7 +82532,13 @@ static int test_dtls13_bad_epoch_ch(void)
8253282532
}
8253382533
#endif
8253482534

82535-
#if defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && !defined(NO_SESSION_CACHE)
82535+
#if ((defined(WOLFSSL_TLS13) && !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB) && \
82536+
defined(HAVE_SESSION_TICKET) && defined(WOLFSSL_TICKET_HAVE_ID) && \
82537+
!defined(WOLFSSL_TLS13_MIDDLEBOX_COMPAT)) || \
82538+
(!defined(NO_OLD_TLS) && ((!defined(NO_AES) && !defined(NO_AES_CBC)) || \
82539+
!defined(NO_DES3))) || !defined(WOLFSSL_NO_TLS12)) && \
82540+
!defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) && \
82541+
defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && !defined(NO_SESSION_CACHE)
8253682542
static int test_short_session_id_ssl_ready(WOLFSSL* ssl)
8253782543
{
8253882544
EXPECT_DECLS;
@@ -82606,7 +82612,6 @@ static int test_short_session_id(void)
8260682612
ExpectIntEQ(test_wolfSSL_client_server_nofail_memio(&client_cbf,
8260782613
&server_cbf, NULL), TEST_SUCCESS);
8260882614
}
82609-
8261082615
return EXPECT_RESULT();
8261182616
}
8261282617
#else

wolfcrypt/src/sp_int.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13655,7 +13655,7 @@ static int _sp_exptmod_base_2(const sp_int* e, int digits, const sp_int* m,
1365513655
#ifndef WC_NO_HARDEN
1365613656
FREE_SP_INT_ARRAY(d, NULL);
1365713657
#else
13658-
FREE_SP_INT(tr, m->used * 2 + 1);
13658+
FREE_SP_INT(tr, NULL);
1365913659
#endif
1366013660
return err;
1366113661
}

0 commit comments

Comments
 (0)