diff options
| author | tb <> | 2020-01-22 02:39:45 +0000 |
|---|---|---|
| committer | tb <> | 2020-01-22 02:39:45 +0000 |
| commit | 5eada86805b8d8ad077edadc52c005793a2b201a (patch) | |
| tree | e3b7e917f86898f6c4c09cc95fd58779cf635a2f /src/lib/libssl/tls13_client.c | |
| parent | 8a5f0b4938aa181a953897e80c037c03a54b5a22 (diff) | |
| download | openbsd-5eada86805b8d8ad077edadc52c005793a2b201a.tar.gz openbsd-5eada86805b8d8ad077edadc52c005793a2b201a.tar.bz2 openbsd-5eada86805b8d8ad077edadc52c005793a2b201a.zip | |
The legacy_record_version must be set to TLS1_2_VERSION except
in the ClientHello where it may be set to TLS1_VERSION. Use
the minimal supported version to decide whether we choose to do
so or not. Use a sent hook to set it back TLS1_2_VERSION right
after the ClientHello message is on the wire.
ok beck jsing
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/tls13_client.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_client.c b/src/lib/libssl/tls13_client.c index ed9a69918a..e0041eadae 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.23 2020/01/22 02:21:05 beck Exp $ */ | 1 | /* $OpenBSD: tls13_client.c,v 1.24 2020/01/22 02:39:45 tb 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 | * |
| @@ -199,6 +199,9 @@ tls13_client_hello_send(struct tls13_ctx *ctx) | |||
| 199 | { | 199 | { |
| 200 | CBB body; | 200 | CBB body; |
| 201 | 201 | ||
| 202 | if (ctx->hs->min_version < TLS1_2_VERSION) | ||
| 203 | tls13_record_layer_set_legacy_version(ctx->rl, TLS1_VERSION); | ||
| 204 | |||
| 202 | if (!tls13_handshake_msg_start(ctx->hs_msg, &body, TLS13_MT_CLIENT_HELLO)) | 205 | if (!tls13_handshake_msg_start(ctx->hs_msg, &body, TLS13_MT_CLIENT_HELLO)) |
| 203 | return 0; | 206 | return 0; |
| 204 | if (!tls13_client_hello_build(ctx->ssl, &body)) | 207 | if (!tls13_client_hello_build(ctx->ssl, &body)) |
| @@ -209,6 +212,14 @@ tls13_client_hello_send(struct tls13_ctx *ctx) | |||
| 209 | return 1; | 212 | return 1; |
| 210 | } | 213 | } |
| 211 | 214 | ||
| 215 | int | ||
| 216 | tls13_client_hello_sent(struct tls13_ctx *ctx) | ||
| 217 | { | ||
| 218 | tls13_record_layer_set_legacy_version(ctx->rl, TLS1_2_VERSION); | ||
| 219 | |||
| 220 | return 1; | ||
| 221 | } | ||
| 222 | |||
| 212 | /* | 223 | /* |
| 213 | * HelloRetryRequest hash - RFC 8446 section 4.1.3. | 224 | * HelloRetryRequest hash - RFC 8446 section 4.1.3. |
| 214 | */ | 225 | */ |
