diff options
author | jsing <> | 2020-05-13 17:51:48 +0000 |
---|---|---|
committer | jsing <> | 2020-05-13 17:51:48 +0000 |
commit | eb0ad25bdc106121c23e0c23319707057b42c380 (patch) | |
tree | cd40501324b03d3dcaffe9b9927e3ff085e201a8 | |
parent | 01d75aaa520ead9d2ebabb60f68acf32f83090c1 (diff) | |
download | openbsd-eb0ad25bdc106121c23e0c23319707057b42c380.tar.gz openbsd-eb0ad25bdc106121c23e0c23319707057b42c380.tar.bz2 openbsd-eb0ad25bdc106121c23e0c23319707057b42c380.zip |
Switch the legacy version to TLS1_2_VERSION when processing server hello.
Switch the legacy version when processing the server hello, rather than
when the client hello has been sent. This ensures that we accept a
response from the server that has a record version other than
TLS1_2_VERSION, as is the case where the server is negotiating TLSv1.0
or TLSv1.1.
Issue spotted by inoguchi@
ok inoguchi@ tb@
-rw-r--r-- | src/lib/libssl/tls13_client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libssl/tls13_client.c b/src/lib/libssl/tls13_client.c index 951c0f841c..dbd5b0add7 100644 --- a/src/lib/libssl/tls13_client.c +++ b/src/lib/libssl/tls13_client.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_client.c,v 1.58 2020/05/10 16:56:11 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_client.c,v 1.59 2020/05/13 17:51:48 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 | * |
@@ -145,7 +145,6 @@ tls13_client_hello_send(struct tls13_ctx *ctx, CBB *cbb) | |||
145 | int | 145 | int |
146 | tls13_client_hello_sent(struct tls13_ctx *ctx) | 146 | tls13_client_hello_sent(struct tls13_ctx *ctx) |
147 | { | 147 | { |
148 | tls13_record_layer_set_legacy_version(ctx->rl, TLS1_2_VERSION); | ||
149 | tls13_record_layer_allow_ccs(ctx->rl, 1); | 148 | tls13_record_layer_allow_ccs(ctx->rl, 1); |
150 | 149 | ||
151 | tls1_transcript_freeze(ctx->ssl); | 150 | tls1_transcript_freeze(ctx->ssl); |
@@ -252,6 +251,7 @@ tls13_server_hello_process(struct tls13_ctx *ctx, CBS *cbs) | |||
252 | } | 251 | } |
253 | 252 | ||
254 | /* From here on in we know we are doing TLSv1.3. */ | 253 | /* From here on in we know we are doing TLSv1.3. */ |
254 | tls13_record_layer_set_legacy_version(ctx->rl, TLS1_2_VERSION); | ||
255 | tls13_record_layer_allow_legacy_alerts(ctx->rl, 0); | 255 | tls13_record_layer_allow_legacy_alerts(ctx->rl, 0); |
256 | 256 | ||
257 | /* See if this is a HelloRetryRequest. */ | 257 | /* See if this is a HelloRetryRequest. */ |