From cf7a40bb11f97c00986c060585e3bc517ff3b9fb Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 15 Jul 2026 15:00:17 +0000 Subject: Check that the server selected ciphersuite is valid for use with TLSv1.2. In the legacy stack, ensure that the server selected ciphersuite is valid for use with TLSv1.2 - this effectively means that it is not a TLSv1.3 ciphersuite. We currently fail the handshake, but at a later stage. Reported by Tom Gouville from the tlspuffin team. ok tb@ --- src/lib/libssl/ssl_clnt.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/lib/libssl') diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c index d9fdfff2a3..4803e35dd2 100644 --- a/src/lib/libssl/ssl_clnt.c +++ b/src/lib/libssl/ssl_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_clnt.c,v 1.174 2026/07/15 13:56:38 jsing Exp $ */ +/* $OpenBSD: ssl_clnt.c,v 1.175 2026/07/15 15:00:17 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1010,6 +1010,15 @@ ssl3_get_server_hello(SSL *s) goto fatal_err; } + /* Require a ciphersuite that can be used with TLSv1.2. */ + if (cipher->algorithm_ssl != SSL_SSLV3 && + cipher->algorithm_ssl != SSL_TLSV1 && + cipher->algorithm_ssl != SSL_TLSV1_2) { + al = SSL_AD_ILLEGAL_PARAMETER; + SSLerror(s, SSL_R_WRONG_CIPHER_RETURNED); + goto fatal_err; + } + /* * Depending on the session caching (internal/external), the cipher * and/or cipher_id values may not be set. Make sure that -- cgit v1.2.3-55-g6feb