Skip to content

Commit

Permalink
QUIC CHANNEL: Keep a reference to a QUIC_PORT
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #22674)
  • Loading branch information
hlandau committed Dec 21, 2023
1 parent 154131d commit 12ab8af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/internal/quic_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
# 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;
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions ssl/quic/quic_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions ssl/quic/quic_channel_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 12ab8af

Please sign in to comment.