Commit a89400969d for openssl.org
commit a89400969d49d42eb8699c6afaf2f613f917fc5b
Author: Neil Horman <nhorman@openssl.org>
Date: Fri Jul 3 16:19:57 2026 -0400
Fix new statem_clnt_test when dtls is disabled
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)
diff --git a/test/statem_clnt_construct_test.c b/test/statem_clnt_construct_test.c
index 43dc330dec..459c8ac6d4 100644
--- a/test/statem_clnt_construct_test.c
+++ b/test/statem_clnt_construct_test.c
@@ -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);