summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_internal.h
diff options
context:
space:
mode:
authortb <>2020-07-30 16:23:17 +0000
committertb <>2020-07-30 16:23:17 +0000
commitc83de9bf1a5deaa83030eac8eb7a2ce4749d120d (patch)
treeea30368cd2d92bed397d7b50b859b333c5b0ccc6 /src/lib/libssl/tls13_internal.h
parentaac53677fa701dbcea49076f866c4ffbc99edfad (diff)
downloadopenbsd-c83de9bf1a5deaa83030eac8eb7a2ce4749d120d.tar.gz
openbsd-c83de9bf1a5deaa83030eac8eb7a2ce4749d120d.tar.bz2
openbsd-c83de9bf1a5deaa83030eac8eb7a2ce4749d120d.zip
Add minimal info callback support for TLSv1.3
As abieber@ found the hard way, some python frameworks (twisted, synapse) thought it a great idea to use the info callback mechanism (designed to get state information about SSL objects) to modify state information such as setting and verifying the SNI. The switch of TLS_method() to default to TLSv1.3 broke these contraptions. Further bits of the info callback mechanism will likely metastasize throughout the TLSv1.3 stack if we need them, so we only do what's really necessary now. Lots of debugging, crucial hint and testing by abieber input & ok jsing
Diffstat (limited to 'src/lib/libssl/tls13_internal.h')
-rw-r--r--src/lib/libssl/tls13_internal.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_internal.h b/src/lib/libssl/tls13_internal.h
index f35f09bbb1..03a1a6b4b1 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.85 2020/07/03 04:12:51 tb Exp $ */ 1/* $OpenBSD: tls13_internal.h,v 1.86 2020/07/30 16:23:17 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>
@@ -79,6 +79,9 @@ __BEGIN_HIDDEN_DECLS
79#define TLS13_ALERT_CERTIFICATE_REQUIRED 116 79#define TLS13_ALERT_CERTIFICATE_REQUIRED 116
80#define TLS13_ALERT_NO_APPLICATION_PROTOCOL 120 80#define TLS13_ALERT_NO_APPLICATION_PROTOCOL 120
81 81
82#define TLS13_INFO_HANDSHAKE_STARTED SSL_CB_HANDSHAKE_START
83#define TLS13_INFO_HANDSHAKE_COMPLETED SSL_CB_HANDSHAKE_DONE
84
82typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg); 85typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg);
83typedef ssize_t (*tls13_phh_recv_cb)(void *_cb_arg, CBS *_cbs); 86typedef ssize_t (*tls13_phh_recv_cb)(void *_cb_arg, CBS *_cbs);
84typedef void (*tls13_phh_sent_cb)(void *_cb_arg); 87typedef void (*tls13_phh_sent_cb)(void *_cb_arg);
@@ -86,6 +89,7 @@ typedef ssize_t (*tls13_read_cb)(void *_buf, size_t _buflen, void *_cb_arg);
86typedef ssize_t (*tls13_write_cb)(const void *_buf, size_t _buflen, 89typedef ssize_t (*tls13_write_cb)(const void *_buf, size_t _buflen,
87 void *_cb_arg); 90 void *_cb_arg);
88typedef void (*tls13_handshake_message_cb)(void *_cb_arg); 91typedef void (*tls13_handshake_message_cb)(void *_cb_arg);
92typedef void (*tls13_info_cb)(void *_cb_arg, int _state, int _ret);
89typedef int (*tls13_ocsp_status_cb)(void *_cb_arg); 93typedef int (*tls13_ocsp_status_cb)(void *_cb_arg);
90 94
91/* 95/*
@@ -261,6 +265,7 @@ struct tls13_ctx {
261 struct ssl_handshake_tls13_st *hs; 265 struct ssl_handshake_tls13_st *hs;
262 uint8_t mode; 266 uint8_t mode;
263 struct tls13_handshake_stage handshake_stage; 267 struct tls13_handshake_stage handshake_stage;
268 int handshake_started;
264 int handshake_completed; 269 int handshake_completed;
265 int middlebox_compat; 270 int middlebox_compat;
266 int send_dummy_ccs; 271 int send_dummy_ccs;
@@ -281,6 +286,7 @@ struct tls13_ctx {
281 286
282 tls13_handshake_message_cb handshake_message_sent_cb; 287 tls13_handshake_message_cb handshake_message_sent_cb;
283 tls13_handshake_message_cb handshake_message_recv_cb; 288 tls13_handshake_message_cb handshake_message_recv_cb;
289 tls13_info_cb info_cb;
284 tls13_ocsp_status_cb ocsp_status_recv_cb; 290 tls13_ocsp_status_cb ocsp_status_recv_cb;
285}; 291};
286#ifndef TLS13_PHH_LIMIT_TIME 292#ifndef TLS13_PHH_LIMIT_TIME