diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-05-23 12:23:06 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2023-06-16 09:26:27 +1000 |
commit | 256eee3f3f500a50a434615a054b35a42a2f78b1 (patch) | |
tree | 59d4b203527e2536cd71fcd82ac1d1648825f847 /ssl | |
parent | b65b0d4ebe67ba9d53b96887b54ca9a0f5bf523e (diff) | |
download | openssl-256eee3f3f500a50a434615a054b35a42a2f78b1.tar.gz |
QUIC RX: Refactor key update callback to provide PN
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 'ssl')
-rw-r--r-- | ssl/quic/quic_record_rx.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ssl/quic/quic_record_rx.c b/ssl/quic/quic_record_rx.c index fad678a41e..037399701d 100644 --- a/ssl/quic/quic_record_rx.c +++ b/ssl/quic/quic_record_rx.c @@ -678,13 +678,14 @@ static ossl_inline void ignore_res(int x) /* No-op. */ } -static void qrx_key_update_initiated(OSSL_QRX *qrx) +static void qrx_key_update_initiated(OSSL_QRX *qrx, QUIC_PN pn) { if (!ossl_qrl_enc_level_set_key_update(&qrx->el_set, QUIC_ENC_LEVEL_1RTT)) + /* Returns 0 if already in RXKU, so we don't call callback again. */ return; if (qrx->key_update_cb != NULL) - qrx->key_update_cb(qrx->key_update_cb_arg); + qrx->key_update_cb(pn, qrx->key_update_cb_arg); } /* Process a single packet in a datagram. */ @@ -893,7 +894,7 @@ static int qrx_process_pkt(OSSL_QRX *qrx, QUIC_URXE *urxe, */ if (rxe->hdr.type == QUIC_PKT_TYPE_1RTT && rxe->hdr.key_phase != (el->key_epoch & 1)) - qrx_key_update_initiated(qrx); + qrx_key_update_initiated(qrx, rxe->pn); /* * We have now successfully decrypted the packet payload. If there are |