From: Hugo Landau Date: Wed, 24 Apr 2024 08:36:07 +0000 (+0100) Subject: QUIC APL: Add QUIC Domain SSL Object: Basic Definitions X-Git-Tag: openssl-3.5.0-alpha1~386 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=907759818e9263b4227d426be983d2bad2d6f50a;p=thirdparty%2Fopenssl.git QUIC APL: Add QUIC Domain SSL Object: Basic Definitions Reviewed-by: Matt Caswell Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/24971) --- diff --git a/include/internal/quic_predef.h b/include/internal/quic_predef.h index 1f1012329d8..06fad8cbd4a 100644 --- a/include/internal/quic_predef.h +++ b/include/internal/quic_predef.h @@ -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 diff --git a/include/internal/ssl_unwrap.h b/include/internal/ssl_unwrap.h index 280202258d8..bb434ad3ac7 100644 --- a/include/internal/ssl_unwrap.h +++ b/include/internal/ssl_unwrap.h @@ -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)) diff --git a/ssl/quic/quic_local.h b/ssl/quic/quic_local.h index af24b484af1..b3f68ff3493 100644 --- a/ssl/quic/quic_local.h +++ b/ssl/quic/quic_local.h @@ -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); diff --git a/ssl/ssl_local.h b/ssl/ssl_local.h index 8c104b95f1b..cf308cf4362 100644 --- a/ssl/ssl_local.h +++ b/ssl/ssl_local.h @@ -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)