]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: quic: listener connection stuck during handshakes (OpenSSL 3.5)
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 14 Aug 2025 09:48:30 +0000 (11:48 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 14 Aug 2025 12:54:47 +0000 (14:54 +0200)
commit878a72d001a722ac4b65f5bf4cfccef6b01d3c6d
tree237c31d4e0a379599eb76d7ab0771ec719b13512
parenta874821df39e03c03cd7d9f180f507bc36d77875
BUG/MEDIUM: quic: listener connection stuck during handshakes (OpenSSL 3.5)

This issue was reported in GH #3071 by @famfo where a wireshark capture
reveals that some handshake could not complete after having received
two Initial packets. This could happen when the packets were parsed
in two times, calling qc_ssl_provide_all_quic_data() two times.

This is due to crypto data stream counter which was incremented two times
from qc_ssl_provide_all_quic_data() (see cstream->rx.offset += data
statement around line 1223 in quic_ssl.c). One time by the callback
which "receives" the crypto data, and on time by qc_ssl_provide_all_quic_data().

Then when parsing the second crypto data frame, the parser detected
that the crypto were already provided.

To fix this, one could comment the code which increment the crypto data
stream counter by <data>. That said, when using the OpenSSL 3.5 QUIC API
one should not modified the crypto data stream outside of the OpenSSL 3.5
QUIC API.

So, this patch stop calling qc_ssl_provide_all_quic_data() and
qc_ssl_provide_quic_data() and only calls qc_ssl_do_hanshake() after
having received some crypto data. In addition to this, as these functions
are no more called when building haproxy against OpenSSL 3.5, this patch
disable their compilations (with #ifndef HAVE_OPENSSL_QUIC).

This patch depends on this previous one:

     MINOR: quic: implement qc_ssl_do_hanshake()

Thank you to @famto for this report.

Must be backported to 3.2.
include/haproxy/quic_ssl.h
src/quic_conn.c
src/quic_ssl.c