summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_internal.h
diff options
context:
space:
mode:
authorjsing <>2022-07-24 14:28:16 +0000
committerjsing <>2022-07-24 14:28:16 +0000
commitf7f7655b1951f8dd9a8166cb6203a780f911d0bc (patch)
treef814f798e3d47e53e29dfd4db0eece8481fc97ad /src/lib/libssl/tls13_internal.h
parentc804d574e337158da589e90dc9cbb13d6ffde44f (diff)
downloadopenbsd-f7f7655b1951f8dd9a8166cb6203a780f911d0bc.tar.gz
openbsd-f7f7655b1951f8dd9a8166cb6203a780f911d0bc.tar.bz2
openbsd-f7f7655b1951f8dd9a8166cb6203a780f911d0bc.zip
Provide record layer callbacks for QUIC.
QUIC uses TLS to complete the handshake, however unlike normal TLS it does not use the TLS record layer, rather it provides its own transport. This means that we need to intercept all communication between the TLS handshake and the record layer. This allows TLS handshake message writes to be directed to QUIC, likewise for TLS handshake message reads. Alerts also need to be sent via QUIC, plus it needs to be provided with the traffic keys that are derived by TLS. ok tb@
Diffstat (limited to 'src/lib/libssl/tls13_internal.h')
-rw-r--r--src/lib/libssl/tls13_internal.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_internal.h b/src/lib/libssl/tls13_internal.h
index 6382f8b048..f4b17bdf25 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.100 2022/07/24 14:16:29 jsing Exp $ */ 1/* $OpenBSD: tls13_internal.h,v 1.101 2022/07/24 14:28:16 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>
@@ -175,9 +175,19 @@ int tls13_update_server_traffic_secret(struct tls13_secrets *secrets);
175struct tls13_record_layer; 175struct tls13_record_layer;
176 176
177struct tls13_record_layer_callbacks { 177struct tls13_record_layer_callbacks {
178 /* Wire callbacks. */
178 tls_read_cb wire_read; 179 tls_read_cb wire_read;
179 tls_write_cb wire_write; 180 tls_write_cb wire_write;
180 tls_flush_cb wire_flush; 181 tls_flush_cb wire_flush;
182
183 /* Interceptors. */
184 tls_handshake_read_cb handshake_read;
185 tls_handshake_write_cb handshake_write;
186 tls_traffic_key_cb set_read_traffic_key;
187 tls_traffic_key_cb set_write_traffic_key;
188 tls_alert_send_cb alert_send;
189
190 /* Notification callbacks. */
181 tls13_alert_cb alert_recv; 191 tls13_alert_cb alert_recv;
182 tls13_alert_cb alert_sent; 192 tls13_alert_cb alert_sent;
183 tls13_phh_recv_cb phh_recv; 193 tls13_phh_recv_cb phh_recv;
@@ -187,6 +197,8 @@ struct tls13_record_layer_callbacks {
187struct tls13_record_layer *tls13_record_layer_new( 197struct tls13_record_layer *tls13_record_layer_new(
188 const struct tls13_record_layer_callbacks *callbacks, void *cb_arg); 198 const struct tls13_record_layer_callbacks *callbacks, void *cb_arg);
189void tls13_record_layer_free(struct tls13_record_layer *rl); 199void tls13_record_layer_free(struct tls13_record_layer *rl);
200void tls13_record_layer_set_callbacks(struct tls13_record_layer *rl,
201 const struct tls13_record_layer_callbacks *callbacks, void *cb_arg);
190void tls13_record_layer_allow_ccs(struct tls13_record_layer *rl, int allow); 202void tls13_record_layer_allow_ccs(struct tls13_record_layer *rl, int allow);
191void tls13_record_layer_allow_legacy_alerts(struct tls13_record_layer *rl, int allow); 203void tls13_record_layer_allow_legacy_alerts(struct tls13_record_layer *rl, int allow);
192void tls13_record_layer_rcontent(struct tls13_record_layer *rl, CBS *cbs); 204void tls13_record_layer_rcontent(struct tls13_record_layer *rl, CBS *cbs);
@@ -297,6 +309,13 @@ void tls13_ctx_free(struct tls13_ctx *ctx);
297const EVP_AEAD *tls13_cipher_aead(const SSL_CIPHER *cipher); 309const EVP_AEAD *tls13_cipher_aead(const SSL_CIPHER *cipher);
298const EVP_MD *tls13_cipher_hash(const SSL_CIPHER *cipher); 310const EVP_MD *tls13_cipher_hash(const SSL_CIPHER *cipher);
299 311
312void tls13_alert_received_cb(uint8_t alert_desc, void *arg);
313void tls13_alert_sent_cb(uint8_t alert_desc, void *arg);
314ssize_t tls13_phh_received_cb(void *cb_arg);
315void tls13_phh_done_cb(void *cb_arg);
316
317int tls13_quic_init(struct tls13_ctx *ctx);
318
300/* 319/*
301 * Legacy interfaces. 320 * Legacy interfaces.
302 */ 321 */