BUG/MAJOR: quic: Possible crash when processing 1-RTT during 0-RTT session
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 1 Feb 2023 09:31:35 +0000 (10:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 3 Feb 2023 16:55:55 +0000 (17:55 +0100)
commit8417beb7da2b32c33cd703e7a123125c6b0df7b3
tree8b0f8f6e08baebc87005813b9472936981b4516b
parent37ed4a3842d0f8c4a4f77c5f57b2dc1f0401a7e1
BUG/MAJOR: quic: Possible crash when processing 1-RTT during 0-RTT session

This bug was revealed by some C1 interop tests (heavy hanshake packet
corruption) when receiving 1-RTT packets with a key phase update.
This lead the packet to be decrypted with the next key phase secrets.
But this latter is initialized only after the handshake is complete.

In fact, 1-RTT must never be processed before the handshake is complete.
Relying on the "qc->mux_state == QC_MUX_NULL" condition to check the
handshake is complete is wrong during 0-RTT sessions when the mux
is initialized before the handshake is complete.

Must be backported to 2.7 and 2.6.
src/quic_conn.c