]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC APL: Use domain flag to determine thread assisted mode
authorHugo Landau <hlandau@openssl.org>
Wed, 24 Apr 2024 09:27:14 +0000 (10:27 +0100)
committerNeil Horman <nhorman@openssl.org>
Mon, 17 Feb 2025 16:27:32 +0000 (11:27 -0500)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24971)

ssl/quic/quic_impl.c
ssl/ssl_lib.c

index 6820b2d7f53016322458e5c2bd4d37fda1e9d52f..ff2b17d7e398ce507de392380fe070d319ad2ec2 100644 (file)
@@ -607,7 +607,7 @@ SSL *ossl_quic_new(SSL_CTX *ctx)
     /* Determine mode of operation. */
 #if !defined(OPENSSL_NO_QUIC_THREAD_ASSIST)
     qc->is_thread_assisted
-        = (ctx->method == OSSL_QUIC_client_thread_method());
+        = ((ctx->domain_flags & SSL_DOMAIN_FLAG_THREAD_ASSISTED) != 0);
 #endif
 
     qc->as_server       = 0; /* TODO(QUIC SERVER): add server support */
index 4d73387dec44279835c1b20f80c9d6b9712cfb36..df5ef083c4a52d337e4e43d356cf719dc45a1776 100644 (file)
@@ -8038,6 +8038,18 @@ int SSL_CTX_set_domain_flags(SSL_CTX *ctx, uint64_t domain_flags)
             return 0;
         }
 
+        /*
+         * Note: We treat MULTI_THREAD as a no-op in non-threaded builds, but
+         * not THREAD_ASSISTED.
+         */
+# ifndef OPENSSL_THREADS
+        if ((domain_flags & SSL_DOMAIN_FLAG_THREAD_ASSISTED) != 0) {
+            ERR_raise_data(ERR_LIB_SSL, ERR_R_UNSUPPORTED,
+                           "thread assisted mode not available in this build");
+            return 0;
+        }
+# endif
+
         ctx->domain_flags = domain_flags;
         return 1;
     }