summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2022-10-31 13:54:48 +0000
committerHugo Landau <hlandau@openssl.org>2023-01-13 13:20:09 +0000
commit964f0deb81f3025c11e451dc37f8e2f1c85548ed (patch)
tree4ad704f1c97cb61985823782d68f274ce47742b8
parent97c5c52d6c2c5d13db0cc59b3dbf4d75c40ec3ba (diff)
QUIC DEMUX: Allow BIO to be changed
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19703)
-rw-r--r--include/internal/quic_demux.h5
-rw-r--r--ssl/quic/quic_demux.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/include/internal/quic_demux.h b/include/internal/quic_demux.h
index bc5b553582..9cbec61b9e 100644
--- a/include/internal/quic_demux.h
+++ b/include/internal/quic_demux.h
@@ -194,6 +194,11 @@ QUIC_DEMUX *ossl_quic_demux_new(BIO *net_bio,
void ossl_quic_demux_free(QUIC_DEMUX *demux);
/*
+ * Changes the BIO which the demuxer reads from.
+ */
+void ossl_quic_demux_set_bio(QUIC_DEMUX *demux, BIO *net_bio);
+
+/*
* Register a datagram handler callback for a connection ID.
*
* ossl_quic_demux_pump will call the specified function if it receives a datagram
diff --git a/ssl/quic/quic_demux.c b/ssl/quic/quic_demux.c
index 912cec2f23..9ac4a1a415 100644
--- a/ssl/quic/quic_demux.c
+++ b/ssl/quic/quic_demux.c
@@ -150,6 +150,11 @@ void ossl_quic_demux_free(QUIC_DEMUX *demux)
OPENSSL_free(demux);
}
+void ossl_quic_demux_set_bio(QUIC_DEMUX *demux, BIO *net_bio)
+{
+ demux->net_bio = net_bio;
+}
+
static QUIC_DEMUX_CONN *demux_get_by_conn_id(QUIC_DEMUX *demux,
const QUIC_CONN_ID *dst_conn_id)
{