summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ssl/ssl3con.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ssl/ssl3con.c b/lib/ssl/ssl3con.c
index 103e41581..8e418a458 100644
--- a/lib/ssl/ssl3con.c
+++ b/lib/ssl/ssl3con.c
@@ -8852,7 +8852,9 @@ ssl3_HandleClientHelloPreamble(sslSocket *ss, PRUint8 **b, PRUint32 *length, SEC
/* Grab the client's SID, if present. */
rv = ssl3_ConsumeHandshakeVariable(ss, sidBytes, 1, b, length);
- if (rv != SECSuccess) {
+ /* Check that the SID has the format: opaque legacy_session_id<0..32>, as
+ * specified in RFC8446, Section 4.1.2. */
+ if (rv != SECSuccess || sidBytes->len > SSL3_SESSIONID_BYTES) {
return SECFailure; /* malformed */
}