summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_packet.c
diff options
context:
space:
mode:
authorjsing <>2021-02-25 17:06:05 +0000
committerjsing <>2021-02-25 17:06:05 +0000
commit72c7f20e4fbcb3386178960b8f88ab2fbc042567 (patch)
tree5a334628a895bbe67688cd0dbadfdc68524f02de /src/lib/libssl/ssl_packet.c
parentaed0a5deca305a997de3f6234733204b383f094f (diff)
downloadopenbsd-72c7f20e4fbcb3386178960b8f88ab2fbc042567.tar.gz
openbsd-72c7f20e4fbcb3386178960b8f88ab2fbc042567.tar.bz2
openbsd-72c7f20e4fbcb3386178960b8f88ab2fbc042567.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 'src/lib/libssl/ssl_packet.c')
-rw-r--r--src/lib/libssl/ssl_packet.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libssl/ssl_packet.c b/src/lib/libssl/ssl_packet.c
index fc1c3c07de..b383fe83e9 100644
--- a/src/lib/libssl/ssl_packet.c
+++ b/src/lib/libssl/ssl_packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_packet.c,v 1.9 2020/10/14 16:57:33 jsing Exp $ */ 1/* $OpenBSD: ssl_packet.c,v 1.10 2021/02/25 17:06:05 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -247,12 +247,13 @@ ssl_server_legacy_first_packet(SSL *s)
247 return 1; 247 return 1;
248 248
249 /* Only continue if this is not a version locked method. */ 249 /* Only continue if this is not a version locked method. */
250 if (s->method->internal->min_version == s->method->internal->max_version) 250 if (s->method->internal->min_tls_version ==
251 s->method->internal->max_tls_version)
251 return 1; 252 return 1;
252 253
253 if (ssl_is_sslv2_client_hello(&header) == 1) { 254 if (ssl_is_sslv2_client_hello(&header) == 1) {
254 /* Only permit SSLv2 client hellos if TLSv1.0 is enabled. */ 255 /* Only permit SSLv2 client hellos if TLSv1.0 is enabled. */
255 if (ssl_enabled_version_range(s, &min_version, NULL) != 1) { 256 if (ssl_enabled_tls_version_range(s, &min_version, NULL) != 1) {
256 SSLerror(s, SSL_R_NO_PROTOCOLS_AVAILABLE); 257 SSLerror(s, SSL_R_NO_PROTOCOLS_AVAILABLE);
257 return -1; 258 return -1;
258 } 259 }