1 | /*
|
---|
2 | * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License 2.0 (the "License"). You may not use
|
---|
5 | * this file except in compliance with the License. You can obtain a copy
|
---|
6 | * in the file LICENSE in the source distribution or at
|
---|
7 | * https://www.openssl.org/source/license.html
|
---|
8 | */
|
---|
9 |
|
---|
10 | /*****************************************************************************
|
---|
11 | * *
|
---|
12 | * The following definitions are PRIVATE to the state machine. They should *
|
---|
13 | * NOT be used outside of the state machine. *
|
---|
14 | * *
|
---|
15 | *****************************************************************************/
|
---|
16 |
|
---|
17 | /* Max message length definitions */
|
---|
18 |
|
---|
19 | /* The spec allows for a longer length than this, but we limit it */
|
---|
20 | #define HELLO_VERIFY_REQUEST_MAX_LENGTH 258
|
---|
21 | #define END_OF_EARLY_DATA_MAX_LENGTH 0
|
---|
22 | #define HELLO_RETRY_REQUEST_MAX_LENGTH 20000
|
---|
23 | #define ENCRYPTED_EXTENSIONS_MAX_LENGTH 20000
|
---|
24 | #define SESSION_TICKET_MAX_LENGTH_TLS13 131338
|
---|
25 | #define SESSION_TICKET_MAX_LENGTH_TLS12 65541
|
---|
26 | #define SERVER_KEY_EXCH_MAX_LENGTH 102400
|
---|
27 | #define SERVER_HELLO_DONE_MAX_LENGTH 0
|
---|
28 | #define KEY_UPDATE_MAX_LENGTH 1
|
---|
29 | #define CCS_MAX_LENGTH 1
|
---|
30 |
|
---|
31 | /* Max ServerHello size permitted by RFC 8446 */
|
---|
32 | #define SERVER_HELLO_MAX_LENGTH 65607
|
---|
33 |
|
---|
34 | /* Max should actually be 36 but we are generous */
|
---|
35 | #define FINISHED_MAX_LENGTH 64
|
---|
36 |
|
---|
37 | /* Dummy message type */
|
---|
38 | #define SSL3_MT_DUMMY -1
|
---|
39 |
|
---|
40 | extern const unsigned char hrrrandom[];
|
---|
41 |
|
---|
42 | /* Message processing return codes */
|
---|
43 | typedef enum {
|
---|
44 | /* Something bad happened */
|
---|
45 | MSG_PROCESS_ERROR,
|
---|
46 | /* We've finished reading - swap to writing */
|
---|
47 | MSG_PROCESS_FINISHED_READING,
|
---|
48 | /*
|
---|
49 | * We've completed the main processing of this message but there is some
|
---|
50 | * post processing to be done.
|
---|
51 | */
|
---|
52 | MSG_PROCESS_CONTINUE_PROCESSING,
|
---|
53 | /* We've finished this message - read the next message */
|
---|
54 | MSG_PROCESS_CONTINUE_READING
|
---|
55 | } MSG_PROCESS_RETURN;
|
---|
56 |
|
---|
57 | typedef int (*confunc_f) (SSL *s, WPACKET *pkt);
|
---|
58 |
|
---|
59 | int ssl3_take_mac(SSL *s);
|
---|
60 | int check_in_list(SSL *s, uint16_t group_id, const uint16_t *groups,
|
---|
61 | size_t num_groups, int checkallow);
|
---|
62 | int create_synthetic_message_hash(SSL *s, const unsigned char *hashval,
|
---|
63 | size_t hashlen, const unsigned char *hrr,
|
---|
64 | size_t hrrlen);
|
---|
65 | int parse_ca_names(SSL *s, PACKET *pkt);
|
---|
66 | const STACK_OF(X509_NAME) *get_ca_names(SSL *s);
|
---|
67 | int construct_ca_names(SSL *s, const STACK_OF(X509_NAME) *ca_sk, WPACKET *pkt);
|
---|
68 | size_t construct_key_exchange_tbs(SSL *s, unsigned char **ptbs,
|
---|
69 | const void *param, size_t paramlen);
|
---|
70 |
|
---|
71 | /*
|
---|
72 | * TLS/DTLS client state machine functions
|
---|
73 | */
|
---|
74 | int ossl_statem_client_read_transition(SSL *s, int mt);
|
---|
75 | WRITE_TRAN ossl_statem_client_write_transition(SSL *s);
|
---|
76 | WORK_STATE ossl_statem_client_pre_work(SSL *s, WORK_STATE wst);
|
---|
77 | WORK_STATE ossl_statem_client_post_work(SSL *s, WORK_STATE wst);
|
---|
78 | int ossl_statem_client_construct_message(SSL *s, WPACKET *pkt,
|
---|
79 | confunc_f *confunc, int *mt);
|
---|
80 | size_t ossl_statem_client_max_message_size(SSL *s);
|
---|
81 | MSG_PROCESS_RETURN ossl_statem_client_process_message(SSL *s, PACKET *pkt);
|
---|
82 | WORK_STATE ossl_statem_client_post_process_message(SSL *s, WORK_STATE wst);
|
---|
83 |
|
---|
84 | /*
|
---|
85 | * TLS/DTLS server state machine functions
|
---|
86 | */
|
---|
87 | int ossl_statem_server_read_transition(SSL *s, int mt);
|
---|
88 | WRITE_TRAN ossl_statem_server_write_transition(SSL *s);
|
---|
89 | WORK_STATE ossl_statem_server_pre_work(SSL *s, WORK_STATE wst);
|
---|
90 | WORK_STATE ossl_statem_server_post_work(SSL *s, WORK_STATE wst);
|
---|
91 | int ossl_statem_server_construct_message(SSL *s, WPACKET *pkt,
|
---|
92 | confunc_f *confunc,int *mt);
|
---|
93 | size_t ossl_statem_server_max_message_size(SSL *s);
|
---|
94 | MSG_PROCESS_RETURN ossl_statem_server_process_message(SSL *s, PACKET *pkt);
|
---|
95 | WORK_STATE ossl_statem_server_post_process_message(SSL *s, WORK_STATE wst);
|
---|
96 |
|
---|
97 | /* Functions for getting new message data */
|
---|
98 | __owur int tls_get_message_header(SSL *s, int *mt);
|
---|
99 | __owur int tls_get_message_body(SSL *s, size_t *len);
|
---|
100 | __owur int dtls_get_message(SSL *s, int *mt);
|
---|
101 | __owur int dtls_get_message_body(SSL *s, size_t *len);
|
---|
102 |
|
---|
103 | /* Message construction and processing functions */
|
---|
104 | __owur int tls_process_initial_server_flight(SSL *s);
|
---|
105 | __owur MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt);
|
---|
106 | __owur MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt);
|
---|
107 | __owur int tls_construct_change_cipher_spec(SSL *s, WPACKET *pkt);
|
---|
108 | __owur int dtls_construct_change_cipher_spec(SSL *s, WPACKET *pkt);
|
---|
109 |
|
---|
110 | __owur int tls_construct_finished(SSL *s, WPACKET *pkt);
|
---|
111 | __owur int tls_construct_key_update(SSL *s, WPACKET *pkt);
|
---|
112 | __owur MSG_PROCESS_RETURN tls_process_key_update(SSL *s, PACKET *pkt);
|
---|
113 | __owur WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst, int clearbufs,
|
---|
114 | int stop);
|
---|
115 | __owur WORK_STATE dtls_wait_for_dry(SSL *s);
|
---|
116 |
|
---|
117 | /* some client-only functions */
|
---|
118 | __owur int tls_construct_client_hello(SSL *s, WPACKET *pkt);
|
---|
119 | __owur MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt);
|
---|
120 | __owur MSG_PROCESS_RETURN tls_process_certificate_request(SSL *s, PACKET *pkt);
|
---|
121 | __owur MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt);
|
---|
122 | __owur int tls_process_cert_status_body(SSL *s, PACKET *pkt);
|
---|
123 | __owur MSG_PROCESS_RETURN tls_process_cert_status(SSL *s, PACKET *pkt);
|
---|
124 | __owur MSG_PROCESS_RETURN tls_process_server_done(SSL *s, PACKET *pkt);
|
---|
125 | __owur int tls_construct_cert_verify(SSL *s, WPACKET *pkt);
|
---|
126 | __owur WORK_STATE tls_prepare_client_certificate(SSL *s, WORK_STATE wst);
|
---|
127 | __owur int tls_construct_client_certificate(SSL *s, WPACKET *pkt);
|
---|
128 | __owur int ssl_do_client_cert_cb(SSL *s, X509 **px509, EVP_PKEY **ppkey);
|
---|
129 | __owur int tls_construct_client_key_exchange(SSL *s, WPACKET *pkt);
|
---|
130 | __owur int tls_client_key_exchange_post_work(SSL *s);
|
---|
131 | __owur int tls_construct_cert_status_body(SSL *s, WPACKET *pkt);
|
---|
132 | __owur int tls_construct_cert_status(SSL *s, WPACKET *pkt);
|
---|
133 | __owur MSG_PROCESS_RETURN tls_process_key_exchange(SSL *s, PACKET *pkt);
|
---|
134 | __owur MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt);
|
---|
135 | __owur WORK_STATE tls_post_process_server_certificate(SSL *s, WORK_STATE wst);
|
---|
136 | __owur int ssl3_check_cert_and_algorithm(SSL *s);
|
---|
137 | #ifndef OPENSSL_NO_NEXTPROTONEG
|
---|
138 | __owur int tls_construct_next_proto(SSL *s, WPACKET *pkt);
|
---|
139 | #endif
|
---|
140 | __owur MSG_PROCESS_RETURN tls_process_hello_req(SSL *s, PACKET *pkt);
|
---|
141 | __owur MSG_PROCESS_RETURN dtls_process_hello_verify(SSL *s, PACKET *pkt);
|
---|
142 | __owur int tls_construct_end_of_early_data(SSL *s, WPACKET *pkt);
|
---|
143 |
|
---|
144 | /* some server-only functions */
|
---|
145 | __owur MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt);
|
---|
146 | __owur WORK_STATE tls_post_process_client_hello(SSL *s, WORK_STATE wst);
|
---|
147 | __owur int tls_construct_server_hello(SSL *s, WPACKET *pkt);
|
---|
148 | __owur int dtls_construct_hello_verify_request(SSL *s, WPACKET *pkt);
|
---|
149 | __owur int tls_construct_server_certificate(SSL *s, WPACKET *pkt);
|
---|
150 | __owur int tls_construct_server_key_exchange(SSL *s, WPACKET *pkt);
|
---|
151 | __owur int tls_construct_certificate_request(SSL *s, WPACKET *pkt);
|
---|
152 | __owur int tls_construct_server_done(SSL *s, WPACKET *pkt);
|
---|
153 | __owur MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt);
|
---|
154 | __owur MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, PACKET *pkt);
|
---|
155 | __owur WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE wst);
|
---|
156 | __owur MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt);
|
---|
157 | #ifndef OPENSSL_NO_NEXTPROTONEG
|
---|
158 | __owur MSG_PROCESS_RETURN tls_process_next_proto(SSL *s, PACKET *pkt);
|
---|
159 | #endif
|
---|
160 | __owur int tls_construct_new_session_ticket(SSL *s, WPACKET *pkt);
|
---|
161 | MSG_PROCESS_RETURN tls_process_end_of_early_data(SSL *s, PACKET *pkt);
|
---|
162 |
|
---|
163 | #ifndef OPENSSL_NO_GOST
|
---|
164 | /* These functions are used in GOST18 CKE, both for client and server */
|
---|
165 | int ossl_gost18_cke_cipher_nid(const SSL *s);
|
---|
166 | int ossl_gost_ukm(const SSL *s, unsigned char *dgst_buf);
|
---|
167 | #endif
|
---|
168 |
|
---|
169 | /* Extension processing */
|
---|
170 |
|
---|
171 | typedef enum ext_return_en {
|
---|
172 | EXT_RETURN_FAIL,
|
---|
173 | EXT_RETURN_SENT,
|
---|
174 | EXT_RETURN_NOT_SENT
|
---|
175 | } EXT_RETURN;
|
---|
176 |
|
---|
177 | __owur int tls_validate_all_contexts(SSL *s, unsigned int thisctx,
|
---|
178 | RAW_EXTENSION *exts);
|
---|
179 | __owur int extension_is_relevant(SSL *s, unsigned int extctx,
|
---|
180 | unsigned int thisctx);
|
---|
181 | __owur int tls_collect_extensions(SSL *s, PACKET *packet, unsigned int context,
|
---|
182 | RAW_EXTENSION **res, size_t *len, int init);
|
---|
183 | __owur int tls_parse_extension(SSL *s, TLSEXT_INDEX idx, int context,
|
---|
184 | RAW_EXTENSION *exts, X509 *x, size_t chainidx);
|
---|
185 | __owur int tls_parse_all_extensions(SSL *s, int context, RAW_EXTENSION *exts,
|
---|
186 | X509 *x, size_t chainidx, int fin);
|
---|
187 | __owur int should_add_extension(SSL *s, unsigned int extctx,
|
---|
188 | unsigned int thisctx, int max_version);
|
---|
189 | __owur int tls_construct_extensions(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
190 | X509 *x, size_t chainidx);
|
---|
191 |
|
---|
192 | __owur int tls_psk_do_binder(SSL *s, const EVP_MD *md,
|
---|
193 | const unsigned char *msgstart,
|
---|
194 | size_t binderoffset, const unsigned char *binderin,
|
---|
195 | unsigned char *binderout,
|
---|
196 | SSL_SESSION *sess, int sign, int external);
|
---|
197 |
|
---|
198 | /* Server Extension processing */
|
---|
199 | int tls_parse_ctos_renegotiate(SSL *s, PACKET *pkt, unsigned int context,
|
---|
200 | X509 *x, size_t chainidx);
|
---|
201 | int tls_parse_ctos_server_name(SSL *s, PACKET *pkt, unsigned int context,
|
---|
202 | X509 *x, size_t chainidx);
|
---|
203 | int tls_parse_ctos_maxfragmentlen(SSL *s, PACKET *pkt, unsigned int context,
|
---|
204 | X509 *x, size_t chainidx);
|
---|
205 | #ifndef OPENSSL_NO_SRP
|
---|
206 | int tls_parse_ctos_srp(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
207 | size_t chainidx);
|
---|
208 | #endif
|
---|
209 | int tls_parse_ctos_early_data(SSL *s, PACKET *pkt, unsigned int context,
|
---|
210 | X509 *x, size_t chainidx);
|
---|
211 | int tls_parse_ctos_ec_pt_formats(SSL *s, PACKET *pkt, unsigned int context,
|
---|
212 | X509 *x, size_t chainidx);
|
---|
213 | int tls_parse_ctos_supported_groups(SSL *s, PACKET *pkt, unsigned int context,
|
---|
214 | X509 *x, size_t chainidxl);
|
---|
215 | int tls_parse_ctos_session_ticket(SSL *s, PACKET *pkt, unsigned int context,
|
---|
216 | X509 *x, size_t chainidx);
|
---|
217 | int tls_parse_ctos_sig_algs_cert(SSL *s, PACKET *pkt, unsigned int context,
|
---|
218 | X509 *x, size_t chainidx);
|
---|
219 | int tls_parse_ctos_sig_algs(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
220 | size_t chainidx);
|
---|
221 | #ifndef OPENSSL_NO_OCSP
|
---|
222 | int tls_parse_ctos_status_request(SSL *s, PACKET *pkt, unsigned int context,
|
---|
223 | X509 *x, size_t chainidx);
|
---|
224 | #endif
|
---|
225 | #ifndef OPENSSL_NO_NEXTPROTONEG
|
---|
226 | int tls_parse_ctos_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
227 | size_t chainidx);
|
---|
228 | #endif
|
---|
229 | int tls_parse_ctos_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
230 | size_t chainidx);
|
---|
231 | #ifndef OPENSSL_NO_SRTP
|
---|
232 | int tls_parse_ctos_use_srtp(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
233 | size_t chainidx);
|
---|
234 | #endif
|
---|
235 | int tls_parse_ctos_etm(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
236 | size_t chainidx);
|
---|
237 | int tls_parse_ctos_key_share(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
238 | size_t chainidx);
|
---|
239 | int tls_parse_ctos_cookie(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
240 | size_t chainidx);
|
---|
241 | int tls_parse_ctos_ems(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
242 | size_t chainidx);
|
---|
243 | int tls_parse_ctos_psk_kex_modes(SSL *s, PACKET *pkt, unsigned int context,
|
---|
244 | X509 *x, size_t chainidx);
|
---|
245 | int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
246 | size_t chainidx);
|
---|
247 | int tls_parse_ctos_post_handshake_auth(SSL *, PACKET *pkt, unsigned int context,
|
---|
248 | X509 *x, size_t chainidx);
|
---|
249 |
|
---|
250 | EXT_RETURN tls_construct_stoc_renegotiate(SSL *s, WPACKET *pkt,
|
---|
251 | unsigned int context, X509 *x,
|
---|
252 | size_t chainidx);
|
---|
253 | EXT_RETURN tls_construct_stoc_server_name(SSL *s, WPACKET *pkt,
|
---|
254 | unsigned int context, X509 *x,
|
---|
255 | size_t chainidx);
|
---|
256 | EXT_RETURN tls_construct_stoc_early_data(SSL *s, WPACKET *pkt,
|
---|
257 | unsigned int context, X509 *x,
|
---|
258 | size_t chainidx);
|
---|
259 | EXT_RETURN tls_construct_stoc_maxfragmentlen(SSL *s, WPACKET *pkt,
|
---|
260 | unsigned int context, X509 *x,
|
---|
261 | size_t chainidx);
|
---|
262 | EXT_RETURN tls_construct_stoc_ec_pt_formats(SSL *s, WPACKET *pkt,
|
---|
263 | unsigned int context, X509 *x,
|
---|
264 | size_t chainidx);
|
---|
265 | EXT_RETURN tls_construct_stoc_supported_groups(SSL *s, WPACKET *pkt,
|
---|
266 | unsigned int context, X509 *x,
|
---|
267 | size_t chainidx);
|
---|
268 | EXT_RETURN tls_construct_stoc_session_ticket(SSL *s, WPACKET *pkt,
|
---|
269 | unsigned int context, X509 *x,
|
---|
270 | size_t chainidx);
|
---|
271 | #ifndef OPENSSL_NO_OCSP
|
---|
272 | EXT_RETURN tls_construct_stoc_status_request(SSL *s, WPACKET *pkt,
|
---|
273 | unsigned int context, X509 *x,
|
---|
274 | size_t chainidx);
|
---|
275 | #endif
|
---|
276 | #ifndef OPENSSL_NO_NEXTPROTONEG
|
---|
277 | EXT_RETURN tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt,
|
---|
278 | unsigned int context, X509 *x,
|
---|
279 | size_t chainidx);
|
---|
280 | #endif
|
---|
281 | EXT_RETURN tls_construct_stoc_alpn(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
282 | X509 *x, size_t chainidx);
|
---|
283 | #ifndef OPENSSL_NO_SRTP
|
---|
284 | EXT_RETURN tls_construct_stoc_use_srtp(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
285 | X509 *x, size_t chainidx);
|
---|
286 | #endif
|
---|
287 | EXT_RETURN tls_construct_stoc_etm(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
288 | X509 *x, size_t chainidx);
|
---|
289 | EXT_RETURN tls_construct_stoc_ems(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
290 | X509 *x, size_t chainidx);
|
---|
291 | EXT_RETURN tls_construct_stoc_supported_versions(SSL *s, WPACKET *pkt,
|
---|
292 | unsigned int context, X509 *x,
|
---|
293 | size_t chainidx);
|
---|
294 | EXT_RETURN tls_construct_stoc_key_share(SSL *s, WPACKET *pkt,
|
---|
295 | unsigned int context, X509 *x,
|
---|
296 | size_t chainidx);
|
---|
297 | EXT_RETURN tls_construct_stoc_cookie(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
298 | X509 *x, size_t chainidx);
|
---|
299 | /*
|
---|
300 | * Not in public headers as this is not an official extension. Only used when
|
---|
301 | * SSL_OP_CRYPTOPRO_TLSEXT_BUG is set.
|
---|
302 | */
|
---|
303 | #define TLSEXT_TYPE_cryptopro_bug 0xfde8
|
---|
304 | EXT_RETURN tls_construct_stoc_cryptopro_bug(SSL *s, WPACKET *pkt,
|
---|
305 | unsigned int context, X509 *x,
|
---|
306 | size_t chainidx);
|
---|
307 | EXT_RETURN tls_construct_stoc_psk(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
308 | X509 *x, size_t chainidx);
|
---|
309 |
|
---|
310 | /* Client Extension processing */
|
---|
311 | EXT_RETURN tls_construct_ctos_renegotiate(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
312 | X509 *x, size_t chainidx);
|
---|
313 | EXT_RETURN tls_construct_ctos_server_name(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
314 | X509 *x, size_t chainidx);
|
---|
315 | EXT_RETURN tls_construct_ctos_maxfragmentlen(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
316 | X509 *x, size_t chainidx);
|
---|
317 | #ifndef OPENSSL_NO_SRP
|
---|
318 | EXT_RETURN tls_construct_ctos_srp(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
|
---|
319 | size_t chainidx);
|
---|
320 | #endif
|
---|
321 | EXT_RETURN tls_construct_ctos_ec_pt_formats(SSL *s, WPACKET *pkt,
|
---|
322 | unsigned int context, X509 *x,
|
---|
323 | size_t chainidx);
|
---|
324 | EXT_RETURN tls_construct_ctos_supported_groups(SSL *s, WPACKET *pkt,
|
---|
325 | unsigned int context, X509 *x,
|
---|
326 | size_t chainidx);
|
---|
327 |
|
---|
328 | EXT_RETURN tls_construct_ctos_early_data(SSL *s, WPACKET *pkt,
|
---|
329 | unsigned int context, X509 *x,
|
---|
330 | size_t chainidx);
|
---|
331 | EXT_RETURN tls_construct_ctos_session_ticket(SSL *s, WPACKET *pkt,
|
---|
332 | unsigned int context, X509 *x,
|
---|
333 | size_t chainidx);
|
---|
334 | EXT_RETURN tls_construct_ctos_sig_algs(SSL *s, WPACKET *pkt,
|
---|
335 | unsigned int context, X509 *x,
|
---|
336 | size_t chainidx);
|
---|
337 | #ifndef OPENSSL_NO_OCSP
|
---|
338 | EXT_RETURN tls_construct_ctos_status_request(SSL *s, WPACKET *pkt,
|
---|
339 | unsigned int context, X509 *x,
|
---|
340 | size_t chainidx);
|
---|
341 | #endif
|
---|
342 | #ifndef OPENSSL_NO_NEXTPROTONEG
|
---|
343 | EXT_RETURN tls_construct_ctos_npn(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
344 | X509 *x, size_t chainidx);
|
---|
345 | #endif
|
---|
346 | EXT_RETURN tls_construct_ctos_alpn(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
347 | X509 *x, size_t chainidx);
|
---|
348 | #ifndef OPENSSL_NO_SRTP
|
---|
349 | EXT_RETURN tls_construct_ctos_use_srtp(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
350 | X509 *x, size_t chainidx);
|
---|
351 | #endif
|
---|
352 | EXT_RETURN tls_construct_ctos_etm(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
353 | X509 *x, size_t chainidx);
|
---|
354 | #ifndef OPENSSL_NO_CT
|
---|
355 | EXT_RETURN tls_construct_ctos_sct(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
356 | X509 *x, size_t chainidx);
|
---|
357 | #endif
|
---|
358 | EXT_RETURN tls_construct_ctos_ems(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
359 | X509 *x, size_t chainidx);
|
---|
360 | EXT_RETURN tls_construct_ctos_supported_versions(SSL *s, WPACKET *pkt,
|
---|
361 | unsigned int context, X509 *x,
|
---|
362 | size_t chainidx);
|
---|
363 | EXT_RETURN tls_construct_ctos_key_share(SSL *s, WPACKET *pkt,
|
---|
364 | unsigned int context, X509 *x,
|
---|
365 | size_t chainidx);
|
---|
366 | EXT_RETURN tls_construct_ctos_psk_kex_modes(SSL *s, WPACKET *pkt,
|
---|
367 | unsigned int context, X509 *x,
|
---|
368 | size_t chainidx);
|
---|
369 | EXT_RETURN tls_construct_ctos_cookie(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
370 | X509 *x, size_t chainidx);
|
---|
371 | EXT_RETURN tls_construct_ctos_padding(SSL *s, WPACKET *pkt,
|
---|
372 | unsigned int context, X509 *x,
|
---|
373 | size_t chainidx);
|
---|
374 | EXT_RETURN tls_construct_ctos_psk(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
375 | X509 *x, size_t chainidx);
|
---|
376 | EXT_RETURN tls_construct_ctos_post_handshake_auth(SSL *s, WPACKET *pkt, unsigned int context,
|
---|
377 | X509 *x, size_t chainidx);
|
---|
378 |
|
---|
379 | int tls_parse_stoc_renegotiate(SSL *s, PACKET *pkt, unsigned int context,
|
---|
380 | X509 *x, size_t chainidx);
|
---|
381 | int tls_parse_stoc_server_name(SSL *s, PACKET *pkt, unsigned int context,
|
---|
382 | X509 *x, size_t chainidx);
|
---|
383 | int tls_parse_stoc_early_data(SSL *s, PACKET *pkt, unsigned int context,
|
---|
384 | X509 *x, size_t chainidx);
|
---|
385 | int tls_parse_stoc_maxfragmentlen(SSL *s, PACKET *pkt, unsigned int context,
|
---|
386 | X509 *x, size_t chainidx);
|
---|
387 | int tls_parse_stoc_ec_pt_formats(SSL *s, PACKET *pkt, unsigned int context,
|
---|
388 | X509 *x, size_t chainidx);
|
---|
389 | int tls_parse_stoc_session_ticket(SSL *s, PACKET *pkt, unsigned int context,
|
---|
390 | X509 *x, size_t chainidx);
|
---|
391 | #ifndef OPENSSL_NO_OCSP
|
---|
392 | int tls_parse_stoc_status_request(SSL *s, PACKET *pkt, unsigned int context,
|
---|
393 | X509 *x, size_t chainidx);
|
---|
394 | #endif
|
---|
395 | #ifndef OPENSSL_NO_CT
|
---|
396 | int tls_parse_stoc_sct(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
397 | size_t chainidx);
|
---|
398 | #endif
|
---|
399 | #ifndef OPENSSL_NO_NEXTPROTONEG
|
---|
400 | int tls_parse_stoc_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
401 | size_t chainidx);
|
---|
402 | #endif
|
---|
403 | int tls_parse_stoc_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
404 | size_t chainidx);
|
---|
405 | #ifndef OPENSSL_NO_SRTP
|
---|
406 | int tls_parse_stoc_use_srtp(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
407 | size_t chainidx);
|
---|
408 | #endif
|
---|
409 | int tls_parse_stoc_etm(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
410 | size_t chainidx);
|
---|
411 | int tls_parse_stoc_ems(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
412 | size_t chainidx);
|
---|
413 | int tls_parse_stoc_supported_versions(SSL *s, PACKET *pkt, unsigned int context,
|
---|
414 | X509 *x, size_t chainidx);
|
---|
415 | int tls_parse_stoc_key_share(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
416 | size_t chainidx);
|
---|
417 | int tls_parse_stoc_cookie(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
418 | size_t chainidx);
|
---|
419 | int tls_parse_stoc_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
---|
420 | size_t chainidx);
|
---|
421 |
|
---|
422 | int tls_handle_alpn(SSL *s);
|
---|
423 |
|
---|
424 | int tls13_save_handshake_digest_for_pha(SSL *s);
|
---|
425 | int tls13_restore_handshake_digest_for_pha(SSL *s);
|
---|