diff options
| author | jsing <> | 2026-06-14 14:53:07 +0000 |
|---|---|---|
| committer | jsing <> | 2026-06-14 14:53:07 +0000 |
| commit | c662bdf9d358be35d39715b459ff6e3a9669d91e (patch) | |
| tree | b5ff4b3a6716fd58427d925439615f03b9ad17ee /src/lib/libssl | |
| parent | aff99e861ac22e29f303f1540d4783c44cad44f1 (diff) | |
| download | openbsd-c662bdf9d358be35d39715b459ff6e3a9669d91e.tar.gz openbsd-c662bdf9d358be35d39715b459ff6e3a9669d91e.tar.bz2 openbsd-c662bdf9d358be35d39715b459ff6e3a9669d91e.zip | |
Send illegal parameter alerts for various HelloRetryRequest violations.
Be more RFC compliant and send illegal parameter alerts when the client
receives a HelloRetryRequest that requests a group that we did not offer
or a group that we sent a key share for in the ClientHello. These were
annotated as missing, but not previously implemented.
Prompted by a report from the tlspuffin team.
ok tb@
Diffstat (limited to 'src/lib/libssl')
| -rw-r--r-- | src/lib/libssl/tls13_client.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/libssl/tls13_client.c b/src/lib/libssl/tls13_client.c index 21d3960796..d650717856 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.106 2025/12/04 21:16:17 beck Exp $ */ | 1 | /* $OpenBSD: tls13_client.c,v 1.107 2026/06/14 14:53:07 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 | * |
| @@ -450,12 +450,16 @@ tls13_client_hello_retry_send(struct tls13_ctx *ctx, CBB *cbb) | |||
| 450 | /* | 450 | /* |
| 451 | * Ensure that the server supported group is one that we listed in our | 451 | * Ensure that the server supported group is one that we listed in our |
| 452 | * supported groups and is not the same as the key share we previously | 452 | * supported groups and is not the same as the key share we previously |
| 453 | * offered. | 453 | * offered. See RFC 8446 section 4.2.8. |
| 454 | */ | 454 | */ |
| 455 | if (!tls1_check_group(ctx->ssl, ctx->hs->tls13.server_group)) | 455 | if (!tls1_check_group(ctx->ssl, ctx->hs->tls13.server_group)) { |
| 456 | return 0; /* XXX alert */ | 456 | ctx->alert = TLS13_ALERT_ILLEGAL_PARAMETER; |
| 457 | if (ctx->hs->tls13.server_group == tls_key_share_group(ctx->hs->key_share)) | 457 | return 0; |
| 458 | return 0; /* XXX alert */ | 458 | } |
| 459 | if (ctx->hs->tls13.server_group == tls_key_share_group(ctx->hs->key_share)) { | ||
| 460 | ctx->alert = TLS13_ALERT_ILLEGAL_PARAMETER; | ||
| 461 | return 0; | ||
| 462 | } | ||
| 459 | 463 | ||
| 460 | /* Switch to new key share. */ | 464 | /* Switch to new key share. */ |
| 461 | tls_key_share_free(ctx->hs->key_share); | 465 | tls_key_share_free(ctx->hs->key_share); |
