]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC APL: Add QUIC Domain SSL Object: Basic Definitions
authorHugo Landau <hlandau@openssl.org>
Wed, 24 Apr 2024 08:36:07 +0000 (09:36 +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)

include/internal/quic_predef.h
include/internal/ssl_unwrap.h
ssl/quic/quic_local.h
ssl/ssl_local.h

index 1f1012329d8a4ee82eceda2c5f7032798efa4dc1..06fad8cbd4a1867c67910d1700501c083200c6d1 100644 (file)
@@ -40,6 +40,7 @@ typedef struct quic_obj_st QUIC_OBJ;
 typedef struct quic_conn_st QUIC_CONNECTION;
 typedef struct quic_xso_st QUIC_XSO;
 typedef struct quic_listener_st QUIC_LISTENER;
+typedef struct quic_domain_st QUIC_DOMAIN;
 
 # endif
 
index 280202258d85f4f58717482c75711ddec478b453..bb434ad3ac7e3cdbcd06425e66c9a45075474d34 100644 (file)
@@ -83,6 +83,13 @@ struct ssl_connection_st *ossl_quic_obj_get0_handshake_layer(QUIC_OBJ *obj);
         ? (c QUIC_LISTENER *)(ssl)                                      \
         : NULL))
 
+#  define QUIC_DOMAIN_FROM_SSL_int(ssl, c)                              \
+    ((ssl) == NULL                                                      \
+     ? NULL                                                             \
+     : ((ssl)->type == SSL_TYPE_QUIC_DOMAIN                             \
+        ? (c QUIC_DOMAIN *)(ssl)                                        \
+        : NULL))
+
 #  define IS_QUIC_CS(ssl) ((ssl) != NULL                                \
                            && ((ssl)->type == SSL_TYPE_QUIC_CONNECTION  \
                                || (ssl)->type == SSL_TYPE_QUIC_XSO))
index af24b484af184624b45773f4008616beda3555ab..b3f68ff34934baaaae39317a9cb3aca71e37a23f 100644 (file)
@@ -123,6 +123,9 @@ struct quic_conn_st {
     /* The QLSO this connection belongs to, if any. */
     QUIC_LISTENER                   *listener;
 
+    /* The QDSO this connection belongs to, if any. */
+    QUIC_DOMAIN                     *domain;
+
     /* The QUIC engine representing the QUIC event domain. */
     QUIC_ENGINE                     *engine;
 
@@ -235,6 +238,9 @@ struct quic_listener_st {
     /* QUIC_OBJ common header, including SSL object common header. */
     QUIC_OBJ                        obj;
 
+    /* The QDSO this connection belongs to, if any. */
+    QUIC_DOMAIN                     *domain;
+
     /* The QUIC engine representing the QUIC event domain. */
     QUIC_ENGINE                     *engine;
 
@@ -253,6 +259,26 @@ struct quic_listener_st {
     unsigned int                    listening               : 1;
 };
 
+/*
+ * QUIC domain SSL object (QDSO) type. This implements the API personality layer
+ * for QDSO objects, wrapping the QUIC-native QUIC_ENGINE object.
+ */
+struct quic_domain_st {
+     /* QUIC_OBJ common header, including SSL object common header. */
+    QUIC_OBJ                        obj;
+
+    /* The QUIC engine representing the QUIC event domain. */
+    QUIC_ENGINE                     *engine;
+
+#if defined(OPENSSL_THREADS)
+    /*
+     * The mutex used to synchronise access to the QUIC_ENGINE. We own this but
+     * provide it to the engine.
+     */
+    CRYPTO_MUTEX                    *mutex;
+#endif
+};
+
 /* Internal calls to the QUIC CSM which come from various places. */
 int ossl_quic_conn_on_handshake_confirmed(QUIC_CONNECTION *qc);
 
index 8c104b95f1b5fb66a3f067f5f162cf707c1624ee..cf308cf4362dfc5fef69a2fddf18f8d019924b6c 100644 (file)
@@ -1221,6 +1221,7 @@ typedef struct cert_pkey_st CERT_PKEY;
 #define SSL_TYPE_QUIC_CONNECTION    0x80
 #define SSL_TYPE_QUIC_XSO           0x81
 #define SSL_TYPE_QUIC_LISTENER      0x82
+#define SSL_TYPE_QUIC_DOMAIN        0x83
 
 #define SSL_TYPE_IS_QUIC(x)         (((x) & 0x80) != 0)