summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_record_layer.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/tls13_record_layer.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/tls13_record_layer.c')
-rw-r--r--src/lib/libssl/tls13_record_layer.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libssl/tls13_record_layer.c b/src/lib/libssl/tls13_record_layer.c
index 778356af15..e573b50760 100644
--- a/src/lib/libssl/tls13_record_layer.c
+++ b/src/lib/libssl/tls13_record_layer.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_record_layer.c,v 1.75 2026/07/31 03:59:50 kenjiro Exp $ */ 1/* $OpenBSD: tls13_record_layer.c,v 1.76 2026/08/21 17:15:22 tb 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 *
@@ -95,7 +95,7 @@ struct tls13_record_layer {
95 uint8_t alert_level; 95 uint8_t alert_level;
96 uint8_t alert_desc; 96 uint8_t alert_desc;
97 97
98 /* Pending post-handshake handshake messages (RFC 8446, section 4.6). */ 98 /* Pending post-handshake handshake messages (RFC 9846, section 4.7). */
99 CBS phh_cbs; 99 CBS phh_cbs;
100 uint8_t *phh_data; 100 uint8_t *phh_data;
101 size_t phh_len; 101 size_t phh_len;
@@ -200,7 +200,7 @@ tls13_record_layer_inc_seq_num(uint8_t *seq_num)
200{ 200{
201 int i; 201 int i;
202 202
203 /* RFC 8446 section 5.3 - sequence numbers must not wrap. */ 203 /* RFC 9846 section 5.3 - sequence numbers must not wrap. */
204 if (memcmp(seq_num, tls13_max_seq_num, TLS13_RECORD_SEQ_NUM_LEN) == 0) 204 if (memcmp(seq_num, tls13_max_seq_num, TLS13_RECORD_SEQ_NUM_LEN) == 0)
205 return 0; 205 return 0;
206 206
@@ -222,7 +222,7 @@ tls13_record_layer_update_nonce(struct tls13_secret *nonce,
222 return 0; 222 return 0;
223 223
224 /* 224 /*
225 * RFC 8446 section 5.3 - sequence number is zero padded and XOR'd 225 * RFC 9846 section 5.3 - sequence number is zero padded and XOR'd
226 * with the IV to produce a per-record nonce. The IV will also be 226 * with the IV to produce a per-record nonce. The IV will also be
227 * at least 8-bytes in length. 227 * at least 8-bytes in length.
228 */ 228 */
@@ -284,7 +284,7 @@ tls13_record_layer_process_alert(struct tls13_record_layer *rl)
284 ssize_t ret = TLS13_IO_FAILURE; 284 ssize_t ret = TLS13_IO_FAILURE;
285 285
286 /* 286 /*
287 * RFC 8446 - sections 5.1 and 6. 287 * RFC 9846 - sections 5.1 and 6.
288 * 288 *
289 * A TLSv1.3 alert record can only contain a single alert - this means 289 * A TLSv1.3 alert record can only contain a single alert - this means
290 * that processing the alert must consume all of the record. The alert 290 * that processing the alert must consume all of the record. The alert
@@ -305,8 +305,8 @@ tls13_record_layer_process_alert(struct tls13_record_layer *rl)
305 tls_content_clear(rl->rcontent); 305 tls_content_clear(rl->rcontent);
306 306
307 /* 307 /*
308 * Alert level is ignored for closure alerts (RFC 8446 section 6.1), 308 * Alert level is ignored for closure alerts (RFC 9846 section 6.1),
309 * however for error alerts (RFC 8446 section 6.2), the alert level 309 * however for error alerts (RFC 9846 section 6.2), the alert level
310 * must be specified as fatal. 310 * must be specified as fatal.
311 */ 311 */
312 if (alert_desc == TLS13_ALERT_CLOSE_NOTIFY) { 312 if (alert_desc == TLS13_ALERT_CLOSE_NOTIFY) {
@@ -344,7 +344,7 @@ tls13_record_layer_send_alert(struct tls13_record_layer *rl)
344{ 344{
345 ssize_t ret; 345 ssize_t ret;
346 346
347 /* This has to fit into a single record, per RFC 8446 section 5.1. */ 347 /* This has to fit into a single record, per RFC 9846 section 5.1. */
348 if ((ret = tls13_record_layer_write_record(rl, SSL3_RT_ALERT, 348 if ((ret = tls13_record_layer_write_record(rl, SSL3_RT_ALERT,
349 rl->alert_data, rl->alert_len)) != rl->alert_len) { 349 rl->alert_data, rl->alert_len)) != rl->alert_len) {
350 if (ret == TLS13_IO_EOF) 350 if (ret == TLS13_IO_EOF)
@@ -604,7 +604,7 @@ tls13_record_layer_open_record_protected(struct tls13_record_layer *rl)
604 break; 604 break;
605 } 605 }
606 if (content_type == 0) { 606 if (content_type == 0) {
607 /* Unexpected message per RFC 8446 section 5.4. */ 607 /* Unexpected message per RFC 9846 section 5.4. */
608 rl->alert = TLS13_ALERT_UNEXPECTED_MESSAGE; 608 rl->alert = TLS13_ALERT_UNEXPECTED_MESSAGE;
609 goto err; 609 goto err;
610 } 610 }
@@ -835,7 +835,7 @@ tls13_record_layer_read_record(struct tls13_record_layer *rl)
835 /* 835 /*
836 * In response to a client hello we may receive an alert in a 836 * In response to a client hello we may receive an alert in a
837 * record with a legacy version. Otherwise enforce that the 837 * record with a legacy version. Otherwise enforce that the
838 * legacy record version is 0x0303 per RFC 8446, section 5.1. 838 * legacy record version is 0x0303 per RFC 9846, section 5.1.
839 */ 839 */
840 if (rl->legacy_version == TLS1_2_VERSION && 840 if (rl->legacy_version == TLS1_2_VERSION &&
841 tls13_record_version(rl->rrec) != TLS1_2_VERSION && 841 tls13_record_version(rl->rrec) != TLS1_2_VERSION &&
@@ -846,7 +846,7 @@ tls13_record_layer_read_record(struct tls13_record_layer *rl)
846 * Bag of hacks ahead... after the first ClientHello message has been 846 * Bag of hacks ahead... after the first ClientHello message has been
847 * sent or received and before the peer's Finished message has been 847 * sent or received and before the peer's Finished message has been
848 * received, we may receive an unencrypted ChangeCipherSpec record 848 * received, we may receive an unencrypted ChangeCipherSpec record
849 * (see RFC 8446 section 5 and appendix D.4). This record must be 849 * (see RFC 9846 section 5 and appendix E.4). This record must be
850 * ignored. 850 * ignored.
851 */ 851 */
852 if (content_type == SSL3_RT_CHANGE_CIPHER_SPEC) { 852 if (content_type == SSL3_RT_CHANGE_CIPHER_SPEC) {
@@ -881,7 +881,7 @@ tls13_record_layer_read_record(struct tls13_record_layer *rl)
881 /* 881 /*
882 * On receiving a handshake or alert record with empty inner plaintext, 882 * On receiving a handshake or alert record with empty inner plaintext,
883 * we must terminate the connection with an unexpected_message alert. 883 * we must terminate the connection with an unexpected_message alert.
884 * See RFC 8446 section 5.4. 884 * See RFC 9846 section 5.4.
885 */ 885 */
886 if (tls_content_remaining(rl->rcontent) == 0 && 886 if (tls_content_remaining(rl->rcontent) == 0 &&
887 (tls_content_type(rl->rcontent) == SSL3_RT_ALERT || 887 (tls_content_type(rl->rcontent) == SSL3_RT_ALERT ||