summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_methods.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2021-02-25 17:06:05 +0000
committerjsing <jsing@openbsd.org>2021-02-25 17:06:05 +0000
commit970acf874db22f09b7e42996a54559867b6102e2 (patch)
tree34405a224570d4c15c3de6932b4dfeaaadbcaccd /lib/libssl/ssl_methods.c
parentRename depth to num_untrusted so it identifies what it actually represents. (diff)
downloadwireguard-openbsd-970acf874db22f09b7e42996a54559867b6102e2.tar.xz
wireguard-openbsd-970acf874db22f09b7e42996a54559867b6102e2.zip
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@
Diffstat (limited to 'lib/libssl/ssl_methods.c')
-rw-r--r--lib/libssl/ssl_methods.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/lib/libssl/ssl_methods.c b/lib/libssl/ssl_methods.c
index ae532ba16de..084f533f5e8 100644
--- a/lib/libssl/ssl_methods.c
+++ b/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,