summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-03-06 17:58:32 +0000
committerPauli <pauli@openssl.org>2023-03-22 10:14:25 +1100
commit553a4e00aab3e2cc04f47678cba3cd8345e7b0e3 (patch)
treed84ecccc085bfa096a1d83737ac8d009d99a75e2 /ssl
parentfc11028089c374bb24655895c90eaf069c3cee6f (diff)
QUIC: Add support for datagram injection
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20451)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/quic/quic_channel.c5
-rw-r--r--ssl/quic/quic_impl.c23
2 files changed, 28 insertions, 0 deletions
diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c
index 984ee871b2..86eed313ab 100644
--- a/ssl/quic/quic_channel.c
+++ b/ssl/quic/quic_channel.c
@@ -438,6 +438,11 @@ int ossl_quic_channel_is_handshake_confirmed(const QUIC_CHANNEL *ch)
return ch->handshake_confirmed;
}
+QUIC_DEMUX *ossl_quic_channel_get0_demux(QUIC_CHANNEL *ch)
+{
+ return ch->demux;
+}
+
/*
* QUIC Channel: Callbacks from Miscellaneous Subsidiary Components
* ================================================================
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c
index 12099043ff..436d2efc03 100644
--- a/ssl/quic/quic_impl.c
+++ b/ssl/quic/quic_impl.c
@@ -1245,6 +1245,29 @@ int ossl_quic_conn_stream_conclude(QUIC_CONNECTION *qc)
}
/*
+ * SSL_inject_net_dgram
+ * --------------------
+ */
+int SSL_inject_net_dgram(SSL *s, const unsigned char *buf,
+ size_t buf_len,
+ const BIO_ADDR *peer,
+ const BIO_ADDR *local)
+{
+ QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_SSL(s);
+ QUIC_DEMUX *demux;
+
+ if (!expect_quic_conn(qc))
+ return 0;
+
+ if (qc->ch == NULL)
+ return QUIC_RAISE_NON_NORMAL_ERROR(qc, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED,
+ NULL);
+
+ demux = ossl_quic_channel_get0_demux(qc->ch);
+ return ossl_quic_demux_inject(demux, buf, buf_len, peer, local);
+}
+
+/*
* QUIC Front-End I/O API: SSL_CTX Management
* ==========================================
*/