From: Neil Horman Date: Thu, 10 Apr 2025 13:12:11 +0000 (-0400) Subject: Add OSSL_QUIC_method X-Git-Tag: 4.0-PRE-CLANG-FORMAT-WEBKIT~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3e371382289ad60baa9e67850b284c33f03e763;p=thirdparty%2Fopenssl.git Add OSSL_QUIC_method Reviewed-by: Saša Nedvědický Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/27397) --- diff --git a/include/internal/ssl_unwrap.h b/include/internal/ssl_unwrap.h index 86c13456988..e796cddb7f9 100644 --- a/include/internal/ssl_unwrap.h +++ b/include/internal/ssl_unwrap.h @@ -51,7 +51,8 @@ struct ssl_connection_st *ossl_quic_obj_get0_handshake_layer(QUIC_OBJ *obj); # define IS_QUIC_METHOD(m) \ ((m) == OSSL_QUIC_client_method() || \ (m) == OSSL_QUIC_client_thread_method() || \ - (m) == OSSL_QUIC_server_method()) + (m) == OSSL_QUIC_server_method() || \ + (m) == OSSL_QUIC_method()) # define IS_QUIC_CTX(ctx) IS_QUIC_METHOD((ctx)->method) diff --git a/include/openssl/quic.h b/include/openssl/quic.h index 8eacc631eb1..69bbb36597e 100644 --- a/include/openssl/quic.h +++ b/include/openssl/quic.h @@ -67,6 +67,11 @@ __owur const SSL_METHOD *OSSL_QUIC_client_thread_method(void); */ __owur const SSL_METHOD *OSSL_QUIC_server_method(void); +/* + * Method used for QUIC client/server connection + */ +__owur const SSL_METHOD *OSSL_QUIC_method(void); + # ifdef __cplusplus } # endif diff --git a/ssl/quic/quic_method.c b/ssl/quic/quic_method.c index 8092855efc6..ad28db3cf95 100644 --- a/ssl/quic/quic_method.c +++ b/ssl/quic/quic_method.c @@ -11,6 +11,16 @@ #include #include "quic_local.h" +/* + * NOTE: An endpoint method can be used to create a quic connection + * for use as a client or server, based on a subsequent call to + * SSL_set_[accept|connect]_state + */ +IMPLEMENT_quic_meth_func(OSSL_QUIC_ANY_VERSION, + OSSL_QUIC_method, + ssl_undefined_function, + ossl_quic_connect, ssl3_undef_enc_method) + IMPLEMENT_quic_meth_func(OSSL_QUIC_ANY_VERSION, OSSL_QUIC_client_method, ssl_undefined_function,