From: Hugo Landau Date: Thu, 9 Nov 2023 10:27:13 +0000 (+0000) Subject: QUIC CHANNEL: Remove legacy calls for functionality moved to QUIC_PORT X-Git-Tag: openssl-3.3.0-alpha1~431 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=073e5bc781786078d3f838cecefbe9c4918c2a71;p=thirdparty%2Fopenssl.git QUIC CHANNEL: Remove legacy calls for functionality moved to QUIC_PORT Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/22674) --- diff --git a/include/internal/quic_channel.h b/include/internal/quic_channel.h index d0046d07d1c..c696f933245 100644 --- a/include/internal/quic_channel.h +++ b/include/internal/quic_channel.h @@ -160,7 +160,6 @@ typedef struct quic_terminate_cause_st { unsigned int remote : 1; } QUIC_TERMINATE_CAUSE; - /* * Create a new QUIC channel using the given arguments. The argument structure * does not need to remain allocated. Returns NULL on failure. @@ -295,12 +294,6 @@ OSSL_STATM *ossl_quic_channel_get_statm(QUIC_CHANNEL *ch); int ossl_quic_channel_get_peer_addr(QUIC_CHANNEL *ch, BIO_ADDR *peer_addr); int ossl_quic_channel_set_peer_addr(QUIC_CHANNEL *ch, const BIO_ADDR *peer_addr); -/* Gets/sets the underlying network read and write BIOs. */ -BIO *ossl_quic_channel_get_net_rbio(QUIC_CHANNEL *ch); -BIO *ossl_quic_channel_get_net_wbio(QUIC_CHANNEL *ch); -int ossl_quic_channel_set_net_rbio(QUIC_CHANNEL *ch, BIO *net_rbio); -int ossl_quic_channel_set_net_wbio(QUIC_CHANNEL *ch, BIO *net_wbio); - /* * Returns an existing stream by stream ID. Returns NULL if the stream does not * exist. diff --git a/include/internal/quic_port.h b/include/internal/quic_port.h index 3d9e5b02112..0b24338c2fc 100644 --- a/include/internal/quic_port.h +++ b/include/internal/quic_port.h @@ -26,6 +26,15 @@ * zero or more subsidiary QUIC_CHANNEL instances, each of which represents a * single QUIC connection. All QUIC_CHANNEL instances must belong to a * QUIC_PORT. + * + * A QUIC port is responsible for managing a set of channels which all use the + * same UDP socket, and (in future) for automatically creating new channels when + * incoming connections are received. + * + * In order to retain compatibility with QUIC_TSERVER, it also supports a point + * of legacy compatibility where a caller can create an incoming (server role) + * channel and that channel will be automatically be bound to the next incoming + * connection. In the future this will go away once QUIC_TSERVER is removed. */ typedef struct quic_port_args_st { /* All channels in a QUIC event domain share the same (libctx, propq). */ diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index 24f428a3f88..aa5ea0971ec 100644 --- a/ssl/quic/quic_channel.c +++ b/ssl/quic/quic_channel.c @@ -2531,21 +2531,6 @@ static OSSL_TIME ch_determine_next_tick_deadline(QUIC_CHANNEL *ch) return deadline; } -/* - * QUIC Channel: Network BIO Configuration - * ======================================= - */ - -int ossl_quic_channel_set_net_rbio(QUIC_CHANNEL *ch, BIO *net_rbio) -{ - return ossl_quic_port_set_net_rbio(ch->port, net_rbio); -} - -int ossl_quic_channel_set_net_wbio(QUIC_CHANNEL *ch, BIO *net_wbio) -{ - return ossl_quic_port_set_net_wbio(ch->port, net_wbio); -} - /* * QUIC Channel: Lifecycle Events * ============================== diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 751d5b846a1..7279c37c171 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -874,7 +874,7 @@ void ossl_quic_conn_set0_net_rbio(SSL *s, BIO *net_rbio) if (ctx.qc->net_rbio == net_rbio) return; - if (!ossl_quic_channel_set_net_rbio(ctx.qc->ch, net_rbio)) + if (!ossl_quic_port_set_net_rbio(ctx.qc->port, net_rbio)) return; BIO_free_all(ctx.qc->net_rbio); @@ -901,7 +901,7 @@ void ossl_quic_conn_set0_net_wbio(SSL *s, BIO *net_wbio) if (ctx.qc->net_wbio == net_wbio) return; - if (!ossl_quic_channel_set_net_wbio(ctx.qc->ch, net_wbio)) + if (!ossl_quic_port_set_net_wbio(ctx.qc->port, net_wbio)) return; BIO_free_all(ctx.qc->net_wbio); @@ -1478,8 +1478,8 @@ static int configure_channel(QUIC_CONNECTION *qc) { assert(qc->ch != NULL); - if (!ossl_quic_channel_set_net_rbio(qc->ch, qc->net_rbio) - || !ossl_quic_channel_set_net_wbio(qc->ch, qc->net_wbio) + if (!ossl_quic_port_set_net_rbio(qc->port, qc->net_rbio) + || !ossl_quic_port_set_net_wbio(qc->port, qc->net_wbio) || !ossl_quic_channel_set_peer_addr(qc->ch, &qc->init_peer_addr)) return 0; diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c index bc6668ef90c..885f4d52421 100644 --- a/ssl/quic/quic_tserver.c +++ b/ssl/quic/quic_tserver.c @@ -130,8 +130,8 @@ QUIC_TSERVER *ossl_quic_tserver_new(const QUIC_TSERVER_ARGS *args, if ((srv->ch = ossl_quic_port_create_incoming(srv->port, srv->tls)) == NULL) goto err; - if (!ossl_quic_channel_set_net_rbio(srv->ch, srv->args.net_rbio) - || !ossl_quic_channel_set_net_wbio(srv->ch, srv->args.net_wbio)) + if (!ossl_quic_port_set_net_rbio(srv->port, srv->args.net_rbio) + || !ossl_quic_port_set_net_wbio(srv->port, srv->args.net_wbio)) goto err; qc = OPENSSL_zalloc(sizeof(*qc));