From 212616ed098bcf1190b6f687b234393b33168ba9 Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Tue, 6 Jun 2023 16:25:11 +0100 Subject: [PATCH] QUIC CONFORMANCE: RFC 9000 s. 17.2.5.1 Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/21135) --- ssl/quic/quic_channel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index 9321ff29edd..90be59b6688 100644 --- a/ssl/quic/quic_channel.c +++ b/ssl/quic/quic_channel.c @@ -2298,6 +2298,13 @@ static int ch_retry(QUIC_CHANNEL *ch, { void *buf; + /* + * RFC 9000 s. 17.2.5.1: "A client MUST discard a Retry packet that contains + * a SCID field that is identical to the DCID field of its initial packet." + */ + if (ossl_quic_conn_id_eq(&ch->init_dcid, retry_scid)) + return 0; + /* We change to using the SCID in the Retry packet as the DCID. */ if (!ossl_quic_tx_packetiser_set_cur_dcid(ch->txp, retry_scid)) return 0; -- 2.47.2