BUG/MINOR: quic: Wrong RETIRE_CONNECTION_ID sequence number check
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 8 Mar 2023 10:01:58 +0000 (11:01 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 8 Mar 2023 13:53:12 +0000 (14:53 +0100)
commitcc101cd2aa44af25f4fb0b895f7ef530b993f45a
treeaebbb4b61602cbef101d1e66975936c07528ce69
parent5907fede87388581353ca1604510b909ddb6d95e
BUG/MINOR: quic: Wrong RETIRE_CONNECTION_ID sequence number check

This bug arrived with this commit:
     b5a8020e9 MINOR: quic: RETIRE_CONNECTION_ID frame handling (RX)
and was revealed by h3 interop tests with clients like s2n-quic and quic-go
as noticed by Amaury.

Indeed, one must check that the CID matching the sequence number provided by a received
RETIRE_CONNECTION_ID frame does not match the DCID of the packet.
Remove useless ->curr_cid_seq_num member from quic_conn struct.
The sequence number lookup must be done in qc_handle_retire_connection_id_frm()
to check the validity of the RETIRE_CONNECTION_ID frame, it returns the CID to be
retired into <cid_to_retire> variable passed as parameter to this function if
the frame is valid and if the CID was not already retired

Must be backported to 2.7.
include/haproxy/quic_conn-t.h
src/quic_conn.c