MINOR: quic: Drop 0-RTT packets if not allowed

Drop the 0-RTT packets for a listener without early data configuration enabled.
This commit is contained in:
Frédéric Lécaille 2022-04-27 15:37:28 +02:00 committed by Amaury Denoyelle
parent 4646cf3b70
commit 3e26698f89

View File

@ -5042,8 +5042,12 @@ static void qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end,
goto err; goto err;
} }
if (pkt->type == QUIC_PACKET_TYPE_INITIAL && if (pkt->type == QUIC_PACKET_TYPE_0RTT && !l->bind_conf->ssl_conf.early_data) {
dgram->len < QUIC_INITIAL_PACKET_MINLEN) { TRACE_PROTO("0-RTT packet not supported", QUIC_EV_CONN_LPKT, qc);
drop_no_con = 1;
}
else if (pkt->type == QUIC_PACKET_TYPE_INITIAL &&
dgram->len < QUIC_INITIAL_PACKET_MINLEN) {
TRACE_PROTO("Too short datagram with an Initial packet", QUIC_EV_CONN_LPKT, qc); TRACE_PROTO("Too short datagram with an Initial packet", QUIC_EV_CONN_LPKT, qc);
drop_no_con = 1; drop_no_con = 1;
} }