Skip to content

Commit

Permalink
QUIC TXP: Allow next PN to be used to be queried
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #21029)
  • Loading branch information
hlandau authored and paulidale committed Jun 15, 2023
1 parent 256eee3 commit 007f9e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/internal/quic_txp.h
Expand Up @@ -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
9 changes: 9 additions & 0 deletions ssl/quic/quic_txp.c
Expand Up @@ -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];
}

0 comments on commit 007f9e9

Please sign in to comment.