]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Short packets always embed a trailing AEAD TAG
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 9 May 2022 16:08:13 +0000 (18:08 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Thu, 12 May 2022 15:48:35 +0000 (17:48 +0200)
We must drop as soon as possible too small 1-RTT packets to be valid QUIC
packets to avoid replying with stateless reset packets.

src/xprt_quic.c

index fef93ccaf8f7c47446be4d214884205e3b509e45..e0c43016321243758fcf04f585dcc16b402e8984 100644 (file)
@@ -6406,8 +6406,8 @@ static int quic_get_dgram_dcid(unsigned char *buf, const unsigned char *end,
                goto err;
 
        long_header = *buf & QUIC_PACKET_LONG_HEADER_BIT;
-       minlen = long_header ?
-               QUIC_LONG_PACKET_MINLEN : QUIC_SHORT_PACKET_MINLEN + QUIC_HAP_CID_LEN;
+       minlen = long_header ? QUIC_LONG_PACKET_MINLEN :
+               QUIC_SHORT_PACKET_MINLEN + QUIC_HAP_CID_LEN + QUIC_TLS_TAG_LEN;
        skip = long_header ? QUIC_LONG_PACKET_DCID_OFF : QUIC_SHORT_PACKET_DCID_OFF;
        if (end - buf <= minlen)
                goto err;