]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Released QUIC TLS extension for QUIC v2 draft
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 9 Jun 2022 05:32:06 +0000 (07:32 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Thu, 16 Jun 2022 12:56:24 +0000 (14:56 +0200)
This is not clear at all how to distinguish a QUIC draft version number from a
released one. And among these QUIC draft versions, which one must use the draft
QUIC TLS extension.

According to the QUIC implementations which support v2 draft, the TLS extension
(transport parameters) to be used is the released one
(TLS_EXTENSION_QUIC_TRANSPORT_PARAMETERS).

As the unique QUIC draft version we support is 0xff00001d and as at this time the
unique version with 0xff as most significant byte is this latter which must use
the draft TLS extension, we select the draft TLS extension
(TLS_EXTENSION_QUIC_TRANSPORT_PARAMETERS_DRAFT) only for such versions with 0xff
as most signification byte.

src/xprt_quic.c

index 9d59c459e1bf4fde723f9156b0ec09360ecc49a6..cf88d48774e53a9203d2c21208cc034cdade3cd3 100644 (file)
@@ -4402,7 +4402,7 @@ static struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4,
        }
 
        qc->version = qv;
-       qc->tps_tls_ext = qc->version->num & 0xff000000 ?
+       qc->tps_tls_ext = (qc->version->num & 0xff000000) == 0xff000000 ?
                TLS_EXTENSION_QUIC_TRANSPORT_PARAMETERS_DRAFT:
                TLS_EXTENSION_QUIC_TRANSPORT_PARAMETERS;
        /* TX part. */