diff options
| author | tb <> | 2024-09-09 03:32:29 +0000 |
|---|---|---|
| committer | tb <> | 2024-09-09 03:32:29 +0000 |
| commit | 6a0a2885d3954aea22b4da65c4715f7b744dac46 (patch) | |
| tree | a0ea5e70ea8132f3f5093136e163719b6c3ea1ca /src | |
| parent | 616514575b27cdebdb9cf66062ab5af88cdf89e5 (diff) | |
| download | openbsd-6a0a2885d3954aea22b4da65c4715f7b744dac46.tar.gz openbsd-6a0a2885d3954aea22b4da65c4715f7b744dac46.tar.bz2 openbsd-6a0a2885d3954aea22b4da65c4715f7b744dac46.zip | |
Add and use tls13_record_layer_alert_sent()
This is a small refactoring that wraps a direct call to the record layer's
alert_sent() callback into a handler for upcoming reuse in the QUIC code.
No functional change.
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libssl/tls13_internal.h | 4 | ||||
| -rw-r--r-- | src/lib/libssl/tls13_record_layer.c | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/libssl/tls13_internal.h b/src/lib/libssl/tls13_internal.h index 75d31fb2ad..0819e93338 100644 --- a/src/lib/libssl/tls13_internal.h +++ b/src/lib/libssl/tls13_internal.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls13_internal.h,v 1.103 2024/01/27 14:31:01 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_internal.h,v 1.104 2024/09/09 03:32:29 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2018 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2018 Bob Beck <beck@openbsd.org> |
| 4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> |
| @@ -210,6 +210,8 @@ void tls13_record_layer_set_hash(struct tls13_record_layer *rl, | |||
| 210 | void tls13_record_layer_set_legacy_version(struct tls13_record_layer *rl, | 210 | void tls13_record_layer_set_legacy_version(struct tls13_record_layer *rl, |
| 211 | uint16_t version); | 211 | uint16_t version); |
| 212 | void tls13_record_layer_set_retry_after_phh(struct tls13_record_layer *rl, int retry); | 212 | void tls13_record_layer_set_retry_after_phh(struct tls13_record_layer *rl, int retry); |
| 213 | void tls13_record_layer_alert_sent(struct tls13_record_layer *rl, | ||
| 214 | uint8_t alert_level, uint8_t alert_desc); | ||
| 213 | void tls13_record_layer_handshake_completed(struct tls13_record_layer *rl); | 215 | void tls13_record_layer_handshake_completed(struct tls13_record_layer *rl); |
| 214 | int tls13_record_layer_set_read_traffic_key(struct tls13_record_layer *rl, | 216 | int tls13_record_layer_set_read_traffic_key(struct tls13_record_layer *rl, |
| 215 | struct tls13_secret *read_key, enum ssl_encryption_level_t read_level); | 217 | struct tls13_secret *read_key, enum ssl_encryption_level_t read_level); |
diff --git a/src/lib/libssl/tls13_record_layer.c b/src/lib/libssl/tls13_record_layer.c index 5432744cd7..f5604adbeb 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.73 2024/01/27 14:23:51 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_record_layer.c,v 1.74 2024/09/09 03:32:29 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 | * |
| @@ -332,6 +332,13 @@ tls13_record_layer_process_alert(struct tls13_record_layer *rl) | |||
| 332 | return ret; | 332 | return ret; |
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | void | ||
| 336 | tls13_record_layer_alert_sent(struct tls13_record_layer *rl, | ||
| 337 | uint8_t alert_level, uint8_t alert_desc) | ||
| 338 | { | ||
| 339 | rl->cb.alert_sent(alert_level, alert_desc, rl->cb_arg); | ||
| 340 | } | ||
| 341 | |||
| 335 | static ssize_t | 342 | static ssize_t |
| 336 | tls13_record_layer_send_alert(struct tls13_record_layer *rl) | 343 | tls13_record_layer_send_alert(struct tls13_record_layer *rl) |
| 337 | { | 344 | { |
| @@ -361,7 +368,7 @@ tls13_record_layer_send_alert(struct tls13_record_layer *rl) | |||
| 361 | ret = TLS13_IO_ALERT; | 368 | ret = TLS13_IO_ALERT; |
| 362 | } | 369 | } |
| 363 | 370 | ||
| 364 | rl->cb.alert_sent(rl->alert_level, rl->alert_desc, rl->cb_arg); | 371 | tls13_record_layer_alert_sent(rl, rl->alert_level, rl->alert_desc); |
| 365 | 372 | ||
| 366 | return ret; | 373 | return ret; |
| 367 | } | 374 | } |
