2
0

statem_local.h 22 KB

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