]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Do not accept wrong active_connection_id_limit values
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 6 Mar 2023 12:57:40 +0000 (13:57 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 8 Mar 2023 07:50:54 +0000 (08:50 +0100)
A peer must not send active_connection_id_limit values smaller than 2
which is also the minimum value when not sent.

Make the transport parameters decoding fail in this case.

Must be backported to 2.7.

src/quic_tp.c

index ae013613aad08af2e6dba309d32e08b0ca59f9f1..09921f360f6c46739c3791bc9f6618415398e105 100644 (file)
@@ -609,6 +609,13 @@ static int quic_transport_params_decode(struct quic_transport_params *p, int ser
            !p->initial_source_connection_id_present)
                return 0;
 
+       /* Note that if not received by the peer, active_connection_id_limit will
+        * have QUIC_TP_DFLT_ACTIVE_CONNECTION_ID_LIMIT as default value. This
+        * is also the minimum value for this transport parameter.
+        */
+       if (p->active_connection_id_limit < QUIC_TP_DFLT_ACTIVE_CONNECTION_ID_LIMIT)
+               return 0;
+
        return 1;
 }