summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-05-23 12:23:06 +0100
committerPauli <pauli@openssl.org>2023-06-16 09:26:28 +1000
commit16f3b542f89dbdd6029400c740a55d49d4af8e53 (patch)
tree2f1f53ad1742e5b308321d3b085c9af73cee99ee /include
parent48120ea5e3648a581ec8011594641178d85b17c4 (diff)
QUIC: Add internal APIs for white-box testing of key update
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21029)
Diffstat (limited to 'include')
-rw-r--r--include/internal/quic_channel.h8
-rw-r--r--include/internal/quic_record_tx.h6
-rw-r--r--include/internal/quic_ssl.h4
3 files changed, 18 insertions, 0 deletions
diff --git a/include/internal/quic_channel.h b/include/internal/quic_channel.h
index 25b6758d8d..99e3dd6c76 100644
--- a/include/internal/quic_channel.h
+++ b/include/internal/quic_channel.h
@@ -330,6 +330,14 @@ void ossl_quic_channel_set_msg_callback(QUIC_CHANNEL *ch,
void ossl_quic_channel_set_msg_callback_arg(QUIC_CHANNEL *ch,
void *msg_callback_arg);
+/* Testing use only - sets a TXKU threshold packet count override value. */
+void ossl_quic_channel_set_txku_threshold_override(QUIC_CHANNEL *ch,
+ uint64_t tx_pkt_threshold);
+
+/* Testing use only - gets current 1-RTT key epochs for QTX and QRX. */
+uint64_t ossl_quic_channel_get_tx_key_epoch(QUIC_CHANNEL *ch);
+uint64_t ossl_quic_channel_get_rx_key_epoch(QUIC_CHANNEL *ch);
+
# endif
#endif
diff --git a/include/internal/quic_record_tx.h b/include/internal/quic_record_tx.h
index 8b4e1705cb..b4c9bb8d26 100644
--- a/include/internal/quic_record_tx.h
+++ b/include/internal/quic_record_tx.h
@@ -362,6 +362,12 @@ uint64_t ossl_qtx_get_cur_epoch_pkt_count(OSSL_QTX *qtx, uint32_t enc_level);
*/
uint64_t ossl_qtx_get_max_epoch_pkt_count(OSSL_QTX *qtx, uint32_t enc_level);
+/*
+ * Get the 1-RTT EL key epoch number for the QTX. This is intended for
+ * diagnostic purposes. Returns 0 if 1-RTT EL is not provisioned yet.
+ */
+uint64_t ossl_qtx_get_key_epoch(OSSL_QTX *qtx);
+
# endif
#endif
diff --git a/include/internal/quic_ssl.h b/include/internal/quic_ssl.h
index 7ea5ce8063..ed69a80057 100644
--- a/include/internal/quic_ssl.h
+++ b/include/internal/quic_ssl.h
@@ -14,6 +14,7 @@
# include <openssl/bio.h>
# include "internal/quic_record_rx.h" /* OSSL_QRX */
# include "internal/quic_ackm.h" /* OSSL_ACKM */
+# include "internal/quic_channel.h" /* QUIC_CHANNEL */
# ifndef OPENSSL_NO_QUIC
@@ -108,6 +109,9 @@ int ossl_quic_conn_set_override_now_cb(SSL *s,
*/
void ossl_quic_conn_force_assist_thread_wake(SSL *s);
+/* For use by tests only. */
+QUIC_CHANNEL *ossl_quic_conn_get_channel(SSL *s);
+
# endif
#endif