source: EcnlProtoTool/trunk/openssl-1.1.0e/ssl/statem/statem_locl.h@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr
File size: 5.7 KB
Line 
1/*
2 * Copyright 2015-2016 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 * *
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 SERVER_HELLO_MAX_LENGTH 20000
22#define SERVER_KEY_EXCH_MAX_LENGTH 102400
23#define SERVER_HELLO_DONE_MAX_LENGTH 0
24#define CCS_MAX_LENGTH 1
25/* Max should actually be 36 but we are generous */
26#define FINISHED_MAX_LENGTH 64
27
28/* Message processing return codes */
29typedef enum {
30 /* Something bad happened */
31 MSG_PROCESS_ERROR,
32 /* We've finished reading - swap to writing */
33 MSG_PROCESS_FINISHED_READING,
34 /*
35 * We've completed the main processing of this message but there is some
36 * post processing to be done.
37 */
38 MSG_PROCESS_CONTINUE_PROCESSING,
39 /* We've finished this message - read the next message */
40 MSG_PROCESS_CONTINUE_READING
41} MSG_PROCESS_RETURN;
42
43/* Flush the write BIO */
44int statem_flush(SSL *s);
45
46/*
47 * TLS/DTLS client state machine functions
48 */
49int ossl_statem_client_read_transition(SSL *s, int mt);
50WRITE_TRAN ossl_statem_client_write_transition(SSL *s);
51WORK_STATE ossl_statem_client_pre_work(SSL *s, WORK_STATE wst);
52WORK_STATE ossl_statem_client_post_work(SSL *s, WORK_STATE wst);
53int ossl_statem_client_construct_message(SSL *s);
54unsigned long ossl_statem_client_max_message_size(SSL *s);
55MSG_PROCESS_RETURN ossl_statem_client_process_message(SSL *s, PACKET *pkt);
56WORK_STATE ossl_statem_client_post_process_message(SSL *s, WORK_STATE wst);
57
58/*
59 * TLS/DTLS server state machine functions
60 */
61int ossl_statem_server_read_transition(SSL *s, int mt);
62WRITE_TRAN ossl_statem_server_write_transition(SSL *s);
63WORK_STATE ossl_statem_server_pre_work(SSL *s, WORK_STATE wst);
64WORK_STATE ossl_statem_server_post_work(SSL *s, WORK_STATE wst);
65int ossl_statem_server_construct_message(SSL *s);
66unsigned long ossl_statem_server_max_message_size(SSL *s);
67MSG_PROCESS_RETURN ossl_statem_server_process_message(SSL *s, PACKET *pkt);
68WORK_STATE ossl_statem_server_post_process_message(SSL *s, WORK_STATE wst);
69
70/* Functions for getting new message data */
71__owur int tls_get_message_header(SSL *s, int *mt);
72__owur int tls_get_message_body(SSL *s, unsigned long *len);
73__owur int dtls_get_message(SSL *s, int *mt, unsigned long *len);
74
75/* Message construction and processing functions */
76__owur MSG_PROCESS_RETURN tls_process_change_cipher_spec(SSL *s, PACKET *pkt);
77__owur MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt);
78__owur int tls_construct_change_cipher_spec(SSL *s);
79__owur int dtls_construct_change_cipher_spec(SSL *s);
80
81__owur int tls_construct_finished(SSL *s, const char *sender, int slen);
82__owur WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst);
83__owur WORK_STATE dtls_wait_for_dry(SSL *s);
84
85/* some client-only functions */
86__owur int tls_construct_client_hello(SSL *s);
87__owur MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt);
88__owur MSG_PROCESS_RETURN tls_process_certificate_request(SSL *s, PACKET *pkt);
89__owur MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt);
90__owur MSG_PROCESS_RETURN tls_process_cert_status(SSL *s, PACKET *pkt);
91__owur MSG_PROCESS_RETURN tls_process_server_done(SSL *s, PACKET *pkt);
92__owur int tls_construct_client_verify(SSL *s);
93__owur WORK_STATE tls_prepare_client_certificate(SSL *s, WORK_STATE wst);
94__owur int tls_construct_client_certificate(SSL *s);
95__owur int ssl_do_client_cert_cb(SSL *s, X509 **px509, EVP_PKEY **ppkey);
96__owur int tls_construct_client_key_exchange(SSL *s);
97__owur int tls_client_key_exchange_post_work(SSL *s);
98__owur int tls_construct_cert_status(SSL *s);
99__owur MSG_PROCESS_RETURN tls_process_key_exchange(SSL *s, PACKET *pkt);
100__owur MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt);
101__owur int ssl3_check_cert_and_algorithm(SSL *s);
102#ifndef OPENSSL_NO_NEXTPROTONEG
103__owur int tls_construct_next_proto(SSL *s);
104#endif
105__owur MSG_PROCESS_RETURN dtls_process_hello_verify(SSL *s, PACKET *pkt);
106
107/* some server-only functions */
108__owur MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt);
109__owur WORK_STATE tls_post_process_client_hello(SSL *s, WORK_STATE wst);
110__owur int tls_construct_server_hello(SSL *s);
111__owur int tls_construct_hello_request(SSL *s);
112__owur int dtls_construct_hello_verify_request(SSL *s);
113__owur int tls_construct_server_certificate(SSL *s);
114__owur int tls_construct_server_key_exchange(SSL *s);
115__owur int tls_construct_certificate_request(SSL *s);
116__owur int tls_construct_server_done(SSL *s);
117__owur MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt);
118__owur MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, PACKET *pkt);
119__owur WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE wst);
120__owur MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt);
121#ifndef OPENSSL_NO_NEXTPROTONEG
122__owur MSG_PROCESS_RETURN tls_process_next_proto(SSL *s, PACKET *pkt);
123#endif
124__owur int tls_construct_new_session_ticket(SSL *s);
Note: See TracBrowser for help on using the repository browser.