summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_tlsext.c
diff options
context:
space:
mode:
authortb <>2026-08-21 17:15:22 +0000
committertb <>2026-08-21 17:15:22 +0000
commitfcc903ee8faa79f7dedb22f05008724ea327bdba (patch)
treed5921661f11d1c73ddb6d9c2302499f7d3466cf1 /src/lib/libssl/ssl_tlsext.c
parentc59d718905f8bfe12745fa599341256608e132f4 (diff)
downloadopenbsd-fcc903ee8faa79f7dedb22f05008724ea327bdba.tar.gz
openbsd-fcc903ee8faa79f7dedb22f05008724ea327bdba.tar.bz2
openbsd-fcc903ee8faa79f7dedb22f05008724ea327bdba.zip
Change RFC references from 8446 to 9846 and adjust section numbers
with/ok kenjiro
Diffstat (limited to 'src/lib/libssl/ssl_tlsext.c')
-rw-r--r--src/lib/libssl/ssl_tlsext.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/lib/libssl/ssl_tlsext.c b/src/lib/libssl/ssl_tlsext.c
index 039218e1ef..35e554e292 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.165 2026/08/18 04:40:17 tb Exp $ */ 1/* $OpenBSD: ssl_tlsext.c,v 1.166 2026/08/21 17:15:22 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>
@@ -281,10 +281,8 @@ tlsext_supportedgroups_server_process(SSL *s, uint16_t msg_type, CBS *cbs,
281 if (!CBS_get_u16(&grouplist, &groups[i])) 281 if (!CBS_get_u16(&grouplist, &groups[i]))
282 goto err; 282 goto err;
283 /* 283 /*
284 * Do not allow duplicate groups to be sent. This is not 284 * RFC 9846 section 4.3.7: The "named_group_list" MUST NOT
285 * currently specified in RFC 8446 or earlier, but there is no 285 * contain any duplicate entries.
286 * legitimate justification for this to occur in TLS 1.2 or TLS
287 * 1.3.
288 */ 286 */
289 for (j = 0; j < i; j++) { 287 for (j = 0; j < i; j++) {
290 if (groups[i] == groups[j]) { 288 if (groups[i] == groups[j]) {
@@ -336,7 +334,7 @@ tlsext_supportedgroups_client_process(SSL *s, uint16_t msg_type, CBS *cbs,
336 return 0; 334 return 0;
337 335
338 /* 336 /*
339 * RFC 8446, section 4.2.7: TLSv1.3 servers can send this extension but 337 * RFC 9846 section 4.3.7: TLSv1.3 servers can send this extension but
340 * clients must not act on it during the handshake. This allows servers 338 * clients must not act on it during the handshake. This allows servers
341 * to advertise their preferences for subsequent handshakes. We ignore 339 * to advertise their preferences for subsequent handshakes. We ignore
342 * this complication. 340 * this complication.
@@ -1064,7 +1062,7 @@ tlsext_ocsp_client_process(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1064 if (ssl_effective_tls_version(s) >= TLS1_3_VERSION) { 1062 if (ssl_effective_tls_version(s) >= TLS1_3_VERSION) {
1065 if (msg_type == SSL_TLSEXT_MSG_CR) { 1063 if (msg_type == SSL_TLSEXT_MSG_CR) {
1066 /* 1064 /*
1067 * RFC 8446, 4.4.2.1 - the server may request an OCSP 1065 * RFC 9846, 4.5.1.1 - the server may request an OCSP
1068 * response with an empty status_request. 1066 * response with an empty status_request.
1069 */ 1067 */
1070 if (CBS_len(cbs) == 0) 1068 if (CBS_len(cbs) == 0)
@@ -1440,7 +1438,7 @@ tlsext_srtp_client_process(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1440#endif /* OPENSSL_NO_SRTP */ 1438#endif /* OPENSSL_NO_SRTP */
1441 1439
1442/* 1440/*
1443 * TLSv1.3 Key Share - RFC 8446 section 4.2.8. 1441 * TLSv1.3 Key Share - RFC 9846 section 4.3.8.
1444 */ 1442 */
1445static int 1443static int
1446tlsext_keyshare_client_needs(SSL *s, uint16_t msg_type) 1444tlsext_keyshare_client_needs(SSL *s, uint16_t msg_type)
@@ -1508,7 +1506,7 @@ tlsext_keyshare_server_process(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1508 CBS client_shares, key_exchange; 1506 CBS client_shares, key_exchange;
1509 1507
1510 /* 1508 /*
1511 * RFC 8446 section 4.2.8: 1509 * RFC 9846 section 4.3.8:
1512 * 1510 *
1513 * Each KeyShareEntry value MUST correspond to a group offered in the 1511 * Each KeyShareEntry value MUST correspond to a group offered in the
1514 * "supported_groups" extension and MUST appear in the same order. 1512 * "supported_groups" extension and MUST appear in the same order.
@@ -1597,7 +1595,7 @@ tlsext_keyshare_server_process(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1597 /* 1595 /*
1598 * There are no supported groups that are shared between the 1596 * There are no supported groups that are shared between the
1599 * client and server - this is treated as a handshake failure 1597 * client and server - this is treated as a handshake failure
1600 * or as insufficient security - see RFC 8446 section 4.1.1. 1598 * or as insufficient security - see RFC 9846 section 4.2.1.
1601 */ 1599 */
1602 *alert = TLS13_ALERT_HANDSHAKE_FAILURE; 1600 *alert = TLS13_ALERT_HANDSHAKE_FAILURE;
1603 return 0; 1601 return 0;
@@ -1766,7 +1764,7 @@ tlsext_keyshare_client_process(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1766} 1764}
1767 1765
1768/* 1766/*
1769 * Supported Versions - RFC 8446 section 4.2.1. 1767 * Supported Versions - RFC 9846 section 4.3.1.
1770 */ 1768 */
1771static int 1769static int
1772tlsext_versions_client_needs(SSL *s, uint16_t msg_type) 1770tlsext_versions_client_needs(SSL *s, uint16_t msg_type)
@@ -1868,7 +1866,7 @@ tlsext_versions_client_process(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1868 1866
1869 1867
1870/* 1868/*
1871 * Cookie - RFC 8446 section 4.2.2. 1869 * Cookie - RFC 9846 section 4.3.2.
1872 */ 1870 */
1873 1871
1874static int 1872static int
@@ -1980,7 +1978,7 @@ tlsext_cookie_client_process(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1980} 1978}
1981 1979
1982/* 1980/*
1983 * Pre-Shared Key Exchange Modes - RFC 8446, 4.2.9. 1981 * Pre-Shared Key Exchange Modes - RFC 9846 section 4.3.9.
1984 */ 1982 */
1985 1983
1986static int 1984static int
@@ -2050,7 +2048,7 @@ tlsext_psk_kex_modes_client_process(SSL *s, uint16_t msg_type, CBS *cbs,
2050} 2048}
2051 2049
2052/* 2050/*
2053 * Pre-Shared Key Extension - RFC 8446, 4.2.11 2051 * Pre-Shared Key Extension - RFC 9846 section 4.3.11
2054 */ 2052 */
2055 2053
2056static int 2054static int
@@ -2484,7 +2482,7 @@ tlsext_randomize_build_order(SSL *s)
2484 return 0; 2482 return 0;
2485 s->tlsext_build_order_len = N_TLS_EXTENSIONS; 2483 s->tlsext_build_order_len = N_TLS_EXTENSIONS;
2486 2484
2487 /* RFC 8446, section 4.2 - PSK MUST be the last extension in the CH. */ 2485 /* RFC 9846 section 4.3 - PSK MUST be the last extension in the CH. */
2488 if ((psk_ext = tls_extension_find(TLSEXT_TYPE_pre_shared_key, 2486 if ((psk_ext = tls_extension_find(TLSEXT_TYPE_pre_shared_key,
2489 NULL)) == NULL) 2487 NULL)) == NULL)
2490 return 0; 2488 return 0;
@@ -2538,7 +2536,7 @@ tlsext_build(SSL *s, int is_server, uint16_t msg_type, CBB *cbb)
2538 tlsext = s->tlsext_build_order[i]; 2536 tlsext = s->tlsext_build_order[i];
2539 ext = tlsext_funcs(tlsext, is_server); 2537 ext = tlsext_funcs(tlsext, is_server);
2540 2538
2541 /* RFC 8446 Section 4.2 */ 2539 /* RFC 9846 section 4.3 */
2542 if (tls_version >= TLS1_3_VERSION && 2540 if (tls_version >= TLS1_3_VERSION &&
2543 !(tlsext->messages & msg_type)) 2541 !(tlsext->messages & msg_type))
2544 continue; 2542 continue;
@@ -2571,7 +2569,7 @@ static int
2571tlsext_clienthello_hash_extension(SSL *s, uint16_t type, CBS *cbs) 2569tlsext_clienthello_hash_extension(SSL *s, uint16_t type, CBS *cbs)
2572{ 2570{
2573 /* 2571 /*
2574 * RFC 8446 4.1.2. For subsequent CH, early data will be removed, 2572 * RFC 9846, 4.2.2. For subsequent CH, early data will be removed,
2575 * cookie may be added, padding may be removed. 2573 * cookie may be added, padding may be removed.
2576 */ 2574 */
2577 struct tls13_ctx *ctx = s->tls13; 2575 struct tls13_ctx *ctx = s->tls13;
@@ -2644,7 +2642,7 @@ tlsext_parse(SSL *s, struct tlsext_data *td, int is_server, uint16_t msg_type,
2644 goto err; 2642 goto err;
2645 } 2643 }
2646 2644
2647 /* RFC 8446 Section 4.2 */ 2645 /* RFC 9846 section 4.3 */
2648 if (tls_version >= TLS1_3_VERSION && 2646 if (tls_version >= TLS1_3_VERSION &&
2649 !(tlsext->messages & msg_type)) { 2647 !(tlsext->messages & msg_type)) {
2650 alert_desc = SSL_AD_ILLEGAL_PARAMETER; 2648 alert_desc = SSL_AD_ILLEGAL_PARAMETER;