QUIC TXP: Allow next PN to be used to be queried

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)
This commit is contained in:
Hugo Landau 2023-05-23 12:23:06 +01:00 committed by Pauli
parent 256eee3f3f
commit 007f9e99ea
2 changed files with 14 additions and 0 deletions

View 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

View 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];
}