Simplify testing gating logic.
This commit is contained in:
30
tests/api.c
30
tests/api.c
@@ -2054,7 +2054,7 @@ static int test_wolfSSL_CTX_set_cipher_list_bytes(void)
|
||||
|
||||
#if defined(OPENSSL_EXTRA) && defined(WOLFSSL_TLS13) && \
|
||||
!defined(WOLFSSL_NO_TLS12) && \
|
||||
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
|
||||
!defined(NO_WOLFSSL_CLIENT) && \
|
||||
defined(HAVE_AESGCM) && \
|
||||
((!defined(NO_RSA) && defined(HAVE_ECC)) || !defined(NO_ERROR_STRINGS))
|
||||
/* 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)
|
||||
EXPECT_DECLS;
|
||||
#if defined(OPENSSL_EXTRA) && defined(WOLFSSL_TLS13) && \
|
||||
!defined(WOLFSSL_NO_TLS12) && \
|
||||
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
|
||||
!defined(NO_WOLFSSL_CLIENT) && \
|
||||
defined(HAVE_AESGCM) && defined(HAVE_ECC) && !defined(NO_RSA)
|
||||
WOLFSSL_CTX* ctx = NULL;
|
||||
WOLFSSL* ssl = NULL;
|
||||
|
||||
#ifndef NO_WOLFSSL_CLIENT
|
||||
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()));
|
||||
#else
|
||||
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()));
|
||||
#endif
|
||||
|
||||
ExpectNotNull(ssl = wolfSSL_new(ctx));
|
||||
|
||||
/* Set only a TLS 1.2 cipher suite */
|
||||
@@ -2123,17 +2118,12 @@ static int test_wolfSSL_set_cipher_list_tls13_keeps_tls12(void)
|
||||
EXPECT_DECLS;
|
||||
#if defined(OPENSSL_EXTRA) && defined(WOLFSSL_TLS13) && \
|
||||
!defined(WOLFSSL_NO_TLS12) && \
|
||||
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
|
||||
!defined(NO_WOLFSSL_CLIENT) && \
|
||||
defined(HAVE_AESGCM) && !defined(NO_ERROR_STRINGS)
|
||||
WOLFSSL_CTX* ctx = NULL;
|
||||
WOLFSSL* ssl = NULL;
|
||||
|
||||
#ifndef NO_WOLFSSL_CLIENT
|
||||
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()));
|
||||
#else
|
||||
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()));
|
||||
#endif
|
||||
|
||||
ExpectNotNull(ssl = wolfSSL_new(ctx));
|
||||
|
||||
/* Set only a TLS 1.3 cipher suite */
|
||||
@@ -2158,17 +2148,12 @@ static int test_wolfSSL_set_cipher_list_tls12_with_version(void)
|
||||
EXPECT_DECLS;
|
||||
#if defined(OPENSSL_EXTRA) && defined(WOLFSSL_TLS13) && \
|
||||
!defined(WOLFSSL_NO_TLS12) && \
|
||||
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
|
||||
!defined(NO_WOLFSSL_CLIENT) && \
|
||||
defined(HAVE_AESGCM) && defined(HAVE_ECC) && !defined(NO_RSA)
|
||||
WOLFSSL_CTX* ctx = NULL;
|
||||
WOLFSSL* ssl = NULL;
|
||||
|
||||
#ifndef NO_WOLFSSL_CLIENT
|
||||
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()));
|
||||
#else
|
||||
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()));
|
||||
#endif
|
||||
|
||||
ExpectNotNull(ssl = wolfSSL_new(ctx));
|
||||
|
||||
/* 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)
|
||||
EXPECT_DECLS;
|
||||
#if defined(OPENSSL_EXTRA) && defined(WOLFSSL_TLS13) && \
|
||||
!defined(WOLFSSL_NO_TLS12) && \
|
||||
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
|
||||
!defined(NO_WOLFSSL_CLIENT) && \
|
||||
defined(HAVE_AESGCM) && !defined(NO_ERROR_STRINGS)
|
||||
WOLFSSL_CTX* ctx = NULL;
|
||||
WOLFSSL* ssl = NULL;
|
||||
|
||||
#ifndef NO_WOLFSSL_CLIENT
|
||||
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_client_method()));
|
||||
#else
|
||||
ExpectNotNull(ctx = wolfSSL_CTX_new(wolfSSLv23_server_method()));
|
||||
#endif
|
||||
|
||||
ExpectNotNull(ssl = wolfSSL_new(ctx));
|
||||
|
||||
/* Set protocol version to TLS 1.3 (this disables downgrade) */
|
||||
|
||||
Reference in New Issue
Block a user