From: Hugo Landau Date: Wed, 24 Apr 2024 09:27:14 +0000 (+0100) Subject: QUIC APL: Use domain flag to determine thread assisted mode X-Git-Tag: openssl-3.5.0-alpha1~383 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a6898db3a03ae1198b522d1e04a143c93a32903;p=thirdparty%2Fopenssl.git QUIC APL: Use domain flag to determine thread assisted mode Reviewed-by: Matt Caswell Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/24971) --- diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 6820b2d7f53..ff2b17d7e39 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -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 */ diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 4d73387dec4..df5ef083c4a 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -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; }