Skip to content

Commit 9a53125

Browse files
committed
Simplify testing gating logic.
1 parent d6985a6 commit 9a53125

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

tests/api.c

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,7 @@ static int test_wolfSSL_CTX_set_cipher_list_bytes(void)
20542054

20552055
#if defined(OPENSSL_EXTRA) && defined(WOLFSSL_TLS13) && \
20562056
!defined(WOLFSSL_NO_TLS12) && \
2057-
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
2057+
!defined(NO_WOLFSSL_CLIENT) && \
20582058
defined(HAVE_AESGCM) && \
20592059
((!defined(NO_RSA) && defined(HAVE_ECC)) || !defined(NO_ERROR_STRINGS))
20602060
/* Helper function to check if TLS 1.3 suites exist in the suites list */
@@ -2088,17 +2088,12 @@ static int test_wolfSSL_set_cipher_list_tls12_keeps_tls13(void)
20882088
EXPECT_DECLS;
20892089
#if defined(OPENSSL_EXTRA) && defined(WOLFSSL_TLS13) && \
20902090
!defined(WOLFSSL_NO_TLS12) && \
2091-
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
2091+
!defined(NO_WOLFSSL_CLIENT) && \
20922092
defined(HAVE_AESGCM) && defined(HAVE_ECC) && !defined(NO_RSA)
20932093
WOLFSSL_CTX* ctx = NULL;
20942094
WOLFSSL* ssl = NULL;
20952095

2096-
#ifndef NO_WOLFSSL_CLIENT
20972096
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()));
2098-
#else
2099-
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()));
2100-
#endif
2101-
21022097
ExpectNotNull(ssl = wolfSSL_new(ctx));
21032098

21042099
/* Set only a TLS 1.2 cipher suite */
@@ -2123,17 +2118,12 @@ static int test_wolfSSL_set_cipher_list_tls13_keeps_tls12(void)
21232118
EXPECT_DECLS;
21242119
#if defined(OPENSSL_EXTRA) && defined(WOLFSSL_TLS13) && \
21252120
!defined(WOLFSSL_NO_TLS12) && \
2126-
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
2121+
!defined(NO_WOLFSSL_CLIENT) && \
21272122
defined(HAVE_AESGCM) && !defined(NO_ERROR_STRINGS)
21282123
WOLFSSL_CTX* ctx = NULL;
21292124
WOLFSSL* ssl = NULL;
21302125

2131-
#ifndef NO_WOLFSSL_CLIENT
21322126
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()));
2133-
#else
2134-
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()));
2135-
#endif
2136-
21372127
ExpectNotNull(ssl = wolfSSL_new(ctx));
21382128

21392129
/* Set only a TLS 1.3 cipher suite */
@@ -2158,17 +2148,12 @@ static int test_wolfSSL_set_cipher_list_tls12_with_version(void)
21582148
EXPECT_DECLS;
21592149
#if defined(OPENSSL_EXTRA) && defined(WOLFSSL_TLS13) && \
21602150
!defined(WOLFSSL_NO_TLS12) && \
2161-
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
2151+
!defined(NO_WOLFSSL_CLIENT) && \
21622152
defined(HAVE_AESGCM) && defined(HAVE_ECC) && !defined(NO_RSA)
21632153
WOLFSSL_CTX* ctx = NULL;
21642154
WOLFSSL* ssl = NULL;
21652155

2166-
#ifndef NO_WOLFSSL_CLIENT
21672156
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()));
2168-
#else
2169-
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()));
2170-
#endif
2171-
21722157
ExpectNotNull(ssl = wolfSSL_new(ctx));
21732158

21742159
/* Set protocol version to TLS 1.2 (this disables downgrade) */
@@ -2198,17 +2183,12 @@ static int test_wolfSSL_set_cipher_list_tls13_with_version(void)
21982183
EXPECT_DECLS;
21992184
#if defined(OPENSSL_EXTRA) && defined(WOLFSSL_TLS13) && \
22002185
!defined(WOLFSSL_NO_TLS12) && \
2201-
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
2186+
!defined(NO_WOLFSSL_CLIENT) && \
22022187
defined(HAVE_AESGCM) && !defined(NO_ERROR_STRINGS)
22032188
WOLFSSL_CTX* ctx = NULL;
22042189
WOLFSSL* ssl = NULL;
22052190

2206-
#ifndef NO_WOLFSSL_CLIENT
22072191
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()));
2208-
#else
2209-
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()));
2210-
#endif
2211-
22122192
ExpectNotNull(ssl = wolfSSL_new(ctx));
22132193

22142194
/* Set protocol version to TLS 1.3 (this disables downgrade) */

0 commit comments

Comments
 (0)