summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2026-04-03 12:58:19 +0000
committerjsing <>2026-04-03 12:58:19 +0000
commit42d1ecbb4220b6260fa2da63402ec3f5cbad849a (patch)
tree54561e6b94ac4ffe54812d2ae61334aacbe86c53 /src
parentd8c990b8ab23e4f390c5f883d8da8177ef804444 (diff)
downloadopenbsd-42d1ecbb4220b6260fa2da63402ec3f5cbad849a.tar.gz
openbsd-42d1ecbb4220b6260fa2da63402ec3f5cbad849a.tar.bz2
openbsd-42d1ecbb4220b6260fa2da63402ec3f5cbad849a.zip
Ensure that we cannot negotiate TLSv1.1 or lower.
TLS versions prior to TLSv1.2 were disabled a while ago, however this was done in the version handling code. Remove TLSv1.1 and earlier from ssl_get_method() and add an explicit min version check in the legacy client and server, to provide a stronger guarantee. ok kenjiro@ tb@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/ssl_clnt.c9
-rw-r--r--src/lib/libssl/ssl_methods.c16
-rw-r--r--src/lib/libssl/ssl_srvr.c9
3 files changed, 21 insertions, 13 deletions
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c
index 22469ce346..6ef81a1706 100644
--- a/src/lib/libssl/ssl_clnt.c
+++ b/src/lib/libssl/ssl_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_clnt.c,v 1.170 2025/12/04 21:03:42 beck Exp $ */ 1/* $OpenBSD: ssl_clnt.c,v 1.171 2026/04/03 12:58:19 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -233,6 +233,13 @@ ssl3_connect(SSL *s)
233 goto end; 233 goto end;
234 } 234 }
235 235
236 /* Ensure that we cannot negotiate TLSv1.1 or lower. */
237 if (s->s3->hs.our_min_tls_version < TLS1_2_VERSION) {
238 SSLerror(s, ERR_R_INTERNAL_ERROR);
239 ret = -1;
240 goto end;
241 }
242
236 if (!ssl_security_version(s, 243 if (!ssl_security_version(s,
237 s->s3->hs.our_min_tls_version)) { 244 s->s3->hs.our_min_tls_version)) {
238 SSLerror(s, SSL_R_VERSION_TOO_LOW); 245 SSLerror(s, SSL_R_VERSION_TOO_LOW);
diff --git a/src/lib/libssl/ssl_methods.c b/src/lib/libssl/ssl_methods.c
index dee52decf1..dd620c1008 100644
--- a/src/lib/libssl/ssl_methods.c
+++ b/src/lib/libssl/ssl_methods.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_methods.c,v 1.32 2024/07/23 14:40:54 jsing Exp $ */ 1/* $OpenBSD: ssl_methods.c,v 1.33 2026/04/03 12:58:19 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -538,17 +538,11 @@ const SSL_METHOD *
538ssl_get_method(uint16_t version) 538ssl_get_method(uint16_t version)
539{ 539{
540 if (version == TLS1_3_VERSION) 540 if (version == TLS1_3_VERSION)
541 return (TLS_method()); 541 return TLS_method();
542 if (version == TLS1_2_VERSION) 542 if (version == TLS1_2_VERSION)
543 return (TLSv1_2_method()); 543 return TLSv1_2_method();
544 if (version == TLS1_1_VERSION)
545 return (TLSv1_1_method());
546 if (version == TLS1_VERSION)
547 return (TLSv1_method());
548 if (version == DTLS1_VERSION)
549 return (DTLSv1_method());
550 if (version == DTLS1_2_VERSION) 544 if (version == DTLS1_2_VERSION)
551 return (DTLSv1_2_method()); 545 return DTLSv1_2_method();
552 546
553 return (NULL); 547 return NULL;
554} 548}
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c
index ef93e283de..af4b20f6ce 100644
--- a/src/lib/libssl/ssl_srvr.c
+++ b/src/lib/libssl/ssl_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_srvr.c,v 1.167 2025/12/04 21:03:42 beck Exp $ */ 1/* $OpenBSD: ssl_srvr.c,v 1.168 2026/04/03 12:58:19 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -238,6 +238,13 @@ ssl3_accept(SSL *s)
238 goto end; 238 goto end;
239 } 239 }
240 240
241 /* Ensure that we cannot negotiate TLSv1.1 or lower. */
242 if (s->s3->hs.our_min_tls_version < TLS1_2_VERSION) {
243 SSLerror(s, ERR_R_INTERNAL_ERROR);
244 ret = -1;
245 goto end;
246 }
247
241 if (!ssl_security_version(s, 248 if (!ssl_security_version(s,
242 s->s3->hs.our_min_tls_version)) { 249 s->s3->hs.our_min_tls_version)) {
243 SSLerror(s, SSL_R_VERSION_TOO_LOW); 250 SSLerror(s, SSL_R_VERSION_TOO_LOW);