summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_tlsext.c
diff options
context:
space:
mode:
authortb <>2025-10-23 15:27:27 +0000
committertb <>2025-10-23 15:27:27 +0000
commitb087cd0400f51020d64ecc9afd0c0f8c8abdcf4f (patch)
tree32d988dd5f31893d9ff487e6b2f61cdb77287044 /src/lib/libssl/ssl_tlsext.c
parent2f913441f29f1f81d45eb8d13b12bdfd75a57d70 (diff)
downloadopenbsd-OPENBSD_7_7.tar.gz
openbsd-OPENBSD_7_7.tar.bz2
openbsd-OPENBSD_7_7.zip
Ensure that we specify the correct group when creating a HelloRetryRequest.libressl-v4.1.2OPENBSD_7_7
When processing the client supported groups and key shares extensions, the group selection is currently based on client preference. However, when building a HRR the preferred group is identified by calling tls1_get_supported_group(). If SSL_OP_CIPHER_SERVER_PREFERENCE is enabled, group selection will be based on server instead of client preference. This in turn can result in the server sending a HRR for a group that the client has already provided a key share for, violating the RFC. Avoid this issue by storing the client preferred group when processing the key share extension, then using this group when creating the HRR. Thanks to dzwdz for identifying and reporting the issue. ok beck@ tb@ from jsing@ This is errata/7.7/013_libssl.patch.sig
Diffstat (limited to 'src/lib/libssl/ssl_tlsext.c')
-rw-r--r--src/lib/libssl/ssl_tlsext.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_tlsext.c b/src/lib/libssl/ssl_tlsext.c
index 08bf5593ec..99b68fc6f3 100644
--- a/src/lib/libssl/ssl_tlsext.c
+++ b/src/lib/libssl/ssl_tlsext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_tlsext.c,v 1.154 2024/07/09 12:27:27 beck Exp $ */ 1/* $OpenBSD: ssl_tlsext.c,v 1.154.6.1 2025/10/23 15:27:27 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> 4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
@@ -1554,6 +1554,7 @@ tlsext_keyshare_server_process(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1554 for (j = 0; j < server_groups_len; j++) { 1554 for (j = 0; j < server_groups_len; j++) {
1555 if (server_groups[j] == client_groups[i]) { 1555 if (server_groups[j] == client_groups[i]) {
1556 client_preferred_group = client_groups[i]; 1556 client_preferred_group = client_groups[i];
1557 s->s3->hs.tls13.server_group = client_preferred_group;
1557 preferred_group_found = 1; 1558 preferred_group_found = 1;
1558 break; 1559 break;
1559 } 1560 }