Path: blob/main/crypto/openssl/ssl/statem/statem_local.h
48261 views
/*1* Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.2*3* Licensed under the Apache License 2.0 (the "License"). You may not use4* this file except in compliance with the License. You can obtain a copy5* in the file LICENSE in the source distribution or at6* https://www.openssl.org/source/license.html7*/89/*****************************************************************************10* *11* The following definitions are PRIVATE to the state machine. They should *12* NOT be used outside of the state machine. *13* *14*****************************************************************************/1516/* Max message length definitions */1718/* The spec allows for a longer length than this, but we limit it */19#define HELLO_VERIFY_REQUEST_MAX_LENGTH 25820#define END_OF_EARLY_DATA_MAX_LENGTH 021#define HELLO_RETRY_REQUEST_MAX_LENGTH 2000022#define ENCRYPTED_EXTENSIONS_MAX_LENGTH 2000023#define SESSION_TICKET_MAX_LENGTH_TLS13 13133824#define SESSION_TICKET_MAX_LENGTH_TLS12 6554125#define SERVER_KEY_EXCH_MAX_LENGTH 10240026#define SERVER_HELLO_DONE_MAX_LENGTH 027#define KEY_UPDATE_MAX_LENGTH 128#define CCS_MAX_LENGTH 12930/* Max ServerHello size permitted by RFC 8446 */31#define SERVER_HELLO_MAX_LENGTH 656073233/* Max CertificateVerify size permitted by RFC 8446 */34#define CERTIFICATE_VERIFY_MAX_LENGTH 655393536/* Max should actually be 36 but we are generous */37#define FINISHED_MAX_LENGTH 643839/* Dummy message type */40#define SSL3_MT_DUMMY -14142/* Invalid extension ID for non-supported extensions */43#define TLSEXT_TYPE_invalid 0x1000044#define TLSEXT_TYPE_out_of_range 0x1000145unsigned int ossl_get_extension_type(size_t idx);4647extern const unsigned char hrrrandom[];4849/* Message processing return codes */50typedef enum {51/* Something bad happened */52MSG_PROCESS_ERROR,53/* We've finished reading - swap to writing */54MSG_PROCESS_FINISHED_READING,55/*56* We've completed the main processing of this message but there is some57* post processing to be done.58*/59MSG_PROCESS_CONTINUE_PROCESSING,60/* We've finished this message - read the next message */61MSG_PROCESS_CONTINUE_READING62} MSG_PROCESS_RETURN;6364typedef CON_FUNC_RETURN (*confunc_f) (SSL_CONNECTION *s, WPACKET *pkt);6566int ssl3_take_mac(SSL_CONNECTION *s);67int check_in_list(SSL_CONNECTION *s, uint16_t group_id, const uint16_t *groups,68size_t num_groups, int checkallow, size_t *pos);69int create_synthetic_message_hash(SSL_CONNECTION *s,70const unsigned char *hashval,71size_t hashlen, const unsigned char *hrr,72size_t hrrlen);73int parse_ca_names(SSL_CONNECTION *s, PACKET *pkt);74const STACK_OF(X509_NAME) *get_ca_names(SSL_CONNECTION *s);75int construct_ca_names(SSL_CONNECTION *s, const STACK_OF(X509_NAME) *ca_sk,76WPACKET *pkt);77size_t construct_key_exchange_tbs(SSL_CONNECTION *s, unsigned char **ptbs,78const void *param, size_t paramlen);7980/*81* TLS/DTLS client state machine functions82*/83int ossl_statem_client_read_transition(SSL_CONNECTION *s, int mt);84WRITE_TRAN ossl_statem_client_write_transition(SSL_CONNECTION *s);85WORK_STATE ossl_statem_client_pre_work(SSL_CONNECTION *s, WORK_STATE wst);86WORK_STATE ossl_statem_client_post_work(SSL_CONNECTION *s, WORK_STATE wst);87int ossl_statem_client_construct_message(SSL_CONNECTION *s,88confunc_f *confunc, int *mt);89size_t ossl_statem_client_max_message_size(SSL_CONNECTION *s);90MSG_PROCESS_RETURN ossl_statem_client_process_message(SSL_CONNECTION *s,91PACKET *pkt);92WORK_STATE ossl_statem_client_post_process_message(SSL_CONNECTION *s,93WORK_STATE wst);9495/*96* TLS/DTLS server state machine functions97*/98int ossl_statem_server_read_transition(SSL_CONNECTION *s, int mt);99WRITE_TRAN ossl_statem_server_write_transition(SSL_CONNECTION *s);100WORK_STATE ossl_statem_server_pre_work(SSL_CONNECTION *s, WORK_STATE wst);101WORK_STATE ossl_statem_server_post_work(SSL_CONNECTION *s, WORK_STATE wst);102int ossl_statem_server_construct_message(SSL_CONNECTION *s,103confunc_f *confunc,int *mt);104size_t ossl_statem_server_max_message_size(SSL_CONNECTION *s);105MSG_PROCESS_RETURN ossl_statem_server_process_message(SSL_CONNECTION *s,106PACKET *pkt);107WORK_STATE ossl_statem_server_post_process_message(SSL_CONNECTION *s,108WORK_STATE wst);109110/* Functions for getting new message data */111__owur int tls_get_message_header(SSL_CONNECTION *s, int *mt);112__owur int tls_get_message_body(SSL_CONNECTION *s, size_t *len);113__owur int dtls_get_message(SSL_CONNECTION *s, int *mt);114__owur int dtls_get_message_body(SSL_CONNECTION *s, size_t *len);115116/* Message construction and processing functions */117__owur int tls_process_initial_server_flight(SSL_CONNECTION *s);118__owur MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL_CONNECTION *s,119PACKET *pkt);120__owur MSG_PROCESS_RETURN tls_process_finished(SSL_CONNECTION *s, PACKET *pkt);121__owur CON_FUNC_RETURN tls_construct_change_cipher_spec(SSL_CONNECTION *s,122WPACKET *pkt);123__owur CON_FUNC_RETURN dtls_construct_change_cipher_spec(SSL_CONNECTION *s,124WPACKET *pkt);125126__owur CON_FUNC_RETURN tls_construct_finished(SSL_CONNECTION *s, WPACKET *pkt);127__owur CON_FUNC_RETURN tls_construct_key_update(SSL_CONNECTION *s, WPACKET *pkt);128__owur MSG_PROCESS_RETURN tls_process_key_update(SSL_CONNECTION *s,129PACKET *pkt);130__owur WORK_STATE tls_finish_handshake(SSL_CONNECTION *s, WORK_STATE wst,131int clearbufs, int stop);132__owur WORK_STATE dtls_wait_for_dry(SSL_CONNECTION *s);133134#ifndef OPENSSL_NO_COMP_ALG135__owur MSG_PROCESS_RETURN tls13_process_compressed_certificate(SSL_CONNECTION *sc,136PACKET *pkt,137PACKET *tmppkt,138BUF_MEM *buf);139#endif140141/* some client-only functions */142__owur CON_FUNC_RETURN tls_construct_client_hello(SSL_CONNECTION *s,143WPACKET *pkt);144__owur MSG_PROCESS_RETURN tls_process_server_hello(SSL_CONNECTION *s,145PACKET *pkt);146__owur MSG_PROCESS_RETURN tls_process_certificate_request(SSL_CONNECTION *s,147PACKET *pkt);148__owur MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL_CONNECTION *s,149PACKET *pkt);150__owur int tls_process_cert_status_body(SSL_CONNECTION *s, PACKET *pkt);151__owur MSG_PROCESS_RETURN tls_process_cert_status(SSL_CONNECTION *s,152PACKET *pkt);153__owur MSG_PROCESS_RETURN tls_process_server_done(SSL_CONNECTION *s,154PACKET *pkt);155__owur CON_FUNC_RETURN tls_construct_cert_verify(SSL_CONNECTION *s,156WPACKET *pkt);157__owur WORK_STATE tls_prepare_client_certificate(SSL_CONNECTION *s,158WORK_STATE wst);159__owur CON_FUNC_RETURN tls_construct_client_certificate(SSL_CONNECTION *s,160WPACKET *pkt);161#ifndef OPENSSL_NO_COMP_ALG162__owur CON_FUNC_RETURN tls_construct_client_compressed_certificate(SSL_CONNECTION *sc,163WPACKET *pkt);164#endif165__owur int ssl_do_client_cert_cb(SSL_CONNECTION *s, X509 **px509,166EVP_PKEY **ppkey);167__owur CON_FUNC_RETURN tls_construct_client_key_exchange(SSL_CONNECTION *s,168WPACKET *pkt);169__owur int tls_client_key_exchange_post_work(SSL_CONNECTION *s);170__owur int tls_construct_cert_status_body(SSL_CONNECTION *s, WPACKET *pkt);171__owur CON_FUNC_RETURN tls_construct_cert_status(SSL_CONNECTION *s,172WPACKET *pkt);173__owur MSG_PROCESS_RETURN tls_process_key_exchange(SSL_CONNECTION *s,174PACKET *pkt);175__owur MSG_PROCESS_RETURN tls_process_server_rpk(SSL_CONNECTION *sc,176PACKET *pkt);177__owur MSG_PROCESS_RETURN tls_process_client_rpk(SSL_CONNECTION *sc,178PACKET *pkt);179__owur unsigned long tls_output_rpk(SSL_CONNECTION *sc, WPACKET *pkt,180CERT_PKEY *cpk);181__owur int tls_process_rpk(SSL_CONNECTION *s, PACKET *pkt, EVP_PKEY **peer_rpk);182__owur MSG_PROCESS_RETURN tls_process_server_certificate(SSL_CONNECTION *s,183PACKET *pkt);184__owur WORK_STATE tls_post_process_server_certificate(SSL_CONNECTION *s,185WORK_STATE wst);186#ifndef OPENSSL_NO_COMP_ALG187__owur MSG_PROCESS_RETURN tls_process_server_compressed_certificate(SSL_CONNECTION *sc,188PACKET *pkt);189#endif190__owur int ssl3_check_cert_and_algorithm(SSL_CONNECTION *s);191#ifndef OPENSSL_NO_NEXTPROTONEG192__owur CON_FUNC_RETURN tls_construct_next_proto(SSL_CONNECTION *s, WPACKET *pkt);193#endif194__owur MSG_PROCESS_RETURN tls_process_hello_req(SSL_CONNECTION *s, PACKET *pkt);195__owur MSG_PROCESS_RETURN dtls_process_hello_verify(SSL_CONNECTION *s, PACKET *pkt);196__owur CON_FUNC_RETURN tls_construct_end_of_early_data(SSL_CONNECTION *s,197WPACKET *pkt);198199/* some server-only functions */200__owur MSG_PROCESS_RETURN tls_process_client_hello(SSL_CONNECTION *s,201PACKET *pkt);202__owur WORK_STATE tls_post_process_client_hello(SSL_CONNECTION *s,203WORK_STATE wst);204__owur CON_FUNC_RETURN tls_construct_server_hello(SSL_CONNECTION *s,205WPACKET *pkt);206__owur CON_FUNC_RETURN dtls_construct_hello_verify_request(SSL_CONNECTION *s,207WPACKET *pkt);208__owur CON_FUNC_RETURN tls_construct_server_certificate(SSL_CONNECTION *s,209WPACKET *pkt);210#ifndef OPENSSL_NO_COMP_ALG211__owur CON_FUNC_RETURN tls_construct_server_compressed_certificate(SSL_CONNECTION *sc,212WPACKET *pkt);213#endif214__owur CON_FUNC_RETURN tls_construct_server_key_exchange(SSL_CONNECTION *s,215WPACKET *pkt);216__owur CON_FUNC_RETURN tls_construct_certificate_request(SSL_CONNECTION *s,217WPACKET *pkt);218__owur CON_FUNC_RETURN tls_construct_server_done(SSL_CONNECTION *s,219WPACKET *pkt);220__owur MSG_PROCESS_RETURN tls_process_client_certificate(SSL_CONNECTION *s,221PACKET *pkt);222#ifndef OPENSSL_NO_COMP_ALG223__owur MSG_PROCESS_RETURN tls_process_client_compressed_certificate(SSL_CONNECTION *sc,224PACKET *pkt);225#endif226__owur MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL_CONNECTION *s,227PACKET *pkt);228__owur WORK_STATE tls_post_process_client_key_exchange(SSL_CONNECTION *s,229WORK_STATE wst);230__owur MSG_PROCESS_RETURN tls_process_cert_verify(SSL_CONNECTION *s,231PACKET *pkt);232#ifndef OPENSSL_NO_NEXTPROTONEG233__owur MSG_PROCESS_RETURN tls_process_next_proto(SSL_CONNECTION *s,234PACKET *pkt);235#endif236__owur CON_FUNC_RETURN tls_construct_new_session_ticket(SSL_CONNECTION *s,237WPACKET *pkt);238MSG_PROCESS_RETURN tls_process_end_of_early_data(SSL_CONNECTION *s,239PACKET *pkt);240241#ifndef OPENSSL_NO_GOST242/* These functions are used in GOST18 CKE, both for client and server */243int ossl_gost18_cke_cipher_nid(const SSL_CONNECTION *s);244int ossl_gost_ukm(const SSL_CONNECTION *s, unsigned char *dgst_buf);245#endif246247/* Extension processing */248249typedef enum ext_return_en {250EXT_RETURN_FAIL,251EXT_RETURN_SENT,252EXT_RETURN_NOT_SENT253} EXT_RETURN;254255__owur int tls_validate_all_contexts(SSL_CONNECTION *s, unsigned int thisctx,256RAW_EXTENSION *exts);257__owur int extension_is_relevant(SSL_CONNECTION *s, unsigned int extctx,258unsigned int thisctx);259__owur int tls_collect_extensions(SSL_CONNECTION *s, PACKET *packet,260unsigned int context,261RAW_EXTENSION **res, size_t *len, int init);262__owur int tls_parse_extension(SSL_CONNECTION *s, TLSEXT_INDEX idx, int context,263RAW_EXTENSION *exts, X509 *x, size_t chainidx);264__owur int tls_parse_all_extensions(SSL_CONNECTION *s, int context,265RAW_EXTENSION *exts,266X509 *x, size_t chainidx, int fin);267__owur int should_add_extension(SSL_CONNECTION *s, unsigned int extctx,268unsigned int thisctx, int max_version);269__owur int tls_construct_extensions(SSL_CONNECTION *s, WPACKET *pkt,270unsigned int context,271X509 *x, size_t chainidx);272273__owur int tls_psk_do_binder(SSL_CONNECTION *s, const EVP_MD *md,274const unsigned char *msgstart,275size_t binderoffset, const unsigned char *binderin,276unsigned char *binderout,277SSL_SESSION *sess, int sign, int external);278279/* Server Extension processing */280int tls_parse_ctos_renegotiate(SSL_CONNECTION *s, PACKET *pkt,281unsigned int context,282X509 *x, size_t chainidx);283int tls_parse_ctos_server_name(SSL_CONNECTION *s, PACKET *pkt,284unsigned int context,285X509 *x, size_t chainidx);286int tls_parse_ctos_maxfragmentlen(SSL_CONNECTION *s, PACKET *pkt,287unsigned int context,288X509 *x, size_t chainidx);289#ifndef OPENSSL_NO_SRP290int tls_parse_ctos_srp(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,291X509 *x, size_t chainidx);292#endif293int tls_parse_ctos_early_data(SSL_CONNECTION *s, PACKET *pkt,294unsigned int context,295X509 *x, size_t chainidx);296int tls_parse_ctos_ec_pt_formats(SSL_CONNECTION *s, PACKET *pkt,297unsigned int context,298X509 *x, size_t chainidx);299int tls_parse_ctos_supported_groups(SSL_CONNECTION *s, PACKET *pkt,300unsigned int context,301X509 *x, size_t chainidxl);302int tls_parse_ctos_session_ticket(SSL_CONNECTION *s, PACKET *pkt,303unsigned int context,304X509 *x, size_t chainidx);305int tls_parse_ctos_sig_algs_cert(SSL_CONNECTION *s, PACKET *pkt,306unsigned int context,307X509 *x, size_t chainidx);308int tls_parse_ctos_sig_algs(SSL_CONNECTION *s, PACKET *pkt,309unsigned int context, X509 *x, size_t chainidx);310#ifndef OPENSSL_NO_OCSP311int tls_parse_ctos_status_request(SSL_CONNECTION *s, PACKET *pkt,312unsigned int context,313X509 *x, size_t chainidx);314#endif315#ifndef OPENSSL_NO_NEXTPROTONEG316int tls_parse_ctos_npn(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,317X509 *x, size_t chainidx);318#endif319int tls_parse_ctos_alpn(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,320X509 *x, size_t chainidx);321#ifndef OPENSSL_NO_SRTP322int tls_parse_ctos_use_srtp(SSL_CONNECTION *s, PACKET *pkt,323unsigned int context, X509 *x, size_t chainidx);324#endif325int tls_parse_ctos_etm(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,326X509 *x, size_t chainidx);327int tls_parse_ctos_key_share(SSL_CONNECTION *s, PACKET *pkt,328unsigned int context, X509 *x, size_t chainidx);329int tls_parse_ctos_cookie(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,330X509 *x, size_t chainidx);331int tls_parse_ctos_ems(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,332X509 *x, size_t chainidx);333int tls_parse_ctos_psk_kex_modes(SSL_CONNECTION *s, PACKET *pkt,334unsigned int context,335X509 *x, size_t chainidx);336int tls_parse_ctos_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,337X509 *x, size_t chainidx);338int tls_parse_ctos_post_handshake_auth(SSL_CONNECTION *, PACKET *pkt,339unsigned int context,340X509 *x, size_t chainidx);341342EXT_RETURN tls_construct_stoc_renegotiate(SSL_CONNECTION *s, WPACKET *pkt,343unsigned int context, X509 *x,344size_t chainidx);345EXT_RETURN tls_construct_stoc_server_name(SSL_CONNECTION *s, WPACKET *pkt,346unsigned int context, X509 *x,347size_t chainidx);348EXT_RETURN tls_construct_stoc_early_data(SSL_CONNECTION *s, WPACKET *pkt,349unsigned int context, X509 *x,350size_t chainidx);351EXT_RETURN tls_construct_stoc_maxfragmentlen(SSL_CONNECTION *s, WPACKET *pkt,352unsigned int context, X509 *x,353size_t chainidx);354EXT_RETURN tls_construct_stoc_ec_pt_formats(SSL_CONNECTION *s, WPACKET *pkt,355unsigned int context, X509 *x,356size_t chainidx);357EXT_RETURN tls_construct_stoc_supported_groups(SSL_CONNECTION *s, WPACKET *pkt,358unsigned int context, X509 *x,359size_t chainidx);360EXT_RETURN tls_construct_stoc_session_ticket(SSL_CONNECTION *s, WPACKET *pkt,361unsigned int context, X509 *x,362size_t chainidx);363#ifndef OPENSSL_NO_OCSP364EXT_RETURN tls_construct_stoc_status_request(SSL_CONNECTION *s, WPACKET *pkt,365unsigned int context, X509 *x,366size_t chainidx);367#endif368#ifndef OPENSSL_NO_NEXTPROTONEG369EXT_RETURN tls_construct_stoc_next_proto_neg(SSL_CONNECTION *s, WPACKET *pkt,370unsigned int context, X509 *x,371size_t chainidx);372#endif373EXT_RETURN tls_construct_stoc_alpn(SSL_CONNECTION *s, WPACKET *pkt,374unsigned int context,375X509 *x, size_t chainidx);376#ifndef OPENSSL_NO_SRTP377EXT_RETURN tls_construct_stoc_use_srtp(SSL_CONNECTION *s, WPACKET *pkt,378unsigned int context,379X509 *x, size_t chainidx);380#endif381EXT_RETURN tls_construct_stoc_etm(SSL_CONNECTION *s, WPACKET *pkt,382unsigned int context,383X509 *x, size_t chainidx);384EXT_RETURN tls_construct_stoc_ems(SSL_CONNECTION *s, WPACKET *pkt,385unsigned int context,386X509 *x, size_t chainidx);387EXT_RETURN tls_construct_stoc_supported_versions(SSL_CONNECTION *s, WPACKET *pkt,388unsigned int context, X509 *x,389size_t chainidx);390EXT_RETURN tls_construct_stoc_key_share(SSL_CONNECTION *s, WPACKET *pkt,391unsigned int context, X509 *x,392size_t chainidx);393EXT_RETURN tls_construct_stoc_cookie(SSL_CONNECTION *s, WPACKET *pkt,394unsigned int context,395X509 *x, size_t chainidx);396/*397* Not in public headers as this is not an official extension. Only used when398* SSL_OP_CRYPTOPRO_TLSEXT_BUG is set.399*/400#define TLSEXT_TYPE_cryptopro_bug 0xfde8401EXT_RETURN tls_construct_stoc_cryptopro_bug(SSL_CONNECTION *s, WPACKET *pkt,402unsigned int context, X509 *x,403size_t chainidx);404EXT_RETURN tls_construct_stoc_psk(SSL_CONNECTION *s, WPACKET *pkt,405unsigned int context,406X509 *x, size_t chainidx);407408/* Client Extension processing */409EXT_RETURN tls_construct_ctos_renegotiate(SSL_CONNECTION *s, WPACKET *pkt,410unsigned int context,411X509 *x, size_t chainidx);412EXT_RETURN tls_construct_ctos_server_name(SSL_CONNECTION *s, WPACKET *pkt,413unsigned int context,414X509 *x, size_t chainidx);415EXT_RETURN tls_construct_ctos_maxfragmentlen(SSL_CONNECTION *s, WPACKET *pkt,416unsigned int context,417X509 *x, size_t chainidx);418#ifndef OPENSSL_NO_SRP419EXT_RETURN tls_construct_ctos_srp(SSL_CONNECTION *s, WPACKET *pkt,420unsigned int context, X509 *x,421size_t chainidx);422#endif423EXT_RETURN tls_construct_ctos_ec_pt_formats(SSL_CONNECTION *s, WPACKET *pkt,424unsigned int context, X509 *x,425size_t chainidx);426EXT_RETURN tls_construct_ctos_supported_groups(SSL_CONNECTION *s, WPACKET *pkt,427unsigned int context, X509 *x,428size_t chainidx);429430EXT_RETURN tls_construct_ctos_early_data(SSL_CONNECTION *s, WPACKET *pkt,431unsigned int context, X509 *x,432size_t chainidx);433EXT_RETURN tls_construct_ctos_session_ticket(SSL_CONNECTION *s, WPACKET *pkt,434unsigned int context, X509 *x,435size_t chainidx);436EXT_RETURN tls_construct_ctos_sig_algs(SSL_CONNECTION *s, WPACKET *pkt,437unsigned int context, X509 *x,438size_t chainidx);439#ifndef OPENSSL_NO_OCSP440EXT_RETURN tls_construct_ctos_status_request(SSL_CONNECTION *s, WPACKET *pkt,441unsigned int context, X509 *x,442size_t chainidx);443#endif444#ifndef OPENSSL_NO_NEXTPROTONEG445EXT_RETURN tls_construct_ctos_npn(SSL_CONNECTION *s, WPACKET *pkt,446unsigned int context,447X509 *x, size_t chainidx);448#endif449EXT_RETURN tls_construct_ctos_alpn(SSL_CONNECTION *s, WPACKET *pkt,450unsigned int context,451X509 *x, size_t chainidx);452#ifndef OPENSSL_NO_SRTP453EXT_RETURN tls_construct_ctos_use_srtp(SSL_CONNECTION *s, WPACKET *pkt,454unsigned int context,455X509 *x, size_t chainidx);456#endif457EXT_RETURN tls_construct_ctos_etm(SSL_CONNECTION *s, WPACKET *pkt,458unsigned int context,459X509 *x, size_t chainidx);460#ifndef OPENSSL_NO_CT461EXT_RETURN tls_construct_ctos_sct(SSL_CONNECTION *s, WPACKET *pkt,462unsigned int context,463X509 *x, size_t chainidx);464#endif465EXT_RETURN tls_construct_ctos_ems(SSL_CONNECTION *s, WPACKET *pkt,466unsigned int context,467X509 *x, size_t chainidx);468EXT_RETURN tls_construct_ctos_supported_versions(SSL_CONNECTION *s, WPACKET *pkt,469unsigned int context, X509 *x,470size_t chainidx);471EXT_RETURN tls_construct_ctos_key_share(SSL_CONNECTION *s, WPACKET *pkt,472unsigned int context, X509 *x,473size_t chainidx);474EXT_RETURN tls_construct_ctos_psk_kex_modes(SSL_CONNECTION *s, WPACKET *pkt,475unsigned int context, X509 *x,476size_t chainidx);477EXT_RETURN tls_construct_ctos_cookie(SSL_CONNECTION *s, WPACKET *pkt,478unsigned int context,479X509 *x, size_t chainidx);480EXT_RETURN tls_construct_ctos_padding(SSL_CONNECTION *s, WPACKET *pkt,481unsigned int context, X509 *x,482size_t chainidx);483EXT_RETURN tls_construct_ctos_psk(SSL_CONNECTION *s, WPACKET *pkt,484unsigned int context,485X509 *x, size_t chainidx);486EXT_RETURN tls_construct_ctos_post_handshake_auth(SSL_CONNECTION *s, WPACKET *pkt,487unsigned int context,488X509 *x, size_t chainidx);489490int tls_parse_stoc_renegotiate(SSL_CONNECTION *s, PACKET *pkt,491unsigned int context,492X509 *x, size_t chainidx);493int tls_parse_stoc_server_name(SSL_CONNECTION *s, PACKET *pkt,494unsigned int context,495X509 *x, size_t chainidx);496int tls_parse_stoc_early_data(SSL_CONNECTION *s, PACKET *pkt,497unsigned int context,498X509 *x, size_t chainidx);499int tls_parse_stoc_maxfragmentlen(SSL_CONNECTION *s, PACKET *pkt,500unsigned int context,501X509 *x, size_t chainidx);502int tls_parse_stoc_ec_pt_formats(SSL_CONNECTION *s, PACKET *pkt,503unsigned int context,504X509 *x, size_t chainidx);505int tls_parse_stoc_session_ticket(SSL_CONNECTION *s, PACKET *pkt,506unsigned int context,507X509 *x, size_t chainidx);508#ifndef OPENSSL_NO_OCSP509int tls_parse_stoc_status_request(SSL_CONNECTION *s, PACKET *pkt,510unsigned int context,511X509 *x, size_t chainidx);512#endif513#ifndef OPENSSL_NO_CT514int tls_parse_stoc_sct(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,515X509 *x, size_t chainidx);516#endif517#ifndef OPENSSL_NO_NEXTPROTONEG518int tls_parse_stoc_npn(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,519X509 *x, size_t chainidx);520#endif521int tls_parse_stoc_alpn(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,522X509 *x, size_t chainidx);523#ifndef OPENSSL_NO_SRTP524int tls_parse_stoc_use_srtp(SSL_CONNECTION *s, PACKET *pkt,525unsigned int context, X509 *x, size_t chainidx);526#endif527int tls_parse_stoc_etm(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,528X509 *x, size_t chainidx);529int tls_parse_stoc_ems(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,530X509 *x, size_t chainidx);531int tls_parse_stoc_supported_versions(SSL_CONNECTION *s, PACKET *pkt,532unsigned int context,533X509 *x, size_t chainidx);534int tls_parse_stoc_key_share(SSL_CONNECTION *s, PACKET *pkt,535unsigned int context, X509 *x, size_t chainidx);536int tls_parse_stoc_cookie(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,537X509 *x, size_t chainidx);538int tls_parse_stoc_psk(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,539X509 *x, size_t chainidx);540541int tls_handle_alpn(SSL_CONNECTION *s);542543int tls13_save_handshake_digest_for_pha(SSL_CONNECTION *s);544int tls13_restore_handshake_digest_for_pha(SSL_CONNECTION *s);545546__owur EVP_PKEY* tls_get_peer_pkey(const SSL_CONNECTION *sc);547/* RFC7250 */548EXT_RETURN tls_construct_ctos_client_cert_type(SSL_CONNECTION *sc, WPACKET *pkt,549unsigned int context,550X509 *x, size_t chainidx);551EXT_RETURN tls_construct_stoc_client_cert_type(SSL_CONNECTION *sc, WPACKET *pkt,552unsigned int context,553X509 *x, size_t chainidx);554int tls_parse_ctos_client_cert_type(SSL_CONNECTION *sc, PACKET *pkt,555unsigned int context,556X509 *x, size_t chainidx);557int tls_parse_stoc_client_cert_type(SSL_CONNECTION *sc, PACKET *pkt,558unsigned int context,559X509 *x, size_t chainidx);560EXT_RETURN tls_construct_ctos_server_cert_type(SSL_CONNECTION *sc, WPACKET *pkt,561unsigned int context,562X509 *x, size_t chainidx);563EXT_RETURN tls_construct_stoc_server_cert_type(SSL_CONNECTION *sc, WPACKET *pkt,564unsigned int context,565X509 *x, size_t chainidx);566int tls_parse_ctos_server_cert_type(SSL_CONNECTION *sc, PACKET *pkt,567unsigned int context,568X509 *x, size_t chainidx);569int tls_parse_stoc_server_cert_type(SSL_CONNECTION *s, PACKET *pkt,570unsigned int context,571X509 *x, size_t chainidx);572573574