]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix new statem_clnt_test when dtls is disabled
authorNeil Horman <nhorman@openssl.org>
Fri, 3 Jul 2026 20:19:57 +0000 (16:19 -0400)
committerMatt Caswell <matt@openssl.foundation>
Mon, 6 Jul 2026 09:42:17 +0000 (10:42 +0100)
The new statem client tests added in comimt c36a9b4 assume that if
OPENSSL_NO_DTLS is not defined, that we have DTLS support, but we have
this odd setup in which we can have DTLS enabled, but DTLS1_2 disabled,
in which case the needed support isn't present, and the test fails.

why we have it setup that way, I'm not sure, but we should only run the
dtls tests if both DTLS and DTLS1_2 support is available.

Fixes #31851

Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
MergeDate: Mon Jul  6 09:42:44 2026
(Merged from https://github.com/openssl/openssl/pull/31582)

test/statem_clnt_construct_test.c

index 43dc330decccbf3cd8ae10c90fe7705064dcb6ac..459c8ac6d4af467431026046f38ce779241db80b 100644 (file)
@@ -408,7 +408,7 @@ static int test_construct_ch_hrr(void)
 
 /* DTLS happy-path / cookie / random-reuse tests */
 
-#ifndef OPENSSL_NO_DTLS
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_DTLS1_2)
 static int test_construct_ch_dtls(void)
 {
     CH_CONFIG cfg = { 1, 0, 0, 0 };
@@ -715,7 +715,7 @@ int setup_tests(void)
 #endif /* OPENSSL_NO_CACHED_FETCH */
 #endif /* OSSL_NO_USABLE_TLS1_3 */
 
-#ifndef OPENSSL_NO_DTLS
+#if !defined(OPENSSL_NO_DTLS) && !defined(OPENSSL_NO_DTLS1_2)
     ADD_TEST(test_construct_ch_dtls);
     ADD_TEST(test_construct_ch_dtls_cookie);
     ADD_TEST(test_construct_ch_dtls_client_random);