QUIC CHANNEL: Keep a reference to a QUIC_PORT
authorHugo Landau <hlandau@openssl.org>
Thu, 9 Nov 2023 10:27:13 +0000 (10:27 +0000)
committerHugo Landau <hlandau@openssl.org>
Thu, 21 Dec 2023 08:11:59 +0000 (08:11 +0000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22674)

include/internal/quic_channel.h
ssl/quic/quic_channel.c
ssl/quic/quic_channel_local.h

index 6f883faf76d702038a8b05e88f7eaba1bdf658f2..d4f3018cc476c73f592f24517f30e209aa152a31 100644 (file)
 #  define QUIC_CHANNEL_STATE_TERMINATED                  4
 
 typedef struct quic_channel_args_st {
+    QUIC_PORT       *port;
+
     OSSL_LIB_CTX    *libctx;
     const char      *propq;
     int             is_server;
@@ -326,6 +328,7 @@ int ossl_quic_channel_is_active(const QUIC_CHANNEL *ch);
 int ossl_quic_channel_is_handshake_complete(const QUIC_CHANNEL *ch);
 int ossl_quic_channel_is_handshake_confirmed(const QUIC_CHANNEL *ch);
 
+QUIC_PORT *ossl_quic_channel_get0_port(QUIC_CHANNEL *ch);
 QUIC_DEMUX *ossl_quic_channel_get0_demux(QUIC_CHANNEL *ch);
 
 SSL *ossl_quic_channel_get0_ssl(QUIC_CHANNEL *ch);
index d3b7947fb462587200512c9463a16599eb40ec76..22a1b158d2f814e1ae5eb87e51891e232f2573c5 100644 (file)
@@ -548,6 +548,7 @@ QUIC_CHANNEL *ossl_quic_channel_new(const QUIC_CHANNEL_ARGS *args)
     if ((ch = OPENSSL_zalloc(sizeof(*ch))) == NULL)
         return NULL;
 
+    ch->port        = args->port;
     ch->libctx      = args->libctx;
     ch->propq       = args->propq;
     ch->is_server   = args->is_server;
@@ -685,6 +686,11 @@ QUIC_DEMUX *ossl_quic_channel_get0_demux(QUIC_CHANNEL *ch)
     return ch->demux;
 }
 
+QUIC_PORT *ossl_quic_channel_get0_port(QUIC_CHANNEL *ch)
+{
+    return ch->port;
+}
+
 CRYPTO_MUTEX *ossl_quic_channel_get_mutex(QUIC_CHANNEL *ch)
 {
     return ch->mutex;
index f4a02559c6480f70462606ff0460311c010696c1..67e648b42f80dbef994acefa72742a387b3a79e1 100644 (file)
@@ -36,6 +36,8 @@ DEFINE_LIST_OF(stateless_reset_tokens, QUIC_SRT_ELEM);
  * Other components should not include this header.
  */
 struct quic_channel_st {
+    QUIC_PORT                       *port;
+
     OSSL_LIB_CTX                    *libctx;
     const char                      *propq;