]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: quic+openssl_compat: Non initialized TLS encryption levels
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 31 Jul 2023 13:07:06 +0000 (15:07 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Mon, 31 Jul 2023 13:18:36 +0000 (15:18 +0200)
commitbdd863477d66840c05c1773ffb04405cafaec18f
tree008345db9d94c112a9bc67e406a2c956280075eb
parentd52da4ef70eb650b8244e1bd9dd07532ccd5cfde
BUG/MINOR: quic+openssl_compat: Non initialized TLS encryption levels

The ->openssl_compat struct member of the QUIC connection object was not fully
initialized. This was done on purpose, believing that ->write_level and
->read_level member was initialized by quic_tls_compat_keylog_callback() (the
keylog callback) before entering quic_tls_compat_msg_callback() which
has to parse the TLS messages. In fact this is not the case at all.
quic_tls_compat_msg_callback() is called before quic_tls_compat_keylog_callback()
when receiving the first TLS ClientHello message.

->write_level and ->read_level was not initialized to <ssl_encryption_initial> (= 0)
as this is implicitely done by the originial ngxinx wrapper which calloc()s the openssl
compatibily structure. This could lead to a crash after ssl_to_qel_addr() returns
NULL when called by ha_quic_add_handshake_data().

This patch explicitely initialializes ->write_level and ->read_level to
<ssl_encryption_initial> (=0).

No need to backport.
src/quic_openssl_compat.c