]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add OSSL_QUIC_method
authorNeil Horman <nhorman@openssl.org>
Thu, 10 Apr 2025 13:12:11 +0000 (09:12 -0400)
committerNeil Horman <nhorman@openssl.org>
Fri, 5 Dec 2025 15:13:14 +0000 (10:13 -0500)
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27397)

include/internal/ssl_unwrap.h
include/openssl/quic.h
ssl/quic/quic_method.c

index 86c134569883fd77ab82defb01a25457d2d778e4..e796cddb7f987746d443efdd0e486f4fdbcad2aa 100644 (file)
@@ -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)
 
index 8eacc631eb12cd66f3e899c85e734a63ee0db651..69bbb36597e40cf4df428824e8f8b5044ba8e145 100644 (file)
@@ -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
index 8092855efc61a733019d2eab30bc123d76187efc..ad28db3cf957a5de50edc07f11b3ec3298865ee2 100644 (file)
 #include <openssl/objects.h>
 #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,