]> git.kaiwu.me - nginx.git/commit
QUIC: prevented generating ACK frames with discarded keys.
authorSergey Kandaurov <pluknet@nginx.com>
Fri, 20 Oct 2023 14:05:07 +0000 (18:05 +0400)
committerSergey Kandaurov <pluknet@nginx.com>
Fri, 20 Oct 2023 14:05:07 +0000 (18:05 +0400)
commit8e1217c46dcd66efa1cc2ca2d2b43d85db24b416
tree273e919a89d70bfaa7501bfb195c2da5920748ee
parentfffd2823ba8bddcdfdffca47990c73cd4298208d
QUIC: prevented generating ACK frames with discarded keys.

Previously it was possible to generate ACK frames using formally discarded
protection keys, in particular, when acknowledging a client Handshake packet
used to complete the TLS handshake and to discard handshake protection keys.
As it happens late in packet processing, it could be possible to generate ACK
frames after the keys were already discarded.

ACK frames are generated from ngx_quic_ack_packet(), either using a posted
push event, which envolves ngx_quic_generate_ack() as a part of the final
packet assembling, or directly in ngx_quic_ack_packet(), such as when there
is no room to add a new ACK range or when the received packet is out of order.
The added keys availability check is used to avoid generating late ACK frames
in both cases.
src/event/quic/ngx_event_quic_ack.c