]> 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>
Sat, 11 Jan 2025 21:02:29 +0000 (16:02 -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 9e3fd7255b8907576d84ce051f7d0af00df31deb..75a63c1554bd31fbc91976758cd1d1cdafb9bb8f 100644 (file)
@@ -41,6 +41,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 0bb755c3fb3cd2607d70d835179be2c3c419111c..d3ca626171a0a94d4edc3bb86eb68ac966dd50c2 100644 (file)
@@ -1193,6 +1193,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)