From 36b28ed012427f8d2106620e4a332f256b754c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Mon, 9 May 2022 18:08:13 +0200 Subject: [PATCH] MINOR: quic: Short packets always embed a trailing AEAD TAG 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index fef93ccaf..e0c430163 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -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;