From: tb Date: Mon, 9 Sep 2024 03:32:29 +0000 (+0000) Subject: Add and use tls13_record_layer_alert_sent() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8699d7a973155db08aadef55e089cda304c1ea8a;p=openbsd 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 --- diff --git a/lib/libssl/tls13_internal.h b/lib/libssl/tls13_internal.h index 75d31fb2ade..0819e933384 100644 --- a/lib/libssl/tls13_internal.h +++ b/lib/libssl/tls13_internal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_internal.h,v 1.103 2024/01/27 14:31:01 jsing Exp $ */ +/* $OpenBSD: tls13_internal.h,v 1.104 2024/09/09 03:32:29 tb Exp $ */ /* * Copyright (c) 2018 Bob Beck * Copyright (c) 2018 Theo Buehler @@ -210,6 +210,8 @@ void tls13_record_layer_set_hash(struct tls13_record_layer *rl, void tls13_record_layer_set_legacy_version(struct tls13_record_layer *rl, uint16_t version); void tls13_record_layer_set_retry_after_phh(struct tls13_record_layer *rl, int retry); +void tls13_record_layer_alert_sent(struct tls13_record_layer *rl, + uint8_t alert_level, uint8_t alert_desc); void tls13_record_layer_handshake_completed(struct tls13_record_layer *rl); int tls13_record_layer_set_read_traffic_key(struct tls13_record_layer *rl, struct tls13_secret *read_key, enum ssl_encryption_level_t read_level); diff --git a/lib/libssl/tls13_record_layer.c b/lib/libssl/tls13_record_layer.c index 5432744cd73..f5604adbeb8 100644 --- a/lib/libssl/tls13_record_layer.c +++ b/lib/libssl/tls13_record_layer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_record_layer.c,v 1.73 2024/01/27 14:23:51 jsing Exp $ */ +/* $OpenBSD: tls13_record_layer.c,v 1.74 2024/09/09 03:32:29 tb Exp $ */ /* * Copyright (c) 2018, 2019 Joel Sing * @@ -332,6 +332,13 @@ tls13_record_layer_process_alert(struct tls13_record_layer *rl) return ret; } +void +tls13_record_layer_alert_sent(struct tls13_record_layer *rl, + uint8_t alert_level, uint8_t alert_desc) +{ + rl->cb.alert_sent(alert_level, alert_desc, rl->cb_arg); +} + static ssize_t tls13_record_layer_send_alert(struct tls13_record_layer *rl) { @@ -361,7 +368,7 @@ tls13_record_layer_send_alert(struct tls13_record_layer *rl) ret = TLS13_IO_ALERT; } - rl->cb.alert_sent(rl->alert_level, rl->alert_desc, rl->cb_arg); + tls13_record_layer_alert_sent(rl, rl->alert_level, rl->alert_desc); return ret; }