summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorbeck <>2024-07-09 12:27:27 +0000
committerbeck <>2024-07-09 12:27:27 +0000
commit2d70393a18dc5114557488b463ae366b851b4e88 (patch)
tree57b0ce37842913548dfe76d14f123b0421b43813 /src/lib
parent8aadf3301a1f0979bae110402647426b46fff812 (diff)
downloadopenbsd-2d70393a18dc5114557488b463ae366b851b4e88.tar.gz
openbsd-2d70393a18dc5114557488b463ae366b851b4e88.tar.bz2
openbsd-2d70393a18dc5114557488b463ae366b851b4e88.zip
Fix TLS key share check to not fire when using < TLS 1.3
The check was being too aggressive and was catching us when the extension was being sent by a client which supports tls 1.3 but the server was capped at TLS 1.2. This moves the check after the max version check, so we won't error out if we do not support TLS 1.3 Reported by obsd@bartula.de ok tb@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/ssl_tlsext.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/libssl/ssl_tlsext.c b/src/lib/libssl/ssl_tlsext.c
index d0d67598d4..08bf5593ec 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.153 2024/06/26 03:41:10 tb Exp $ */ 1/* $OpenBSD: ssl_tlsext.c,v 1.154 2024/07/09 12:27:27 beck 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>
@@ -1573,6 +1573,10 @@ tlsext_keyshare_server_process(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1573 if (!CBS_get_u16_length_prefixed(&client_shares, &key_exchange)) 1573 if (!CBS_get_u16_length_prefixed(&client_shares, &key_exchange))
1574 return 0; 1574 return 0;
1575 1575
1576 /* Ignore this client share if we're using earlier than TLSv1.3 */
1577 if (s->s3->hs.our_max_tls_version < TLS1_3_VERSION)
1578 continue;
1579
1576 /* 1580 /*
1577 * Ensure the client share group was sent in supported groups, 1581 * Ensure the client share group was sent in supported groups,
1578 * and was sent in the same order as supported groups. The 1582 * and was sent in the same order as supported groups. The
@@ -1590,12 +1594,7 @@ tlsext_keyshare_server_process(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1590 return 0; 1594 return 0;
1591 } 1595 }
1592 1596
1593 /* 1597 /* Ignore this client share if we have already selected a key share */
1594 * Ignore this client share if we're using earlier than TLSv1.3
1595 * or we've already selected a key share.
1596 */
1597 if (s->s3->hs.our_max_tls_version < TLS1_3_VERSION)
1598 continue;
1599 if (s->s3->hs.key_share != NULL) 1598 if (s->s3->hs.key_share != NULL)
1600 continue; 1599 continue;
1601 1600