]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Transport parameters encoding without version_information
authorFrederic Lecaille <flecaille@haproxy.com>
Tue, 23 Jan 2024 10:28:45 +0000 (11:28 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Tue, 23 Jan 2024 15:03:29 +0000 (16:03 +0100)
Encode the version_information parameter only if the chosen version is provided
to quic_transport_params_encode() whose aim is to encode into a buffer all the
transport parameters passed as parameter (struct quic_params *p) in addition
to the version_information parameter.

This enables the support of transport parameters encoding without
the version_information transport parameter. This is useful for build against TLS stacks
as boringssl, aws-lc where a subset of the listener transport parameters
without version_information must be set as context string for acception
early data (see https://commondatastorage.googleapis.com/chromium-boringssl-docs/ssl.h.html#SSL_set_quic_early_data_context).

This patch is required to make haproxy builds against aws-lc TLS stack
(USE_OPENSSL_AWSLC) support 0-RTT. Does not impact the others builds.

src/quic_tp.c

index caf48ceb94621bfa1a5be1c23a349f591a2f017c..d13401478cdbe3edee438947c9e68caa90459316 100644 (file)
@@ -565,7 +565,7 @@ int quic_transport_params_encode(unsigned char *buf,
                                          p->active_connection_id_limit))
            return 0;
 
-       if (!quic_transport_param_enc_version_info(&pos, end, chosen_version, server))
+       if (chosen_version && !quic_transport_param_enc_version_info(&pos, end, chosen_version, server))
                return 0;
 
        return pos - head;