From 825d508a4b688821e99561b72a842c81c93b84a5 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Mon, 11 May 2020 18:03:51 +0000 Subject: Add record version checks. When legacy version is below TLSv1.2 ensure that the record version is SSL3/TLS, however when the legacy version is set to TLSv1.2 require this specifically. ok beck@ tb@ --- src/lib/libssl/tls13_record.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/libssl/tls13_record.c') diff --git a/src/lib/libssl/tls13_record.c b/src/lib/libssl/tls13_record.c index 9ab4cdba36..ca61a94ff1 100644 --- a/src/lib/libssl/tls13_record.c +++ b/src/lib/libssl/tls13_record.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_record.c,v 1.4 2020/02/15 14:36:58 jsing Exp $ */ +/* $OpenBSD: tls13_record.c,v 1.5 2020/05/11 18:03:51 jsing Exp $ */ /* * Copyright (c) 2018, 2019 Joel Sing * @@ -146,6 +146,8 @@ tls13_record_recv(struct tls13_record *rec, tls13_read_cb wire_read, return TLS13_IO_FAILURE; /* XXX - record overflow alert. */ + if ((rec_version >> 8) != SSL3_VERSION_MAJOR) + return TLS13_IO_RECORD_VERSION; if (rec_len > TLS13_RECORD_MAX_CIPHERTEXT_LEN) return TLS13_IO_FAILURE; -- cgit v1.2.3-55-g6feb