summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_server.c
diff options
context:
space:
mode:
authorjsing <>2021-10-23 14:40:54 +0000
committerjsing <>2021-10-23 14:40:54 +0000
commit48d78838532f827ee48f8f73f24be6e77d4bbf0f (patch)
treece6df35f3dc86483e4bf5fb3d4d1a4ada8d56b08 /src/lib/libssl/tls13_server.c
parent29938589622ccf645f7dc926feb10e611775c666 (diff)
downloadopenbsd-48d78838532f827ee48f8f73f24be6e77d4bbf0f.tar.gz
openbsd-48d78838532f827ee48f8f73f24be6e77d4bbf0f.tar.bz2
openbsd-48d78838532f827ee48f8f73f24be6e77d4bbf0f.zip
Provide a way to determine our maximum legacy version.
With the introduction of TLSv1.3, we need the ability to determine our maximum legacy version and to track our peer's maximum legacy version. This is needed for both the TLS record layer when using TLSv1.3, plus it is needed for RSA key exhange in TLS prior to TLSv1.3, where the maximum legacy version is incorporated in the pre-master secret to avoid downgrade attacks. This unbreaks RSA KEX for the TLS client when the non-version specific method is used with TLSv1.0 or TLSv1.1 (clearly no one does this). ok tb@
Diffstat (limited to 'src/lib/libssl/tls13_server.c')
-rw-r--r--src/lib/libssl/tls13_server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_server.c b/src/lib/libssl/tls13_server.c
index 9c0369fc91..a19b3825fe 100644
--- a/src/lib/libssl/tls13_server.c
+++ b/src/lib/libssl/tls13_server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_server.c,v 1.85 2021/10/23 13:12:55 tb Exp $ */ 1/* $OpenBSD: tls13_server.c,v 1.86 2021/10/23 14:40:54 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2019, 2020 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2019, 2020 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2020 Bob Beck <beck@openbsd.org> 4 * Copyright (c) 2020 Bob Beck <beck@openbsd.org>
@@ -164,6 +164,7 @@ tls13_client_hello_process(struct tls13_ctx *ctx, CBS *cbs)
164 return tls13_use_legacy_server(ctx); 164 return tls13_use_legacy_server(ctx);
165 } 165 }
166 ctx->hs->negotiated_tls_version = TLS1_3_VERSION; 166 ctx->hs->negotiated_tls_version = TLS1_3_VERSION;
167 ctx->hs->peer_legacy_version = legacy_version;
167 168
168 /* Ensure we send subsequent alerts with the correct record version. */ 169 /* Ensure we send subsequent alerts with the correct record version. */
169 tls13_record_layer_set_legacy_version(ctx->rl, TLS1_2_VERSION); 170 tls13_record_layer_set_legacy_version(ctx->rl, TLS1_2_VERSION);