]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add api to fetch short conn id len from a given channel/tserver
authorNeil Horman <nhorman@openssl.org>
Wed, 29 Jan 2025 18:17:32 +0000 (13:17 -0500)
committerNeil Horman <nhorman@openssl.org>
Mon, 17 Feb 2025 16:27:34 +0000 (11:27 -0500)
Need an api to fetch the configured conn id len for short headers, add
that in here

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26592)

include/internal/quic_channel.h
include/internal/quic_record_rx.h
include/internal/quic_tserver.h
ssl/quic/quic_channel.c
ssl/quic/quic_record_rx.c
ssl/quic/quic_tserver.c

index 852551e56242a32e3a1ce2667e375037aa0d3ca4..543a5900b906f4f87a11372ad7fa929c4a53a0ba 100644 (file)
@@ -313,6 +313,9 @@ OSSL_STATM *ossl_quic_channel_get_statm(QUIC_CHANNEL *ch);
 /* Gets the TLS handshake layer used with the channel. */
 SSL *ossl_quic_channel_get0_tls(QUIC_CHANNEL *ch);
 
+/* Gets the channels short header connection id length */
+size_t ossl_quic_channel_get_short_header_conn_id_len(QUIC_CHANNEL *ch);
+
 /*
  * Gets/sets the current peer address. Generally this should be used before
  * starting a channel in client mode.
index 001509bd583c10b82e1adf24f76221aacce4610c..10b2e0def4ea4b8bc84935a286402ceca5075317 100644 (file)
@@ -67,6 +67,11 @@ void ossl_qrx_set_msg_callback(OSSL_QRX *qrx, ossl_msg_cb msg_callback,
 void ossl_qrx_set_msg_callback_arg(OSSL_QRX *qrx,
                                    void *msg_callback_arg);
 
+/*
+ * Get the short header connection id len from this qrx
+ */
+size_t ossl_qrx_get_short_hdr_conn_id_len(OSSL_QRX *qrx);
+
 /*
  * Secret Management
  * =================
index 4f358dd4e87c58bdef39817361c52a0fdd5ab470..227ad1d2194738723f734a093625e75e94bd705e 100644 (file)
@@ -81,6 +81,9 @@ ossl_quic_tserver_get_terminate_cause(const QUIC_TSERVER *srv);
 /* Returns 1 if the server is in a terminated state */
 int ossl_quic_tserver_is_terminated(const QUIC_TSERVER *srv);
 
+/* Get out short header conn id length */
+size_t ossl_quic_tserver_get_short_header_conn_id_len(const QUIC_TSERVER *srv);
+
 /*
  * Attempts to read from stream 0. Writes the number of bytes read to
  * *bytes_read and returns 1 on success. If no bytes are available, 0 is written
index 762c333d24bac06fef28342b3988a2d57b61a645..4c52fd49499968f4e61ef0a22dfc62afde58570b 100644 (file)
@@ -568,6 +568,11 @@ err:
     return rc;
 }
 
+size_t ossl_quic_channel_get_short_header_conn_id_len(QUIC_CHANNEL *ch)
+{
+    return ossl_qrx_get_short_hdr_conn_id_len(ch->qrx);
+}
+
 QUIC_STREAM *ossl_quic_channel_get_stream_by_id(QUIC_CHANNEL *ch,
                                                 uint64_t stream_id)
 {
index cc201a6c2feb68ea18bc5170d9d065b80932aacd..666b37f38bd3a01fb2adddda7ce42c5205173b9b 100644 (file)
@@ -1356,3 +1356,8 @@ void ossl_qrx_set_msg_callback_arg(OSSL_QRX *qrx, void *msg_callback_arg)
 {
     qrx->msg_callback_arg = msg_callback_arg;
 }
+
+size_t ossl_qrx_get_short_hdr_conn_id_len(OSSL_QRX *qrx)
+{
+    return qrx->short_conn_id_len;
+}
index 5075661acfa71b0393105d17a2c4fe24bcfcdf36..58d53b3bd49546e2cc71f1c42e27e954627bb731 100644 (file)
@@ -239,6 +239,11 @@ int ossl_quic_tserver_is_terminated(const QUIC_TSERVER *srv)
     return ossl_quic_channel_is_terminated(srv->ch);
 }
 
+size_t ossl_quic_tserver_get_short_header_conn_id_len(const QUIC_TSERVER *srv)
+{
+    return ossl_quic_channel_get_short_header_conn_id_len(srv->ch);
+}
+
 int ossl_quic_tserver_is_handshake_confirmed(const QUIC_TSERVER *srv)
 {
     return ossl_quic_channel_is_handshake_confirmed(srv->ch);