]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix no-dtls and no-tls in combination
authorMatt Caswell <matt@openssl.org>
Fri, 11 Aug 2023 08:41:57 +0000 (09:41 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 15 Aug 2023 13:21:52 +0000 (15:21 +0200)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21722)

(cherry picked from commit fb32f6ea42e6916ff88cc44cf5de6e63ba596aca)

test/sslapitest.c

index 45286653b94462fb639ffe3d72b84f0691c632d0..20e3594613667397f01bcae32c3598a3064e7288 100644 (file)
@@ -1688,6 +1688,8 @@ end:
     return testresult;
 }
 
+#if !defined(OPENSSL_NO_TLS1_2) || !defined(OSSL_NO_USABLE_TLS1_3) \
+    || !defined(OPENSSL_NO_DTLS)
 static int execute_cleanse_plaintext(const SSL_METHOD *smeth,
                                      const SSL_METHOD *cmeth,
                                      int min_version, int max_version)
@@ -1709,15 +1711,13 @@ static int execute_cleanse_plaintext(const SSL_METHOD *smeth,
                                        privkey)))
         goto end;
 
-#ifdef OPENSSL_NO_DTLS1_2
-    if (smeth == DTLS_server_method()) {
 # ifdef OPENSSL_NO_DTLS1_2
+    if (smeth == DTLS_server_method()) {
         /* Not supported in the FIPS provider */
         if (is_fips) {
             testresult = 1;
             goto end;
         };
-# endif
         /*
          * Default sigalgs are SHA1 based in <DTLS1.2 which is in security
          * level 0
@@ -1727,7 +1727,7 @@ static int execute_cleanse_plaintext(const SSL_METHOD *smeth,
                                                     "DEFAULT:@SECLEVEL=0")))
             goto end;
     }
-#endif
+# endif
 
     if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl,
                                       NULL, NULL)))
@@ -1791,6 +1791,10 @@ static int execute_cleanse_plaintext(const SSL_METHOD *smeth,
 
     return testresult;
 }
+#endif /*
+        * !defined(OPENSSL_NO_TLS1_2) || !defined(OSSL_NO_USABLE_TLS1_3)
+        * || !defined(OPENSSL_NO_DTLS)
+        */
 
 static int test_cleanse_plaintext(void)
 {