From: Hugo Landau Date: Tue, 23 May 2023 11:23:06 +0000 (+0100) Subject: QUIC TXP: Allow next PN to be used to be queried X-Git-Tag: openssl-3.2.0-alpha1~631 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=007f9e99ea92989d304584803e693fc90fb6af94;p=thirdparty%2Fopenssl.git QUIC TXP: Allow next PN to be used to be queried Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/21029) --- diff --git a/include/internal/quic_txp.h b/include/internal/quic_txp.h index db95b293078..31578bb1788 100644 --- a/include/internal/quic_txp.h +++ b/include/internal/quic_txp.h @@ -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 diff --git a/ssl/quic/quic_txp.c b/ssl/quic/quic_txp.c index f117b246aaa..08f3d7f7b69 100644 --- a/ssl/quic/quic_txp.c +++ b/ssl/quic/quic_txp.c @@ -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]; +}