From ed45a1c6b04d0a2f8b4cd3a43cc9f14de8f3c374 Mon Sep 17 00:00:00 2001
From: Todd Short <tshort@akamai.com>
Date: Mon, 18 Oct 2021 16:54:31 -0400
Subject: [PATCH 40/43] QUIC: Error when non-empty session_id in CH

---
 ssl/statem/statem_srvr.c | 9 +++++++++
 1 file changed, 9 insertions(+)

--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -1566,6 +1566,15 @@ MSG_PROCESS_RETURN tls_process_client_he
                 goto err;
             }
         }
+#ifndef OPENSSL_NO_QUIC
+        if (SSL_IS_QUIC(s)) {
+            /* Any other QUIC checks on ClientHello here */
+            if (clienthello->session_id_len > 0) {
+                SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_LENGTH_MISMATCH);
+                goto err;
+            }
+        }
+#endif
     }
 
     if (!PACKET_copy_all(&compression, clienthello->compressions,
