]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Set the QUIC connection as extra data before calling SSL_set_quic_method()
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 2 Jun 2023 15:00:04 +0000 (17:00 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Fri, 21 Jul 2023 13:53:41 +0000 (15:53 +0200)
This patch is required for the QUIC OpenSSL wrapper, and does not break anything
for the other TLS stacks with their own QUIC support (quictls for instance).

The implementation of SSL_set_quic_method() needs to access the quic_conn object
to store data within. But SSL_set_quic_method() is only aware of the SSL session
object. This is the reason why it is required to set the quic_conn object
as extra data to the SSL session object before calling SSL_set_quic_method()
so that it can be retrieve by SSL_set_quic_method().

src/quic_conn.c

index dd2c6f2353a06fee213a608ea8a6e1723eaa60fd..3ecd377f8534ccd84a86b3d7e459ee929b1854e1 100644 (file)
@@ -6668,8 +6668,8 @@ static int qc_ssl_sess_init(struct quic_conn *qc, SSL_CTX *ssl_ctx, SSL **ssl)
                goto retry;
        }
 
-       if (!SSL_set_quic_method(*ssl, &ha_quic_method) ||
-           !SSL_set_ex_data(*ssl, ssl_qc_app_data_index, qc)) {
+       if (!SSL_set_ex_data(*ssl, ssl_qc_app_data_index, qc) ||
+           !SSL_set_quic_method(*ssl, &ha_quic_method)) {
                SSL_free(*ssl);
                *ssl = NULL;
                if (!retry--)