source: EcnlProtoTool/trunk/openssl-1.1.0e/ssl/statem/statem.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: 4.4 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 * These enums should be considered PRIVATE to the state machine. No *
13 * non-state machine code should need to use these *
14 * *
15 *****************************************************************************/
16/*
17 * Valid return codes used for functions performing work prior to or after
18 * sending or receiving a message
19 */
20typedef enum {
21 /* Something went wrong */
22 WORK_ERROR,
23 /* We're done working and there shouldn't be anything else to do after */
24 WORK_FINISHED_STOP,
25 /* We're done working move onto the next thing */
26 WORK_FINISHED_CONTINUE,
27 /* We're working on phase A */
28 WORK_MORE_A,
29 /* We're working on phase B */
30 WORK_MORE_B
31} WORK_STATE;
32
33/* Write transition return codes */
34typedef enum {
35 /* Something went wrong */
36 WRITE_TRAN_ERROR,
37 /* A transition was successfully completed and we should continue */
38 WRITE_TRAN_CONTINUE,
39 /* There is no more write work to be done */
40 WRITE_TRAN_FINISHED
41} WRITE_TRAN;
42
43/* Message flow states */
44typedef enum {
45 /* No handshake in progress */
46 MSG_FLOW_UNINITED,
47 /* A permanent error with this connection */
48 MSG_FLOW_ERROR,
49 /* We are about to renegotiate */
50 MSG_FLOW_RENEGOTIATE,
51 /* We are reading messages */
52 MSG_FLOW_READING,
53 /* We are writing messages */
54 MSG_FLOW_WRITING,
55 /* Handshake has finished */
56 MSG_FLOW_FINISHED
57} MSG_FLOW_STATE;
58
59/* Read states */
60typedef enum {
61 READ_STATE_HEADER,
62 READ_STATE_BODY,
63 READ_STATE_POST_PROCESS
64} READ_STATE;
65
66/* Write states */
67typedef enum {
68 WRITE_STATE_TRANSITION,
69 WRITE_STATE_PRE_WORK,
70 WRITE_STATE_SEND,
71 WRITE_STATE_POST_WORK
72} WRITE_STATE;
73
74/*****************************************************************************
75 * *
76 * This structure should be considered "opaque" to anything outside of the *
77 * state machine. No non-state machine code should be accessing the members *
78 * of this structure. *
79 * *
80 *****************************************************************************/
81
82struct ossl_statem_st {
83 MSG_FLOW_STATE state;
84 WRITE_STATE write_state;
85 WORK_STATE write_state_work;
86 READ_STATE read_state;
87 WORK_STATE read_state_work;
88 OSSL_HANDSHAKE_STATE hand_state;
89 int in_init;
90 int read_state_first_init;
91 /* true when we are actually in SSL_accept() or SSL_connect() */
92 int in_handshake;
93 /* Should we skip the CertificateVerify message? */
94 unsigned int no_cert_verify;
95 int use_timer;
96#ifndef OPENSSL_NO_SCTP
97 int in_sctp_read_sock;
98#endif
99};
100typedef struct ossl_statem_st OSSL_STATEM;
101
102/*****************************************************************************
103 * *
104 * The following macros/functions represent the libssl internal API to the *
105 * state machine. Any libssl code may call these functions/macros *
106 * *
107 *****************************************************************************/
108
109__owur int ossl_statem_accept(SSL *s);
110__owur int ossl_statem_connect(SSL *s);
111void ossl_statem_clear(SSL *s);
112void ossl_statem_set_renegotiate(SSL *s);
113void ossl_statem_set_error(SSL *s);
114int ossl_statem_in_error(const SSL *s);
115void ossl_statem_set_in_init(SSL *s, int init);
116int ossl_statem_get_in_handshake(SSL *s);
117void ossl_statem_set_in_handshake(SSL *s, int inhand);
118void ossl_statem_set_hello_verify_done(SSL *s);
119__owur int ossl_statem_app_data_allowed(SSL *s);
120#ifndef OPENSSL_NO_SCTP
121void ossl_statem_set_sctp_read_sock(SSL *s, int read_sock);
122__owur int ossl_statem_in_sctp_read_sock(SSL *s);
123#endif
Note: See TracBrowser for help on using the repository browser.