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.
This commit is contained in:
Frédéric Lécaille 2022-05-09 18:08:13 +02:00
parent e2fb1bf487
commit 36b28ed012

View 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;