diff options
author | jsing <> | 2021-06-29 18:47:15 +0000 |
---|---|---|
committer | jsing <> | 2021-06-29 18:47:15 +0000 |
commit | c8cca6326412b2fbbeecc506dfdd5e16c42444ce (patch) | |
tree | d6f0dc51f0a2f96b56a0d059e1160914cf964c78 /src | |
parent | 2c28b99d5412d4f0a9fafb41d10ebe8fe29a9bba (diff) | |
download | openbsd-c8cca6326412b2fbbeecc506dfdd5e16c42444ce.tar.gz openbsd-c8cca6326412b2fbbeecc506dfdd5e16c42444ce.tar.bz2 openbsd-c8cca6326412b2fbbeecc506dfdd5e16c42444ce.zip |
Require a ServerHello following a HelloRetryRequest to use the same cipher.
RFC 8446 section 4.1.4 requires that the client ensure the cipher suite
in the TLSv1.3 HelloRetryRequest and subsequent ServerHello is the same.
Reported via GitHub issue #675.
ok inoguchi@ tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/tls13_client.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/libssl/tls13_client.c b/src/lib/libssl/tls13_client.c index 4ba0dd92f2..0a237567fd 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.83 2021/06/27 19:23:51 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_client.c,v 1.84 2021/06/29 18:47:15 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 | * |
@@ -303,7 +303,16 @@ tls13_server_hello_process(struct tls13_ctx *ctx, CBS *cbs) | |||
303 | ctx->alert = TLS13_ALERT_ILLEGAL_PARAMETER; | 303 | ctx->alert = TLS13_ALERT_ILLEGAL_PARAMETER; |
304 | goto err; | 304 | goto err; |
305 | } | 305 | } |
306 | /* XXX - move this to hs.tls13? */ | 306 | if (!(ctx->handshake_stage.hs_type & WITHOUT_HRR) && !ctx->hs->tls13.hrr) { |
307 | /* | ||
308 | * A ServerHello following a HelloRetryRequest MUST use the same | ||
309 | * cipher suite (RFC 8446 section 4.1.4). | ||
310 | */ | ||
311 | if (ctx->hs->cipher != cipher) { | ||
312 | ctx->alert = TLS13_ALERT_ILLEGAL_PARAMETER; | ||
313 | goto err; | ||
314 | } | ||
315 | } | ||
307 | ctx->hs->cipher = cipher; | 316 | ctx->hs->cipher = cipher; |
308 | 317 | ||
309 | if (compression_method != 0) { | 318 | if (compression_method != 0) { |