]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add a test for setting TLSv1.2 ciphersuites on a QUIC object
authorMatt Caswell <matt@openssl.org>
Wed, 6 Nov 2024 09:59:46 +0000 (09:59 +0000)
committerTomas Mraz <tomas@openssl.org>
Fri, 8 Nov 2024 13:36:17 +0000 (14:36 +0100)
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25886)

test/quicapitest.c

index 25a9889d4878db05b50b40fbda0cc8461d132453..d384d17cbd17d1fe1d6aa865fb44434bc00c4f7a 100644 (file)
@@ -285,7 +285,7 @@ static int test_fin_only_blocking(void)
 static int test_ciphersuites(void)
 {
     SSL_CTX *ctx = SSL_CTX_new_ex(libctx, NULL, OSSL_QUIC_client_method());
-    SSL *ssl;
+    SSL *ssl = NULL;
     int testresult = 0;
     const STACK_OF(SSL_CIPHER) *ciphers = NULL;
     const SSL_CIPHER *cipher;
@@ -302,10 +302,20 @@ static int test_ciphersuites(void)
     if (!TEST_ptr(ctx))
         return 0;
 
+    /*
+     * Attempting to set TLSv1.2 ciphersuites should succeed, even though they
+     * aren't used in QUIC.
+     */
+    if (!TEST_true(SSL_CTX_set_cipher_list(ctx, "DEFAULT")))
+        goto err;
+
     ssl = SSL_new(ctx);
     if (!TEST_ptr(ssl))
         goto err;
 
+    if (!TEST_true(SSL_set_cipher_list(ssl, "DEFAULT")))
+        goto err;
+
     ciphers = SSL_get_ciphers(ssl);
 
     for (i = 0, j = 0; i < OSSL_NELEM(cipherids); i++) {