From 72c7f20e4fbcb3386178960b8f88ab2fbc042567 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Thu, 25 Feb 2021 17:06:05 +0000 Subject: Only use TLS versions internally (rather than both TLS and DTLS versions). DTLS protocol version numbers are the 1's compliment of human readable TLS version numbers, which means that newer versions decrease in value and there is no direct mapping between TLS protocol version numbers and DTLS protocol version numbers. Rather than having to deal with this internally, only use TLS versions internally and map between DTLS and TLS protocol versions when necessary. Rename functions and variables to use 'tls_version' when they contain a TLS version (and never a DTLS version). ok tb@ --- src/lib/libssl/ssl_methods.c | 66 ++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'src/lib/libssl/ssl_methods.c') diff --git a/src/lib/libssl/ssl_methods.c b/src/lib/libssl/ssl_methods.c index ae532ba16d..084f533f5e 100644 --- a/src/lib/libssl/ssl_methods.c +++ b/src/lib/libssl/ssl_methods.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_methods.c,v 1.22 2021/02/20 08:33:17 jsing Exp $ */ +/* $OpenBSD: ssl_methods.c,v 1.23 2021/02/25 17:06:05 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -64,8 +64,8 @@ static const SSL_METHOD_INTERNAL DTLS_method_internal_data = { .dtls = 1, .server = 1, .version = DTLS1_2_VERSION, - .min_version = DTLS1_VERSION, - .max_version = DTLS1_2_VERSION, + .min_tls_version = TLS1_1_VERSION, + .max_tls_version = TLS1_2_VERSION, .ssl_new = dtls1_new, .ssl_clear = dtls1_clear, .ssl_free = dtls1_free, @@ -93,8 +93,8 @@ static const SSL_METHOD_INTERNAL DTLS_client_method_internal_data = { .dtls = 1, .server = 0, .version = DTLS1_2_VERSION, - .min_version = DTLS1_VERSION, - .max_version = DTLS1_2_VERSION, + .min_tls_version = TLS1_1_VERSION, + .max_tls_version = TLS1_2_VERSION, .ssl_new = dtls1_new, .ssl_clear = dtls1_clear, .ssl_free = dtls1_free, @@ -123,8 +123,8 @@ static const SSL_METHOD_INTERNAL DTLSv1_method_internal_data = { .dtls = 1, .server = 1, .version = DTLS1_VERSION, - .min_version = DTLS1_VERSION, - .max_version = DTLS1_VERSION, + .min_tls_version = TLS1_1_VERSION, + .max_tls_version = TLS1_1_VERSION, .ssl_new = dtls1_new, .ssl_clear = dtls1_clear, .ssl_free = dtls1_free, @@ -152,8 +152,8 @@ static const SSL_METHOD_INTERNAL DTLSv1_client_method_internal_data = { .dtls = 1, .server = 0, .version = DTLS1_VERSION, - .min_version = DTLS1_VERSION, - .max_version = DTLS1_VERSION, + .min_tls_version = TLS1_1_VERSION, + .max_tls_version = TLS1_1_VERSION, .ssl_new = dtls1_new, .ssl_clear = dtls1_clear, .ssl_free = dtls1_free, @@ -181,8 +181,8 @@ static const SSL_METHOD_INTERNAL DTLSv1_2_method_internal_data = { .dtls = 1, .server = 1, .version = DTLS1_2_VERSION, - .min_version = DTLS1_2_VERSION, - .max_version = DTLS1_2_VERSION, + .min_tls_version = TLS1_2_VERSION, + .max_tls_version = TLS1_2_VERSION, .ssl_new = dtls1_new, .ssl_clear = dtls1_clear, .ssl_free = dtls1_free, @@ -210,8 +210,8 @@ static const SSL_METHOD_INTERNAL DTLSv1_2_client_method_internal_data = { .dtls = 1, .server = 0, .version = DTLS1_2_VERSION, - .min_version = DTLS1_2_VERSION, - .max_version = DTLS1_2_VERSION, + .min_tls_version = TLS1_2_VERSION, + .max_tls_version = TLS1_2_VERSION, .ssl_new = dtls1_new, .ssl_clear = dtls1_clear, .ssl_free = dtls1_free, @@ -306,8 +306,8 @@ static const SSL_METHOD_INTERNAL TLS_method_internal_data = { .dtls = 0, .server = 1, .version = TLS1_3_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_3_VERSION, + .min_tls_version = TLS1_VERSION, + .max_tls_version = TLS1_3_VERSION, .ssl_new = tls1_new, .ssl_clear = tls1_clear, .ssl_free = tls1_free, @@ -336,8 +336,8 @@ static const SSL_METHOD_INTERNAL TLS_legacy_method_internal_data = { .dtls = 0, .server = 1, .version = TLS1_2_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_2_VERSION, + .min_tls_version = TLS1_VERSION, + .max_tls_version = TLS1_2_VERSION, .ssl_new = tls1_new, .ssl_clear = tls1_clear, .ssl_free = tls1_free, @@ -366,8 +366,8 @@ static const SSL_METHOD_INTERNAL TLS_client_method_internal_data = { .dtls = 0, .server = 0, .version = TLS1_3_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_3_VERSION, + .min_tls_version = TLS1_VERSION, + .max_tls_version = TLS1_3_VERSION, .ssl_new = tls1_new, .ssl_clear = tls1_clear, .ssl_free = tls1_free, @@ -397,8 +397,8 @@ static const SSL_METHOD_INTERNAL TLS_legacy_client_method_internal_data = { .dtls = 0, .server = 0, .version = TLS1_2_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_2_VERSION, + .min_tls_version = TLS1_VERSION, + .max_tls_version = TLS1_2_VERSION, .ssl_new = tls1_new, .ssl_clear = tls1_clear, .ssl_free = tls1_free, @@ -427,8 +427,8 @@ static const SSL_METHOD_INTERNAL TLSv1_method_internal_data = { .dtls = 0, .server = 1, .version = TLS1_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_VERSION, + .min_tls_version = TLS1_VERSION, + .max_tls_version = TLS1_VERSION, .ssl_new = tls1_new, .ssl_clear = tls1_clear, .ssl_free = tls1_free, @@ -456,8 +456,8 @@ static const SSL_METHOD_INTERNAL TLSv1_client_method_internal_data = { .dtls = 0, .server = 0, .version = TLS1_VERSION, - .min_version = TLS1_VERSION, - .max_version = TLS1_VERSION, + .min_tls_version = TLS1_VERSION, + .max_tls_version = TLS1_VERSION, .ssl_new = tls1_new, .ssl_clear = tls1_clear, .ssl_free = tls1_free, @@ -485,8 +485,8 @@ static const SSL_METHOD_INTERNAL TLSv1_1_method_internal_data = { .dtls = 0, .server = 1, .version = TLS1_1_VERSION, - .min_version = TLS1_1_VERSION, - .max_version = TLS1_1_VERSION, + .min_tls_version = TLS1_1_VERSION, + .max_tls_version = TLS1_1_VERSION, .ssl_new = tls1_new, .ssl_clear = tls1_clear, .ssl_free = tls1_free, @@ -514,8 +514,8 @@ static const SSL_METHOD_INTERNAL TLSv1_1_client_method_internal_data = { .dtls = 0, .server = 0, .version = TLS1_1_VERSION, - .min_version = TLS1_1_VERSION, - .max_version = TLS1_1_VERSION, + .min_tls_version = TLS1_1_VERSION, + .max_tls_version = TLS1_1_VERSION, .ssl_new = tls1_new, .ssl_clear = tls1_clear, .ssl_free = tls1_free, @@ -543,8 +543,8 @@ static const SSL_METHOD_INTERNAL TLSv1_2_method_internal_data = { .dtls = 0, .server = 1, .version = TLS1_2_VERSION, - .min_version = TLS1_2_VERSION, - .max_version = TLS1_2_VERSION, + .min_tls_version = TLS1_2_VERSION, + .max_tls_version = TLS1_2_VERSION, .ssl_new = tls1_new, .ssl_clear = tls1_clear, .ssl_free = tls1_free, @@ -572,8 +572,8 @@ static const SSL_METHOD_INTERNAL TLSv1_2_client_method_internal_data = { .dtls = 0, .server = 0, .version = TLS1_2_VERSION, - .min_version = TLS1_2_VERSION, - .max_version = TLS1_2_VERSION, + .min_tls_version = TLS1_2_VERSION, + .max_tls_version = TLS1_2_VERSION, .ssl_new = tls1_new, .ssl_clear = tls1_clear, .ssl_free = tls1_free, -- cgit v1.2.3-55-g6feb