Fix no-dtls1_2
authorMatt Caswell <matt@openssl.org>
Fri, 22 Jul 2022 10:12:52 +0000 (11:12 +0100)
committerHugo Landau <hlandau@openssl.org>
Mon, 25 Jul 2022 06:35:32 +0000 (07:35 +0100)
dtlstest.c needs some adjusting to handle no-dtls1_2 since commit
7bf2e4d7f0c banned DTLSv1 at the default security level - causing the
test to fail.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18848)

test/dtlstest.c

index e2359addbf6d5bdf18747501380ad61658bd457f..bb781604fa2c8f8936e92c1edfd737c6b7b3b844 100644 (file)
@@ -405,6 +405,12 @@ static int test_just_finished(void)
                                        &sctx, NULL, cert, privkey)))
         return 0;
 
+#ifdef OPENSSL_NO_DTLS1_2
+    /* DTLSv1 is not allowed at the default security level */
+    if (!TEST_true(SSL_CTX_set_cipher_list(sctx, "DEFAULT:@SECLEVEL=0")))
+        goto end;
+#endif
+
     serverssl = SSL_new(sctx);
     rbio = BIO_new(BIO_s_mem());
     wbio = BIO_new(BIO_s_mem());