QUIC CHANNEL: Remove legacy calls for functionality moved to 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
include/internal/quic_port.h
ssl/quic/quic_channel.c
ssl/quic/quic_impl.c
ssl/quic/quic_tserver.c

index d0046d07d1c95fda0e5245f6ef154b1fccf51ff0..c696f933245aba05e23852333d4afd93da658ab3 100644 (file)
@@ -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.
index 3d9e5b02112d8fc9c4ac19278ec27688398604bb..0b24338c2fcbbb4c35f88c189b2e17f14b3a6e89 100644 (file)
  * 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). */
index 24f428a3f882c38883520e0772f76b201a5f0305..aa5ea0971ec89aa255c347bc7e3578ed4642962e 100644 (file)
@@ -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
  * ==============================
index 751d5b846a1b72b44666b38ae70ea9325cbc5c5a..7279c37c171a73bc76c7f9c3c85eaf8a2826602b 100644 (file)
@@ -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;
 
index bc6668ef90c3e95f69db82f369bfef7898d156ae..885f4d52421b0a13acc0191a3ef4f32eb0967a13 100644 (file)
@@ -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));