summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_legacy.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/tls13_legacy.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/tls13_legacy.c')
-rw-r--r--src/lib/libssl/tls13_legacy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libssl/tls13_legacy.c b/src/lib/libssl/tls13_legacy.c
index bacd11b950..f611aa061d 100644
--- a/src/lib/libssl/tls13_legacy.c
+++ b/src/lib/libssl/tls13_legacy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_legacy.c,v 1.21 2021/01/07 16:26:31 tb Exp $ */ 1/* $OpenBSD: tls13_legacy.c,v 1.22 2021/02/25 17:06:05 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -359,7 +359,7 @@ tls13_use_legacy_client(struct tls13_ctx *ctx)
359 return 0; 359 return 0;
360 360
361 s->internal->handshake_func = s->method->internal->ssl_connect; 361 s->internal->handshake_func = s->method->internal->ssl_connect;
362 s->client_version = s->version = s->method->internal->max_version; 362 s->client_version = s->version = s->method->internal->max_tls_version;
363 363
364 S3I(s)->hs.state = SSL3_ST_CR_SRVR_HELLO_A; 364 S3I(s)->hs.state = SSL3_ST_CR_SRVR_HELLO_A;
365 365
@@ -375,7 +375,7 @@ tls13_use_legacy_server(struct tls13_ctx *ctx)
375 return 0; 375 return 0;
376 376
377 s->internal->handshake_func = s->method->internal->ssl_accept; 377 s->internal->handshake_func = s->method->internal->ssl_accept;
378 s->client_version = s->version = s->method->internal->max_version; 378 s->client_version = s->version = s->method->internal->max_tls_version;
379 s->server = 1; 379 s->server = 1;
380 380
381 S3I(s)->hs.state = SSL3_ST_SR_CLNT_HELLO_A; 381 S3I(s)->hs.state = SSL3_ST_SR_CLNT_HELLO_A;