2016-05-17 18:18:30 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
|
2015-09-11 10:23:20 +00:00
|
|
|
*
|
2016-05-17 18:18:30 +00:00
|
|
|
* 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
|
2015-09-11 10:23:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* *
|
|
|
|
* 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
|
2017-02-01 13:31:27 +00:00
|
|
|
#define HELLO_RETRY_REQUEST_MAX_LENGTH 20000
|
2016-11-23 15:20:22 +00:00
|
|
|
#define ENCRYPTED_EXTENSIONS_MAX_LENGTH 20000
|
2015-09-11 10:23:20 +00:00
|
|
|
#define SERVER_KEY_EXCH_MAX_LENGTH 102400
|
|
|
|
#define SERVER_HELLO_DONE_MAX_LENGTH 0
|
2017-02-09 12:07:31 +00:00
|
|
|
#define KEY_UPDATE_MAX_LENGTH 1
|
2015-09-11 10:23:20 +00:00
|
|
|
#define CCS_MAX_LENGTH 1
|
|
|
|
/* Max should actually be 36 but we are generous */
|
|
|
|
#define FINISHED_MAX_LENGTH 64
|
|
|
|
|
2017-02-14 11:20:44 +00:00
|
|
|
/* The maximum number of incoming KeyUpdate messages we will accept */
|
|
|
|
#define MAX_KEY_UPDATE_MESSAGES 32
|
|
|
|
|
2016-11-24 11:14:56 +00:00
|
|
|
/* Extension context codes */
|
2016-11-28 09:31:59 +00:00
|
|
|
/* This extension is only allowed in TLS */
|
2016-11-24 16:59:48 +00:00
|
|
|
#define EXT_TLS_ONLY 0x0001
|
2016-11-28 09:31:59 +00:00
|
|
|
/* This extension is only allowed in DTLS */
|
2016-11-24 16:59:48 +00:00
|
|
|
#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
|
2016-11-28 09:31:59 +00:00
|
|
|
/* Extension is only defined for TLS1.2 and above */
|
2016-11-24 16:59:48 +00:00
|
|
|
#define EXT_TLS1_2_AND_BELOW_ONLY 0x0010
|
2016-11-28 09:31:59 +00:00
|
|
|
/* Extension is only defined for TLS1.3 and above */
|
2016-11-24 16:59:48 +00:00
|
|
|
#define EXT_TLS1_3_ONLY 0x0020
|
|
|
|
#define EXT_CLIENT_HELLO 0x0040
|
2016-11-24 11:14:56 +00:00
|
|
|
/* Really means TLS1.2 or below */
|
2016-11-24 16:59:48 +00:00
|
|
|
#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
|
2016-11-24 11:14:56 +00:00
|
|
|
|
2017-02-27 11:19:57 +00:00
|
|
|
/* Dummy message type */
|
|
|
|
#define SSL3_MT_DUMMY -1
|
|
|
|
|
2015-09-11 10:23:20 +00:00
|
|
|
/* Message processing return codes */
|
2015-10-26 11:46:33 +00:00
|
|
|
typedef enum {
|
2015-09-11 10:23:20 +00:00
|
|
|
/* 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
|
2015-10-26 11:46:33 +00:00
|
|
|
} MSG_PROCESS_RETURN;
|
2015-09-11 10:23:20 +00:00
|
|
|
|
|
|
|
/* Flush the write BIO */
|
|
|
|
int statem_flush(SSL *s);
|
|
|
|
|
2016-10-03 14:35:17 +00:00
|
|
|
typedef int (*confunc_f) (SSL *s, WPACKET *pkt);
|
|
|
|
|
2017-02-01 17:10:45 +00:00
|
|
|
int check_in_list(SSL *s, unsigned int group_id, const unsigned char *groups,
|
|
|
|
size_t num_groups, int checkallow);
|
|
|
|
|
2015-09-11 10:23:20 +00:00
|
|
|
/*
|
|
|
|
* TLS/DTLS client state machine functions
|
|
|
|
*/
|
2015-10-26 11:54:17 +00:00
|
|
|
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);
|
2016-09-30 10:17:57 +00:00
|
|
|
int ossl_statem_client_construct_message(SSL *s, WPACKET *pkt,
|
2016-10-03 14:35:17 +00:00
|
|
|
confunc_f *confunc, int *mt);
|
2016-09-06 11:05:25 +00:00
|
|
|
size_t ossl_statem_client_max_message_size(SSL *s);
|
2015-10-26 11:54:17 +00:00
|
|
|
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);
|
2015-09-11 10:23:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* TLS/DTLS server state machine functions
|
|
|
|
*/
|
2015-10-26 11:54:17 +00:00
|
|
|
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);
|
2016-09-30 10:17:57 +00:00
|
|
|
int ossl_statem_server_construct_message(SSL *s, WPACKET *pkt,
|
2016-10-03 14:35:17 +00:00
|
|
|
confunc_f *confunc,int *mt);
|
2016-09-06 11:05:25 +00:00
|
|
|
size_t ossl_statem_server_max_message_size(SSL *s);
|
2015-10-26 11:54:17 +00:00
|
|
|
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);
|
2015-09-11 10:23:20 +00:00
|
|
|
|
|
|
|
/* Functions for getting new message data */
|
|
|
|
__owur int tls_get_message_header(SSL *s, int *mt);
|
2016-09-06 11:05:25 +00:00
|
|
|
__owur int tls_get_message_body(SSL *s, size_t *len);
|
|
|
|
__owur int dtls_get_message(SSL *s, int *mt, size_t *len);
|
2015-09-11 10:23:20 +00:00
|
|
|
|
|
|
|
/* Message construction and processing functions */
|
2016-11-15 10:13:09 +00:00
|
|
|
__owur int tls_process_initial_server_flight(SSL *s, int *al);
|
2015-10-26 11:46:33 +00:00
|
|
|
__owur MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt);
|
|
|
|
__owur MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt);
|
2016-09-29 22:28:29 +00:00
|
|
|
__owur int tls_construct_change_cipher_spec(SSL *s, WPACKET *pkt);
|
|
|
|
__owur int dtls_construct_change_cipher_spec(SSL *s, WPACKET *pkt);
|
2015-09-11 10:23:20 +00:00
|
|
|
|
2016-09-30 09:50:57 +00:00
|
|
|
__owur int tls_construct_finished(SSL *s, WPACKET *pkt);
|
2017-02-08 09:15:22 +00:00
|
|
|
__owur int tls_construct_key_update(SSL *s, WPACKET *pkt);
|
2017-02-09 12:07:31 +00:00
|
|
|
__owur MSG_PROCESS_RETURN tls_process_key_update(SSL *s, PACKET *pkt);
|
2017-01-13 09:19:10 +00:00
|
|
|
__owur WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst, int clearbufs);
|
2015-10-26 11:46:33 +00:00
|
|
|
__owur WORK_STATE dtls_wait_for_dry(SSL *s);
|
2015-09-11 10:23:20 +00:00
|
|
|
|
|
|
|
/* some client-only functions */
|
2016-09-29 22:28:29 +00:00
|
|
|
__owur int tls_construct_client_hello(SSL *s, WPACKET *pkt);
|
2015-10-26 11:46:33 +00:00
|
|
|
__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);
|
2016-12-02 14:46:54 +00:00
|
|
|
__owur int tls_process_cert_status_body(SSL *s, PACKET *pkt, int *al);
|
2015-10-26 11:46:33 +00:00
|
|
|
__owur MSG_PROCESS_RETURN tls_process_cert_status(SSL *s, PACKET *pkt);
|
|
|
|
__owur MSG_PROCESS_RETURN tls_process_server_done(SSL *s, PACKET *pkt);
|
2016-12-05 14:59:25 +00:00
|
|
|
__owur int tls_construct_cert_verify(SSL *s, WPACKET *pkt);
|
2015-10-26 11:46:33 +00:00
|
|
|
__owur WORK_STATE tls_prepare_client_certificate(SSL *s, WORK_STATE wst);
|
2016-09-29 22:28:29 +00:00
|
|
|
__owur int tls_construct_client_certificate(SSL *s, WPACKET *pkt);
|
2015-09-11 10:23:20 +00:00
|
|
|
__owur int ssl_do_client_cert_cb(SSL *s, X509 **px509, EVP_PKEY **ppkey);
|
2016-09-29 22:28:29 +00:00
|
|
|
__owur int tls_construct_client_key_exchange(SSL *s, WPACKET *pkt);
|
2015-09-11 10:23:20 +00:00
|
|
|
__owur int tls_client_key_exchange_post_work(SSL *s);
|
2016-12-02 14:46:54 +00:00
|
|
|
__owur int tls_construct_cert_status_body(SSL *s, WPACKET *pkt);
|
2016-09-29 22:28:29 +00:00
|
|
|
__owur int tls_construct_cert_status(SSL *s, WPACKET *pkt);
|
2016-08-05 17:03:17 +00:00
|
|
|
__owur MSG_PROCESS_RETURN tls_process_key_exchange(SSL *s, PACKET *pkt);
|
2015-10-26 11:46:33 +00:00
|
|
|
__owur MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt);
|
2015-09-11 10:23:20 +00:00
|
|
|
__owur int ssl3_check_cert_and_algorithm(SSL *s);
|
2016-08-05 17:03:17 +00:00
|
|
|
#ifndef OPENSSL_NO_NEXTPROTONEG
|
2016-09-29 22:28:29 +00:00
|
|
|
__owur int tls_construct_next_proto(SSL *s, WPACKET *pkt);
|
2016-08-05 17:03:17 +00:00
|
|
|
#endif
|
2017-01-10 23:02:28 +00:00
|
|
|
__owur MSG_PROCESS_RETURN tls_process_hello_req(SSL *s, PACKET *pkt);
|
2015-10-26 11:46:33 +00:00
|
|
|
__owur MSG_PROCESS_RETURN dtls_process_hello_verify(SSL *s, PACKET *pkt);
|
2015-09-11 10:23:20 +00:00
|
|
|
|
|
|
|
/* some server-only functions */
|
2015-10-26 11:46:33 +00:00
|
|
|
__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);
|
2016-09-29 22:28:29 +00:00
|
|
|
__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);
|
2015-10-26 11:46:33 +00:00
|
|
|
__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);
|
2016-08-05 17:03:17 +00:00
|
|
|
#ifndef OPENSSL_NO_NEXTPROTONEG
|
2015-10-26 11:46:33 +00:00
|
|
|
__owur MSG_PROCESS_RETURN tls_process_next_proto(SSL *s, PACKET *pkt);
|
2016-08-05 17:03:17 +00:00
|
|
|
#endif
|
2016-09-29 22:28:29 +00:00
|
|
|
__owur int tls_construct_new_session_ticket(SSL *s, WPACKET *pkt);
|
2016-11-24 16:59:48 +00:00
|
|
|
|
2016-11-28 09:31:59 +00:00
|
|
|
|
|
|
|
/* Extension processing */
|
|
|
|
|
|
|
|
__owur int tls_collect_extensions(SSL *s, PACKET *packet, unsigned int context,
|
2017-01-23 22:56:43 +00:00
|
|
|
RAW_EXTENSION **res, int *al, size_t *len);
|
2016-12-08 11:42:38 +00:00
|
|
|
__owur int tls_parse_extension(SSL *s, TLSEXT_INDEX idx, int context,
|
2017-01-05 16:12:56 +00:00
|
|
|
RAW_EXTENSION *exts, X509 *x, size_t chainidx,
|
2016-12-01 15:21:08 +00:00
|
|
|
int *al);
|
2016-11-24 18:25:10 +00:00
|
|
|
__owur int tls_parse_all_extensions(SSL *s, int context, RAW_EXTENSION *exts,
|
2017-01-05 16:12:56 +00:00
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-24 18:25:10 +00:00
|
|
|
__owur int tls_construct_extensions(SSL *s, WPACKET *pkt, unsigned int context,
|
2017-01-05 16:12:56 +00:00
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-24 22:54:59 +00:00
|
|
|
|
2017-01-18 16:28:23 +00:00
|
|
|
__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);
|
|
|
|
|
2016-11-24 22:54:59 +00:00
|
|
|
/* Server Extension processing */
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2016-11-24 22:54:59 +00:00
|
|
|
#ifndef OPENSSL_NO_SRP
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_ctos_srp(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-24 22:54:59 +00:00
|
|
|
#endif
|
2017-02-20 16:35:03 +00:00
|
|
|
int tls_parse_ctos_early_data(SSL *s, PACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-24 22:54:59 +00:00
|
|
|
#ifndef OPENSSL_NO_EC
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2016-11-24 22:54:59 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2016-11-25 16:28:02 +00:00
|
|
|
#ifndef OPENSSL_NO_OCSP
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_ctos_status_request(SSL *s, PACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
2016-11-24 22:54:59 +00:00
|
|
|
#ifndef OPENSSL_NO_NEXTPROTONEG
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_ctos_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-24 22:54:59 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_ctos_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-24 22:54:59 +00:00
|
|
|
#ifndef OPENSSL_NO_SRTP
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_ctos_use_srtp(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-24 22:54:59 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2016-11-25 10:22:02 +00:00
|
|
|
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2017-02-17 16:52:12 +00:00
|
|
|
int tls_construct_stoc_early_data_info(SSL *s, WPACKET *pkt,
|
|
|
|
unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2017-02-22 13:01:48 +00:00
|
|
|
int tls_construct_stoc_early_data(SSL *s, WPACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#ifndef OPENSSL_NO_EC
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_stoc_ec_pt_formats(SSL *s, WPACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_stoc_session_ticket(SSL *s, WPACKET *pkt,
|
|
|
|
unsigned int context, X509 *x,
|
2017-01-05 16:12:56 +00:00
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#ifndef OPENSSL_NO_OCSP
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_stoc_status_request(SSL *s, WPACKET *pkt,
|
|
|
|
unsigned int context, X509 *x,
|
2017-01-05 16:12:56 +00:00
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
|
|
|
#ifndef OPENSSL_NO_NEXTPROTONEG
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt,
|
|
|
|
unsigned int context, X509 *x,
|
2017-01-05 16:12:56 +00:00
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_stoc_alpn(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#ifndef OPENSSL_NO_SRTP
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_stoc_use_srtp(SSL *s, WPACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2016-11-25 10:22:02 +00:00
|
|
|
/*
|
|
|
|
* 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
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2016-11-25 12:34:29 +00:00
|
|
|
|
|
|
|
/* Client Extension processing */
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2016-11-25 16:28:02 +00:00
|
|
|
#ifndef OPENSSL_NO_SRP
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_ctos_srp(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
|
|
|
#ifndef OPENSSL_NO_EC
|
2017-01-31 17:00:12 +00:00
|
|
|
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,
|
2017-01-05 16:12:56 +00:00
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
2017-02-20 15:44:42 +00:00
|
|
|
int tls_construct_ctos_early_data(SSL *s, WPACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_ctos_session_ticket(SSL *s, WPACKET *pkt,
|
|
|
|
unsigned int context, X509 *x,
|
2017-01-05 16:12:56 +00:00
|
|
|
size_t chainidx, int *al);
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_ctos_sig_algs(SSL *s, WPACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#ifndef OPENSSL_NO_OCSP
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_ctos_status_request(SSL *s, WPACKET *pkt,
|
|
|
|
unsigned int context, X509 *x,
|
2017-01-05 16:12:56 +00:00
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
|
|
|
#ifndef OPENSSL_NO_NEXTPROTONEG
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_ctos_npn(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_ctos_alpn(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#ifndef OPENSSL_NO_SRTP
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_ctos_use_srtp(SSL *s, WPACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_ctos_etm(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#ifndef OPENSSL_NO_CT
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_construct_ctos_sct(SSL *s, WPACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
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,
|
2017-01-05 16:12:56 +00:00
|
|
|
size_t chainidx, int *al);
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2017-03-02 17:37:03 +00:00
|
|
|
int tls_construct_ctos_cookie(SSL *s, WPACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2017-02-20 14:56:51 +00:00
|
|
|
int tls_parse_stoc_early_data_info(SSL *s, PACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2017-02-23 11:53:12 +00:00
|
|
|
int tls_parse_stoc_early_data(SSL *s, PACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-25 12:34:29 +00:00
|
|
|
#ifndef OPENSSL_NO_EC
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_stoc_ec_pt_formats(SSL *s, PACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-25 12:34:29 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_stoc_session_ticket(SSL *s, PACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#ifndef OPENSSL_NO_OCSP
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_stoc_status_request(SSL *s, PACKET *pkt, unsigned int context,
|
|
|
|
X509 *x, size_t chainidx, int *al);
|
2016-11-25 16:28:02 +00:00
|
|
|
#endif
|
2016-11-25 12:34:29 +00:00
|
|
|
#ifndef OPENSSL_NO_CT
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_stoc_sct(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-25 12:34:29 +00:00
|
|
|
#endif
|
|
|
|
#ifndef OPENSSL_NO_NEXTPROTONEG
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_stoc_npn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-25 12:34:29 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_stoc_alpn(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-25 12:34:29 +00:00
|
|
|
#ifndef OPENSSL_NO_SRTP
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_stoc_use_srtp(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2016-11-25 12:34:29 +00:00
|
|
|
#endif
|
2017-01-31 17:00:12 +00:00
|
|
|
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);
|
2017-03-02 17:37:03 +00:00
|
|
|
int tls_parse_stoc_cookie(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|
2017-01-31 17:00:12 +00:00
|
|
|
int tls_parse_stoc_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
|
|
|
size_t chainidx, int *al);
|