diff options
| author | jsing <> | 2024-01-27 14:23:51 +0000 |
|---|---|---|
| committer | jsing <> | 2024-01-27 14:23:51 +0000 |
| commit | 9f10df8c2961b5d22fbb67942ef04e74ea843ece (patch) | |
| tree | 9cbd5fde21560efd1f35dcf0b36726c3ac48b0c5 /src/lib/libssl/tls13_internal.h | |
| parent | ed08a425bfcf3656ff1f5ff8d820f8cc58146a2c (diff) | |
| download | openbsd-9f10df8c2961b5d22fbb67942ef04e74ea843ece.tar.gz openbsd-9f10df8c2961b5d22fbb67942ef04e74ea843ece.tar.bz2 openbsd-9f10df8c2961b5d22fbb67942ef04e74ea843ece.zip | |
Add message callbacks for alerts in the TLSv1.3 stack.
This will make it easier to regress test shutdown behaviour in the TLSv1.3
stack. Additionally, `openssl -msg` now shows alerts for TLSv1.3
connections.
ok tb@
Diffstat (limited to 'src/lib/libssl/tls13_internal.h')
| -rw-r--r-- | src/lib/libssl/tls13_internal.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/libssl/tls13_internal.h b/src/lib/libssl/tls13_internal.h index f4b17bdf25..68e695e53a 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.101 2022/07/24 14:28:16 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_internal.h,v 1.102 2024/01/27 14:23:51 jsing 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> |
| @@ -87,7 +87,8 @@ __BEGIN_HIDDEN_DECLS | |||
| 87 | #define TLS13_INFO_ACCEPT_EXIT SSL_CB_ACCEPT_EXIT | 87 | #define TLS13_INFO_ACCEPT_EXIT SSL_CB_ACCEPT_EXIT |
| 88 | #define TLS13_INFO_CONNECT_EXIT SSL_CB_CONNECT_EXIT | 88 | #define TLS13_INFO_CONNECT_EXIT SSL_CB_CONNECT_EXIT |
| 89 | 89 | ||
| 90 | typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg); | 90 | typedef void (*tls13_alert_cb)(uint8_t _alert_level, uint8_t _alert_desc, |
| 91 | void *_cb_arg); | ||
| 91 | typedef ssize_t (*tls13_phh_recv_cb)(void *_cb_arg); | 92 | typedef ssize_t (*tls13_phh_recv_cb)(void *_cb_arg); |
| 92 | typedef void (*tls13_phh_sent_cb)(void *_cb_arg); | 93 | typedef void (*tls13_phh_sent_cb)(void *_cb_arg); |
| 93 | typedef void (*tls13_handshake_message_cb)(void *_cb_arg); | 94 | typedef void (*tls13_handshake_message_cb)(void *_cb_arg); |
| @@ -291,6 +292,8 @@ struct tls13_ctx { | |||
| 291 | int phh_count; | 292 | int phh_count; |
| 292 | time_t phh_last_seen; | 293 | time_t phh_last_seen; |
| 293 | 294 | ||
| 295 | tls13_alert_cb alert_sent_cb; | ||
| 296 | tls13_alert_cb alert_recv_cb; | ||
| 294 | tls13_handshake_message_cb handshake_message_sent_cb; | 297 | tls13_handshake_message_cb handshake_message_sent_cb; |
| 295 | tls13_handshake_message_cb handshake_message_recv_cb; | 298 | tls13_handshake_message_cb handshake_message_recv_cb; |
| 296 | tls13_info_cb info_cb; | 299 | tls13_info_cb info_cb; |
| @@ -309,8 +312,8 @@ void tls13_ctx_free(struct tls13_ctx *ctx); | |||
| 309 | const EVP_AEAD *tls13_cipher_aead(const SSL_CIPHER *cipher); | 312 | const EVP_AEAD *tls13_cipher_aead(const SSL_CIPHER *cipher); |
| 310 | const EVP_MD *tls13_cipher_hash(const SSL_CIPHER *cipher); | 313 | const EVP_MD *tls13_cipher_hash(const SSL_CIPHER *cipher); |
| 311 | 314 | ||
| 312 | void tls13_alert_received_cb(uint8_t alert_desc, void *arg); | 315 | void tls13_alert_received_cb(uint8_t alert_level, uint8_t alert_desc, void *arg); |
| 313 | void tls13_alert_sent_cb(uint8_t alert_desc, void *arg); | 316 | void tls13_alert_sent_cb(uint8_t alert_level, uint8_t alert_desc, void *arg); |
| 314 | ssize_t tls13_phh_received_cb(void *cb_arg); | 317 | ssize_t tls13_phh_received_cb(void *cb_arg); |
| 315 | void tls13_phh_done_cb(void *cb_arg); | 318 | void tls13_phh_done_cb(void *cb_arg); |
| 316 | 319 | ||
