summaryrefslogtreecommitdiff
path: root/lib/libtls
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2023-07-02 06:37:28 +0000
committerBob Beck <beck@cvs.openbsd.org>2023-07-02 06:37:28 +0000
commit3af73549c3e3516405c88224ccdfa8f659700d1c (patch)
tree017a0996373d034d5a2d56abea1738876f4bedf4 /lib/libtls
parent511ba7c7124eaacf9a37b710c3badb9e23b55893 (diff)
Remove the ability to do tls 1.0 and 1.1 from libtls.
With this change any requests from configurations to request versions of tls before tls 1.2 will use tls 1.2. This prepares us to deprecate tls 1.0 and tls 1.1 support from libssl. ok tb@
Diffstat (limited to 'lib/libtls')
-rw-r--r--lib/libtls/man/tls_config_set_protocols.312
-rw-r--r--lib/libtls/tls.c10
-rw-r--r--lib/libtls/tls.h14
-rw-r--r--lib/libtls/tls_config.c6
4 files changed, 18 insertions, 24 deletions
diff --git a/lib/libtls/man/tls_config_set_protocols.3 b/lib/libtls/man/tls_config_set_protocols.3
index 7c62493e831..32b8cce7578 100644
--- a/lib/libtls/man/tls_config_set_protocols.3
+++ b/lib/libtls/man/tls_config_set_protocols.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tls_config_set_protocols.3,v 1.11 2021/01/02 19:58:44 schwarze Exp $
+.\" $OpenBSD: tls_config_set_protocols.3,v 1.12 2023/07/02 06:37:27 beck Exp $
.\"
.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
.\" Copyright (c) 2015, 2016 Joel Sing <jsing@openbsd.org>
@@ -16,7 +16,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: January 2 2021 $
+.Dd $Mdocdate: July 2 2023 $
.Dt TLS_CONFIG_SET_PROTOCOLS 3
.Os
.Sh NAME
@@ -76,10 +76,6 @@ Possible values are the bitwise OR of:
.Pp
.Bl -item -offset indent -compact
.It
-.Dv TLS_PROTOCOL_TLSv1_0
-.It
-.Dv TLS_PROTOCOL_TLSv1_1
-.It
.Dv TLS_PROTOCOL_TLSv1_2
.It
.Dv TLS_PROTOCOL_TLSv1_3
@@ -87,7 +83,7 @@ Possible values are the bitwise OR of:
.Pp
Additionally, the values
.Dv TLS_PROTOCOL_TLSv1
-(TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3),
+(TLSv1.2, TLSv1.3),
.Dv TLS_PROTOCOLS_ALL
(all supported protocols) and
.Dv TLS_PROTOCOLS_DEFAULT
@@ -106,8 +102,6 @@ The protocol string is a comma or colon separated list of keywords.
Valid keywords are:
.Pp
.Bl -tag -width "tlsv1.3" -offset indent -compact
-.It Dv tlsv1.0
-.It Dv tlsv1.1
.It Dv tlsv1.2
.It Dv tlsv1.3
.It Dv all
diff --git a/lib/libtls/tls.c b/lib/libtls/tls.c
index 8444169bdcc..fdb994d7332 100644
--- a/lib/libtls/tls.c
+++ b/lib/libtls/tls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls.c,v 1.97 2023/06/18 11:43:03 op Exp $ */
+/* $OpenBSD: tls.c,v 1.98 2023/07/02 06:37:27 beck Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -520,16 +520,12 @@ tls_configure_ssl(struct tls *ctx, SSL_CTX *ssl_ctx)
SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2);
SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv3);
+ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1);
+ SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_1);
- SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1);
- SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1_1);
SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1_2);
SSL_CTX_clear_options(ssl_ctx, SSL_OP_NO_TLSv1_3);
- if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_0) == 0)
- SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1);
- if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_1) == 0)
- SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_1);
if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_2) == 0)
SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_TLSv1_2);
if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_3) == 0)
diff --git a/lib/libtls/tls.h b/lib/libtls/tls.h
index b94a6fa6d05..34183745e5e 100644
--- a/lib/libtls/tls.h
+++ b/lib/libtls/tls.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls.h,v 1.62 2022/03/24 15:56:34 tb Exp $ */
+/* $OpenBSD: tls.h,v 1.63 2023/07/02 06:37:27 beck Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -29,14 +29,18 @@ extern "C" {
#define TLS_API 20200120
-#define TLS_PROTOCOL_TLSv1_0 (1 << 1)
-#define TLS_PROTOCOL_TLSv1_1 (1 << 2)
+/*
+ * Deprecated versions of TLS. Using these effectively selects
+ * the minimum supported version.
+ */
+#define TLS_PROTOCOL_TLSv1_0 (1 << 3)
+#define TLS_PROTOCOL_TLSv1_1 (1 << 3)
+/* Supported versions of TLS */
#define TLS_PROTOCOL_TLSv1_2 (1 << 3)
#define TLS_PROTOCOL_TLSv1_3 (1 << 4)
#define TLS_PROTOCOL_TLSv1 \
- (TLS_PROTOCOL_TLSv1_0|TLS_PROTOCOL_TLSv1_1|\
- TLS_PROTOCOL_TLSv1_2|TLS_PROTOCOL_TLSv1_3)
+ (TLS_PROTOCOL_TLSv1_2|TLS_PROTOCOL_TLSv1_3)
#define TLS_PROTOCOLS_ALL TLS_PROTOCOL_TLSv1
#define TLS_PROTOCOLS_DEFAULT (TLS_PROTOCOL_TLSv1_2|TLS_PROTOCOL_TLSv1_3)
diff --git a/lib/libtls/tls_config.c b/lib/libtls/tls_config.c
index 3efd0ddd57d..5eb5b69ac6e 100644
--- a/lib/libtls/tls_config.c
+++ b/lib/libtls/tls_config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls_config.c,v 1.66 2023/05/14 07:26:25 op Exp $ */
+/* $OpenBSD: tls_config.c,v 1.67 2023/07/02 06:37:27 beck Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -251,9 +251,9 @@ tls_config_parse_protocols(uint32_t *protocols, const char *protostr)
if (strcasecmp(p, "tlsv1") == 0)
proto = TLS_PROTOCOL_TLSv1;
else if (strcasecmp(p, "tlsv1.0") == 0)
- proto = TLS_PROTOCOL_TLSv1_0;
+ proto = TLS_PROTOCOL_TLSv1_2;
else if (strcasecmp(p, "tlsv1.1") == 0)
- proto = TLS_PROTOCOL_TLSv1_1;
+ proto = TLS_PROTOCOL_TLSv1_2;
else if (strcasecmp(p, "tlsv1.2") == 0)
proto = TLS_PROTOCOL_TLSv1_2;
else if (strcasecmp(p, "tlsv1.3") == 0)