QUIC CONFORMANCE: RFC 9000 s. 17.2.5.1
authorHugo Landau <hlandau@openssl.org>
Tue, 6 Jun 2023 15:25:11 +0000 (16:25 +0100)
committerPauli <pauli@openssl.org>
Sun, 16 Jul 2023 22:17:57 +0000 (08:17 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)

ssl/quic/quic_channel.c

index 9321ff29edd9b2ccd7db13a1b65bb63974714408..90be59b6688a941b1239d07699904cb9d24de419 100644 (file)
@@ -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;