diff options
Diffstat (limited to 'src/lib/libssl/tls13_internal.h')
-rw-r--r-- | src/lib/libssl/tls13_internal.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/lib/libssl/tls13_internal.h b/src/lib/libssl/tls13_internal.h index 876f339c80..496627c0cd 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.8 2019/01/19 03:32:03 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_internal.h,v 1.9 2019/01/20 10:31:54 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> |
@@ -31,8 +31,12 @@ __BEGIN_HIDDEN_DECLS | |||
31 | #define TLS13_IO_WANT_POLLIN -2 | 31 | #define TLS13_IO_WANT_POLLIN -2 |
32 | #define TLS13_IO_WANT_POLLOUT -3 | 32 | #define TLS13_IO_WANT_POLLOUT -3 |
33 | 33 | ||
34 | typedef int (*tls13_alert_cb)(uint8_t _alert_level, uint8_t _alert_desc, | ||
35 | void *_cb_arg); | ||
36 | typedef int (*tls13_post_handshake_cb)(void *_cb_arg); | ||
34 | typedef ssize_t (*tls13_read_cb)(void *_buf, size_t _buflen, void *_cb_arg); | 37 | typedef ssize_t (*tls13_read_cb)(void *_buf, size_t _buflen, void *_cb_arg); |
35 | typedef ssize_t (*tls13_write_cb)(const void *_buf, size_t _buflen, void *_cb_arg); | 38 | typedef ssize_t (*tls13_write_cb)(const void *_buf, size_t _buflen, |
39 | void *_cb_arg); | ||
36 | 40 | ||
37 | struct tls13_buffer; | 41 | struct tls13_buffer; |
38 | 42 | ||
@@ -41,7 +45,8 @@ void tls13_buffer_free(struct tls13_buffer *buf); | |||
41 | ssize_t tls13_buffer_extend(struct tls13_buffer *buf, size_t len, | 45 | ssize_t tls13_buffer_extend(struct tls13_buffer *buf, size_t len, |
42 | tls13_read_cb read_cb, void *cb_arg); | 46 | tls13_read_cb read_cb, void *cb_arg); |
43 | void tls13_buffer_cbs(struct tls13_buffer *buf, CBS *cbs); | 47 | void tls13_buffer_cbs(struct tls13_buffer *buf, CBS *cbs); |
44 | int tls13_buffer_finish(struct tls13_buffer *buf, uint8_t **out, size_t *out_len); | 48 | int tls13_buffer_finish(struct tls13_buffer *buf, uint8_t **out, |
49 | size_t *out_len); | ||
45 | 50 | ||
46 | struct tls13_secret { | 51 | struct tls13_secret { |
47 | uint8_t *data; | 52 | uint8_t *data; |
@@ -92,6 +97,27 @@ int tls13_derive_application_secrets(struct tls13_secrets *secrets, | |||
92 | 97 | ||
93 | struct tls13_ctx; | 98 | struct tls13_ctx; |
94 | 99 | ||
100 | struct tls13_record_layer; | ||
101 | |||
102 | struct tls13_record_layer *tls13_record_layer_new(tls13_read_cb wire_read, | ||
103 | tls13_write_cb wire_write, tls13_alert_cb alert_cb, | ||
104 | tls13_post_handshake_cb post_handshake_cb, void *cb_arg); | ||
105 | void tls13_record_layer_free(struct tls13_record_layer *rl); | ||
106 | void tls13_record_layer_set_aead(struct tls13_record_layer *rl, | ||
107 | const EVP_AEAD *aead); | ||
108 | void tls13_record_layer_set_hash(struct tls13_record_layer *rl, | ||
109 | const EVP_MD *hash); | ||
110 | void tls13_record_layer_handshake_completed(struct tls13_record_layer *rl); | ||
111 | int tls13_record_layer_set_traffic_keys(struct tls13_record_layer *rl, | ||
112 | struct tls13_secret *read_key, struct tls13_secret *write_key); | ||
113 | |||
114 | ssize_t tls13_read_handshake_data(struct tls13_record_layer *rl, uint8_t *buf, size_t n); | ||
115 | ssize_t tls13_write_handshake_data(struct tls13_record_layer *rl, const uint8_t *buf, | ||
116 | size_t n); | ||
117 | ssize_t tls13_read_application_data(struct tls13_record_layer *rl, uint8_t *buf, size_t n); | ||
118 | ssize_t tls13_write_application_data(struct tls13_record_layer *rl, const uint8_t *buf, | ||
119 | size_t n); | ||
120 | |||
95 | /* | 121 | /* |
96 | * RFC 8446, Section B.3 | 122 | * RFC 8446, Section B.3 |
97 | * | 123 | * |