]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC TXP: Allow next PN to be used to be queried
authorHugo Landau <hlandau@openssl.org>
Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)
committerPauli <pauli@openssl.org>
Thu, 15 Jun 2023 23:26:28 +0000 (09:26 +1000)
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)

include/internal/quic_txp.h
ssl/quic/quic_txp.c

index db95b293078e9fcfb48ae6ad043e4ce5e3cfdb2f..31578bb1788aa00c16f42442c442578b35a92d49 100644 (file)
@@ -179,6 +179,11 @@ void ossl_quic_tx_packetiser_set_msg_callback(OSSL_QUIC_TX_PACKETISER *txp,
 void ossl_quic_tx_packetiser_set_msg_callback_arg(OSSL_QUIC_TX_PACKETISER *txp,
                                                   void *msg_callback_arg);
 
+/*
+ * Determines the next PN which will be used for a given PN space.
+ */
+QUIC_PN ossl_quic_tx_packetiser_get_next_pn(OSSL_QUIC_TX_PACKETISER *txp,
+                                            uint32_t pn_space);
 # endif
 
 #endif
index f117b246aaa413e4a70c9673b0050d472e9412aa..08f3d7f7b69ef23cb7301258047efbe198c88412 100644 (file)
@@ -2385,3 +2385,12 @@ void ossl_quic_tx_packetiser_set_msg_callback_arg(OSSL_QUIC_TX_PACKETISER *txp,
 {
     txp->msg_callback_arg = msg_callback_arg;
 }
+
+QUIC_PN ossl_quic_tx_packetiser_get_next_pn(OSSL_QUIC_TX_PACKETISER *txp,
+                                            uint32_t pn_space)
+{
+    if (pn_space >= QUIC_PN_SPACE_NUM)
+        return UINT64_MAX;
+
+    return txp->next_pn[pn_space];
+}