statem_locl.h 19.5 KB
Newer Older
R
Rich Salz 已提交
1 2
/*
 * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
M
Matt Caswell 已提交
3
 *
R
Rich Salz 已提交
4 5 6 7
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
M
Matt Caswell 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20 21
 */

/*****************************************************************************
 *                                                                           *
 * The following definitions are PRIVATE to the state machine. They should   *
 * NOT be used outside of the state machine.                                 *
 *                                                                           *
 *****************************************************************************/

/* Max message length definitions */

/* The spec allows for a longer length than this, but we limit it */
#define HELLO_VERIFY_REQUEST_MAX_LENGTH 258
#define SERVER_HELLO_MAX_LENGTH         20000
22
#define HELLO_RETRY_REQUEST_MAX_LENGTH  20000
M
Matt Caswell 已提交
23
#define ENCRYPTED_EXTENSIONS_MAX_LENGTH 20000
M
Matt Caswell 已提交
24 25
#define SERVER_KEY_EXCH_MAX_LENGTH      102400
#define SERVER_HELLO_DONE_MAX_LENGTH    0
26
#define KEY_UPDATE_MAX_LENGTH           1
M
Matt Caswell 已提交
27 28 29 30
#define CCS_MAX_LENGTH                  1
/* Max should actually be 36 but we are generous */
#define FINISHED_MAX_LENGTH             64

M
Matt Caswell 已提交
31 32 33
/* The maximum number of incoming KeyUpdate messages we will accept */
#define MAX_KEY_UPDATE_MESSAGES     32

34
/* Extension context codes */
35
/* This extension is only allowed in TLS */
36
#define EXT_TLS_ONLY                        0x0001
37
/* This extension is only allowed in DTLS */
38 39 40 41 42
#define EXT_DTLS_ONLY                       0x0002
/* Some extensions may be allowed in DTLS but we don't implement them for it */
#define EXT_TLS_IMPLEMENTATION_ONLY         0x0004
/* Most extensions are not defined for SSLv3 but EXT_TYPE_renegotiate is */
#define EXT_SSL3_ALLOWED                    0x0008
43
/* Extension is only defined for TLS1.2 and above */
44
#define EXT_TLS1_2_AND_BELOW_ONLY           0x0010
45
/* Extension is only defined for TLS1.3 and above */
46 47
#define EXT_TLS1_3_ONLY                     0x0020
#define EXT_CLIENT_HELLO                    0x0040
48
/* Really means TLS1.2 or below */
49 50 51 52 53 54
#define EXT_TLS1_2_SERVER_HELLO             0x0080
#define EXT_TLS1_3_SERVER_HELLO             0x0100
#define EXT_TLS1_3_ENCRYPTED_EXTENSIONS     0x0200
#define EXT_TLS1_3_HELLO_RETRY_REQUEST      0x0400
#define EXT_TLS1_3_CERTIFICATE              0x0800
#define EXT_TLS1_3_NEW_SESSION_TICKET       0x1000
55

56 57 58
/* Dummy message type */
#define SSL3_MT_DUMMY   -1

M
Matt Caswell 已提交
59
/* Message processing return codes */
M
Matt Caswell 已提交
60
typedef enum {
M
Matt Caswell 已提交
61 62 63 64 65 66 67 68 69 70 71
    /* Something bad happened */
    MSG_PROCESS_ERROR,
    /* We've finished reading - swap to writing */
    MSG_PROCESS_FINISHED_READING,
    /*
     * We've completed the main processing of this message but there is some
     * post processing to be done.
     */
    MSG_PROCESS_CONTINUE_PROCESSING,
    /* We've finished this message - read the next message */
    MSG_PROCESS_CONTINUE_READING
M
Matt Caswell 已提交
72
} MSG_PROCESS_RETURN;
M
Matt Caswell 已提交
73 74 75 76

/* Flush the write BIO */
int statem_flush(SSL *s);

77 78
typedef int (*confunc_f) (SSL *s, WPACKET *pkt);

79 80 81
int check_in_list(SSL *s, unsigned int group_id, const unsigned char *groups,
                  size_t num_groups, int checkallow);

M
Matt Caswell 已提交
82 83 84
/*
 * TLS/DTLS client state machine functions
 */
85 86 87 88
int ossl_statem_client_read_transition(SSL *s, int mt);
WRITE_TRAN ossl_statem_client_write_transition(SSL *s);
WORK_STATE ossl_statem_client_pre_work(SSL *s, WORK_STATE wst);
WORK_STATE ossl_statem_client_post_work(SSL *s, WORK_STATE wst);
89
int ossl_statem_client_construct_message(SSL *s, WPACKET *pkt,
90
                                         confunc_f *confunc, int *mt);
91
size_t ossl_statem_client_max_message_size(SSL *s);
92 93
MSG_PROCESS_RETURN ossl_statem_client_process_message(SSL *s, PACKET *pkt);
WORK_STATE ossl_statem_client_post_process_message(SSL *s, WORK_STATE wst);
M
Matt Caswell 已提交
94 95 96 97

/*
 * TLS/DTLS server state machine functions
 */
98 99 100 101
int ossl_statem_server_read_transition(SSL *s, int mt);
WRITE_TRAN ossl_statem_server_write_transition(SSL *s);
WORK_STATE ossl_statem_server_pre_work(SSL *s, WORK_STATE wst);
WORK_STATE ossl_statem_server_post_work(SSL *s, WORK_STATE wst);
102
int ossl_statem_server_construct_message(SSL *s, WPACKET *pkt,
103
                                         confunc_f *confunc,int *mt);
104
size_t ossl_statem_server_max_message_size(SSL *s);
105 106
MSG_PROCESS_RETURN ossl_statem_server_process_message(SSL *s, PACKET *pkt);
WORK_STATE ossl_statem_server_post_process_message(SSL *s, WORK_STATE wst);
M
Matt Caswell 已提交
107 108 109

/* Functions for getting new message data */
__owur int tls_get_message_header(SSL *s, int *mt);
110 111
__owur int tls_get_message_body(SSL *s, size_t *len);
__owur int dtls_get_message(SSL *s, int *mt, size_t *len);
M
Matt Caswell 已提交
112 113

/* Message construction and processing functions */
114
__owur int tls_process_initial_server_flight(SSL *s, int *al);
M
Matt Caswell 已提交
115 116
__owur MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt);
__owur MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt);
117 118
__owur int tls_construct_change_cipher_spec(SSL *s, WPACKET *pkt);
__owur int dtls_construct_change_cipher_spec(SSL *s, WPACKET *pkt);
M
Matt Caswell 已提交
119

120
__owur int tls_construct_finished(SSL *s, WPACKET *pkt);
121
__owur int tls_construct_key_update(SSL *s, WPACKET *pkt);
122
__owur MSG_PROCESS_RETURN tls_process_key_update(SSL *s, PACKET *pkt);
123
__owur WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst, int clearbufs);
M
Matt Caswell 已提交
124
__owur WORK_STATE dtls_wait_for_dry(SSL *s);
M
Matt Caswell 已提交
125 126

/* some client-only functions */
127
__owur int tls_construct_client_hello(SSL *s, WPACKET *pkt);
M
Matt Caswell 已提交
128 129 130
__owur MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt);
__owur MSG_PROCESS_RETURN tls_process_certificate_request(SSL *s, PACKET *pkt);
__owur MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt);
131
__owur int tls_process_cert_status_body(SSL *s, PACKET *pkt, int *al);
M
Matt Caswell 已提交
132 133
__owur MSG_PROCESS_RETURN tls_process_cert_status(SSL *s, PACKET *pkt);
__owur MSG_PROCESS_RETURN tls_process_server_done(SSL *s, PACKET *pkt);
134
__owur int tls_construct_cert_verify(SSL *s, WPACKET *pkt);
M
Matt Caswell 已提交
135
__owur WORK_STATE tls_prepare_client_certificate(SSL *s, WORK_STATE wst);
136
__owur int tls_construct_client_certificate(SSL *s, WPACKET *pkt);
M
Matt Caswell 已提交
137
__owur int ssl_do_client_cert_cb(SSL *s, X509 **px509, EVP_PKEY **ppkey);
138
__owur int tls_construct_client_key_exchange(SSL *s, WPACKET *pkt);
M
Matt Caswell 已提交
139
__owur int tls_client_key_exchange_post_work(SSL *s);
140
__owur int tls_construct_cert_status_body(SSL *s, WPACKET *pkt);
141
__owur int tls_construct_cert_status(SSL *s, WPACKET *pkt);
E
Emilia Kasper 已提交
142
__owur MSG_PROCESS_RETURN tls_process_key_exchange(SSL *s, PACKET *pkt);
M
Matt Caswell 已提交
143
__owur MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt);
M
Matt Caswell 已提交
144
__owur int ssl3_check_cert_and_algorithm(SSL *s);
E
Emilia Kasper 已提交
145
#ifndef OPENSSL_NO_NEXTPROTONEG
146
__owur int tls_construct_next_proto(SSL *s, WPACKET *pkt);
E
Emilia Kasper 已提交
147
#endif
148
__owur MSG_PROCESS_RETURN tls_process_hello_req(SSL *s, PACKET *pkt);
M
Matt Caswell 已提交
149
__owur MSG_PROCESS_RETURN dtls_process_hello_verify(SSL *s, PACKET *pkt);
M
Matt Caswell 已提交
150 151

/* some server-only functions */
M
Matt Caswell 已提交
152 153
__owur MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt);
__owur WORK_STATE tls_post_process_client_hello(SSL *s, WORK_STATE wst);
154 155 156 157 158 159
__owur int tls_construct_server_hello(SSL *s, WPACKET *pkt);
__owur int dtls_construct_hello_verify_request(SSL *s, WPACKET *pkt);
__owur int tls_construct_server_certificate(SSL *s, WPACKET *pkt);
__owur int tls_construct_server_key_exchange(SSL *s, WPACKET *pkt);
__owur int tls_construct_certificate_request(SSL *s, WPACKET *pkt);
__owur int tls_construct_server_done(SSL *s, WPACKET *pkt);
M
Matt Caswell 已提交
160 161 162 163
__owur MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt);
__owur MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, PACKET *pkt);
__owur WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE wst);
__owur MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt);
E
Emilia Kasper 已提交
164
#ifndef OPENSSL_NO_NEXTPROTONEG
M
Matt Caswell 已提交
165
__owur MSG_PROCESS_RETURN tls_process_next_proto(SSL *s, PACKET *pkt);
E
Emilia Kasper 已提交
166
#endif
167
__owur int tls_construct_new_session_ticket(SSL *s, WPACKET *pkt);
168

169 170 171 172

/* Extension processing */

__owur int tls_collect_extensions(SSL *s, PACKET *packet, unsigned int context,
173
                                  RAW_EXTENSION **res, int *al, size_t *len);
174
__owur int tls_parse_extension(SSL *s, TLSEXT_INDEX idx, int context,
175
                               RAW_EXTENSION *exts,  X509 *x, size_t chainidx,
176
                               int *al);
M
Matt Caswell 已提交
177
__owur int tls_parse_all_extensions(SSL *s, int context, RAW_EXTENSION *exts,
178
                                    X509 *x, size_t chainidx, int *al);
M
Matt Caswell 已提交
179
__owur int tls_construct_extensions(SSL *s, WPACKET *pkt, unsigned int context,
180
                                    X509 *x, size_t chainidx, int *al);
181

182 183 184 185 186 187
__owur int tls_psk_do_binder(SSL *s, const EVP_MD *md,
                             const unsigned char *msgstart,
                             size_t binderoffset, const unsigned char *binderin,
                             unsigned char *binderout,
                             SSL_SESSION *sess, int sign);

188
/* Server Extension processing */
189 190 191 192
int tls_parse_ctos_renegotiate(SSL *s, PACKET *pkt, unsigned int context,
                               X509 *x, size_t chainidx, int *al);
int tls_parse_ctos_server_name(SSL *s, PACKET *pkt, unsigned int context,
                               X509 *x, size_t chainidx, int *al);
193
#ifndef OPENSSL_NO_SRP
194 195
int tls_parse_ctos_srp(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);
196
#endif
M
Matt Caswell 已提交
197 198
int tls_parse_ctos_early_data(SSL *s, PACKET *pkt, unsigned int context,
                              X509 *x, size_t chainidx, int *al);
199
#ifndef OPENSSL_NO_EC
200 201 202 203
int tls_parse_ctos_ec_pt_formats(SSL *s, PACKET *pkt, unsigned int context,
                                 X509 *x, size_t chainidx, int *al);
int tls_parse_ctos_supported_groups(SSL *s, PACKET *pkt, unsigned int context,
                                    X509 *x, size_t chainidx, int *al);
204
#endif
205 206 207 208
int tls_parse_ctos_session_ticket(SSL *s, PACKET *pkt, unsigned int context,
                                  X509 *x, size_t chainidx, int *al);
int tls_parse_ctos_sig_algs(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                            size_t chainidx, int *al);
209
#ifndef OPENSSL_NO_OCSP
210 211
int tls_parse_ctos_status_request(SSL *s, PACKET *pkt, unsigned int context,
                                  X509 *x, size_t chainidx, int *al);
212
#endif
213
#ifndef OPENSSL_NO_NEXTPROTONEG
214 215
int tls_parse_ctos_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);
216
#endif
217 218
int tls_parse_ctos_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                        size_t chainidx, int *al);
219
#ifndef OPENSSL_NO_SRTP
220 221
int tls_parse_ctos_use_srtp(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                            size_t chainidx, int *al);
222
#endif
223 224 225 226 227 228 229 230 231 232
int tls_parse_ctos_etm(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);
int tls_parse_ctos_key_share(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                             size_t chainidx, int *al);
int tls_parse_ctos_ems(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);
int tls_parse_ctos_psk_kex_modes(SSL *s, PACKET *pkt, unsigned int context,
                                 X509 *x, size_t chainidx, int *al);
int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);
233

234 235 236 237
int tls_construct_stoc_renegotiate(SSL *s, WPACKET *pkt, unsigned int context,
                                   X509 *x, size_t chainidx, int *al);
int tls_construct_stoc_server_name(SSL *s, WPACKET *pkt, unsigned int context,
                                   X509 *x, size_t chainidx, int *al);
238 239 240
int tls_construct_stoc_early_data_info(SSL *s, WPACKET *pkt,
                                       unsigned int context, X509 *x,
                                       size_t chainidx, int *al);
241 242
int tls_construct_stoc_early_data(SSL *s, WPACKET *pkt, unsigned int context,
                                  X509 *x, size_t chainidx, int *al);
243
#ifndef OPENSSL_NO_EC
244 245
int tls_construct_stoc_ec_pt_formats(SSL *s, WPACKET *pkt, unsigned int context,
                                     X509 *x, size_t chainidx, int *al);
246
#endif
247 248
int tls_construct_stoc_session_ticket(SSL *s, WPACKET *pkt,
                                      unsigned int context, X509 *x,
249
                                      size_t chainidx, int *al);
250
#ifndef OPENSSL_NO_OCSP
251 252
int tls_construct_stoc_status_request(SSL *s, WPACKET *pkt,
                                      unsigned int context, X509 *x,
253
                                      size_t chainidx, int *al);
254 255
#endif
#ifndef OPENSSL_NO_NEXTPROTONEG
256 257
int tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt,
                                      unsigned int context, X509 *x,
258
                                      size_t chainidx, int *al);
259
#endif
260 261
int tls_construct_stoc_alpn(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                            size_t chainidx, int *al);
262
#ifndef OPENSSL_NO_SRTP
263 264
int tls_construct_stoc_use_srtp(SSL *s, WPACKET *pkt, unsigned int context,
                                X509 *x, size_t chainidx, int *al);
265
#endif
266 267 268 269 270 271
int tls_construct_stoc_etm(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                           size_t chainidx, int *al);
int tls_construct_stoc_ems(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                           size_t chainidx, int *al);
int tls_construct_stoc_key_share(SSL *s, WPACKET *pkt, unsigned int context,
                                 X509 *x, size_t chainidx, int *al);
272 273 274 275 276
/*
 * Not in public headers as this is not an official extension. Only used when
 * SSL_OP_CRYPTOPRO_TLSEXT_BUG is set.
 */
#define TLSEXT_TYPE_cryptopro_bug      0xfde8
277 278 279 280
int tls_construct_stoc_cryptopro_bug(SSL *s, WPACKET *pkt, unsigned int context,
                                     X509 *x, size_t chainidx, int *al);
int tls_construct_stoc_psk(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                           size_t chainidx, int *al);
281 282

/* Client Extension processing */
283 284 285 286
int tls_construct_ctos_renegotiate(SSL *s, WPACKET *pkt, unsigned int context,
                                   X509 *x, size_t chainidx, int *al);
int tls_construct_ctos_server_name(SSL *s, WPACKET *pkt, unsigned int context,
                                   X509 *x, size_t chainidx, int *al);
287
#ifndef OPENSSL_NO_SRP
288 289
int tls_construct_ctos_srp(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                           size_t chainidx, int *al);
290 291
#endif
#ifndef OPENSSL_NO_EC
292 293 294 295
int tls_construct_ctos_ec_pt_formats(SSL *s, WPACKET *pkt, unsigned int context,
                                     X509 *x, size_t chainidx, int *al);
int tls_construct_ctos_supported_groups(SSL *s, WPACKET *pkt,
                                        unsigned int context, X509 *x,
296
                                        size_t chainidx, int *al);
297
#endif
298 299
int tls_construct_ctos_early_data(SSL *s, WPACKET *pkt, unsigned int context,
                                  X509 *x, size_t chainidx, int *al);
300 301
int tls_construct_ctos_session_ticket(SSL *s, WPACKET *pkt,
                                      unsigned int context, X509 *x,
302
                                      size_t chainidx, int *al);
303 304
int tls_construct_ctos_sig_algs(SSL *s, WPACKET *pkt, unsigned int context,
                                X509 *x, size_t chainidx, int *al);
305
#ifndef OPENSSL_NO_OCSP
306 307
int tls_construct_ctos_status_request(SSL *s, WPACKET *pkt,
                                      unsigned int context, X509 *x,
308
                                      size_t chainidx, int *al);
309 310
#endif
#ifndef OPENSSL_NO_NEXTPROTONEG
311 312
int tls_construct_ctos_npn(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                           size_t chainidx, int *al);
313
#endif
314 315
int tls_construct_ctos_alpn(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                            size_t chainidx, int *al);
316
#ifndef OPENSSL_NO_SRTP
317 318
int tls_construct_ctos_use_srtp(SSL *s, WPACKET *pkt, unsigned int context,
                                X509 *x, size_t chainidx, int *al);
319
#endif
320 321
int tls_construct_ctos_etm(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                           size_t chainidx, int *al);
322
#ifndef OPENSSL_NO_CT
323 324
int tls_construct_ctos_sct(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                           size_t chainidx, int *al);
325
#endif
326 327 328 329
int tls_construct_ctos_ems(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                           size_t chainidx, int *al);
int tls_construct_ctos_supported_versions(SSL *s, WPACKET *pkt,
                                          unsigned int context, X509 *x,
330
                                          size_t chainidx, int *al);
331 332 333 334
int tls_construct_ctos_key_share(SSL *s, WPACKET *pkt, unsigned int context,
                                 X509 *x, size_t chainidx, int *al);
int tls_construct_ctos_psk_kex_modes(SSL *s, WPACKET *pkt, unsigned int context,
                                     X509 *x, size_t chainidx, int *al);
M
Matt Caswell 已提交
335 336
int tls_construct_ctos_cookie(SSL *s, WPACKET *pkt, unsigned int context,
                              X509 *x, size_t chainidx, int *al);
337 338 339 340 341 342 343 344
int tls_construct_ctos_padding(SSL *s, WPACKET *pkt, unsigned int context,
                               X509 *x, size_t chainidx, int *al);
int tls_construct_ctos_psk(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
                           size_t chainidx, int *al);
int tls_parse_stoc_renegotiate(SSL *s, PACKET *pkt, unsigned int context,
                               X509 *x, size_t chainidx, int *al);
int tls_parse_stoc_server_name(SSL *s, PACKET *pkt, unsigned int context,
                               X509 *x, size_t chainidx, int *al);
345 346
int tls_parse_stoc_early_data_info(SSL *s, PACKET *pkt, unsigned int context,
                              X509 *x, size_t chainidx, int *al);
347 348
int tls_parse_stoc_early_data(SSL *s, PACKET *pkt, unsigned int context,
                              X509 *x, size_t chainidx, int *al);
349
#ifndef OPENSSL_NO_EC
350 351
int tls_parse_stoc_ec_pt_formats(SSL *s, PACKET *pkt, unsigned int context,
                                 X509 *x, size_t chainidx, int *al);
352
#endif
353 354
int tls_parse_stoc_session_ticket(SSL *s, PACKET *pkt, unsigned int context,
                                  X509 *x, size_t chainidx, int *al);
355
#ifndef OPENSSL_NO_OCSP
356 357
int tls_parse_stoc_status_request(SSL *s, PACKET *pkt, unsigned int context,
                                  X509 *x, size_t chainidx, int *al);
358
#endif
359
#ifndef OPENSSL_NO_CT
360 361
int tls_parse_stoc_sct(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);
362 363
#endif
#ifndef OPENSSL_NO_NEXTPROTONEG
364 365
int tls_parse_stoc_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);
366
#endif
367 368
int tls_parse_stoc_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                        size_t chainidx, int *al);
369
#ifndef OPENSSL_NO_SRTP
370 371
int tls_parse_stoc_use_srtp(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                            size_t chainidx, int *al);
372
#endif
373 374 375 376 377 378
int tls_parse_stoc_etm(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);
int tls_parse_stoc_ems(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);
int tls_parse_stoc_key_share(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                             size_t chainidx, int *al);
M
Matt Caswell 已提交
379 380
int tls_parse_stoc_cookie(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);
381 382
int tls_parse_stoc_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
                       size_t chainidx, int *al);