Skip to content

Commit db43287

Browse files
authored
Merge pull request #12254 from SparkiDev/fix-test-build-guards
Tests: fix build guards for client-less and TLS 1.2-only builds
2 parents 56b4d64 + 40aa296 commit db43287

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎tests/api.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5533,6 +5533,9 @@ static int test_wolfSSL_clear_chain_certs(void)
55335533
return EXPECT_RESULT();
55345534
}
55355535

5536+
/* Guarded exactly as its only caller below is: the caller drives a full
5537+
* client/server handshake, so without the client this hook has no user and
5538+
* -Werror=unused-function rejects the build. */
55365539
#if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) && defined(OPENSSL_EXTRA) && \
55375540
defined(KEEP_OUR_CERT) && !defined(NO_RSA) && !defined(NO_TLS) && \
55385541
!defined(NO_WOLFSSL_SERVER) && !defined(NO_WOLFSSL_CLIENT) && \

‎tests/api/test_tls_msgtype.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ int test_tls_msgtype_connection_id(void)
11911191
{
11921192
EXPECT_DECLS;
11931193
#if defined(WOLFSSL_DTLS_CID) && !defined(NO_WOLFSSL_CLIENT) && !defined(NO_TLS) && \
1194-
defined(HAVE_TLS_EXTENSIONS)
1194+
defined(HAVE_TLS_EXTENSIONS) && defined(WOLFSSL_TLS13)
11951195
WOLFSSL_CTX* ctx = NULL;
11961196
WOLFSSL* ssl = NULL;
11971197
byte buf[8];

‎tests/api/test_tls_parse.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,7 @@ int test_TLSX_SecureRenegotiation_parse(void)
11531153
/* Client side response direction: *input == 2*TLS_FINISHED_SZ, but the
11541154
* declared extension length disagrees with it -- length is the
11551155
* second, independent half of that check. */
1156+
#ifndef NO_WOLFSSL_CLIENT
11561157
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
11571158
ExpectNotNull(ctx);
11581159
ssl = NULL;
@@ -1183,6 +1184,7 @@ int test_TLSX_SecureRenegotiation_parse(void)
11831184
}
11841185
wolfSSL_free(ssl);
11851186
wolfSSL_CTX_free(ctx);
1187+
#endif
11861188
#endif
11871189
return EXPECT_RESULT();
11881190
}

0 commit comments

Comments
 (0)