]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: quic: Release encryption levels and packet number spaces asap
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 27 Jun 2023 17:24:50 +0000 (19:24 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 30 Jun 2023 14:20:55 +0000 (16:20 +0200)
commitf1bfbf24cdfb30af1b4fc653e1d0893767caf805
tree062c6d26b84bfe1996b1bbd95d74f1f531b422f0
parent53caf351a9d66713750b353ee90b77c3bbc08122
MEDIUM: quic: Release encryption levels and packet number spaces asap

Release the memory allocated for the Initial and Handshake encryption level
under packet number spaces as soon as possible.

qc_treat_rx_pkts() has been modified to do that for the Initial case. This must
be done after all the Initial packets have been parsed and the underlying TLS
secrets have been flagged as to be discarded. As the Initial encryption level is
removed from the list attached to the quic_conn object inside a list_for_each_entry()
loop, this latter had to be converted into a list_for_each_entry_safe() loop.

The memory allocated by the Handshake encryption level and packet number spaces
is released just before leaving the handshake I/O callback (qc_conn_io_cb()).

As ->iel and ->hel pointer to Initial and Handshake encryption are reset to null
value when releasing the encryption levels memory, some check have been added
at several place before dereferencing them. Same thing for the ->ipktns and ->htpktns
pointer to packet number spaces.

Also take the opportunity of this patch to modify qc_dgrams_retransmit() to
use packet number space variables in place of encryption level variables to shorten
some statements. Furthermore this reflects the jobs it has to do: retransmit
UDP datagrams from packet number spaces.
src/quic_conn.c