Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/ssl/statem/statem.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | typedef enum { | - | ||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||
3 | SUB_STATE_ERROR, | - | ||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||
5 | SUB_STATE_FINISHED, | - | ||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||
7 | SUB_STATE_END_HANDSHAKE | - | ||||||||||||||||||||||||||||||
8 | } SUB_STATE_RETURN; | - | ||||||||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||||||||
10 | static int state_machine(SSL *s, int server); | - | ||||||||||||||||||||||||||||||
11 | static void init_read_state_machine(SSL *s); | - | ||||||||||||||||||||||||||||||
12 | static SUB_STATE_RETURN read_state_machine(SSL *s); | - | ||||||||||||||||||||||||||||||
13 | static void init_write_state_machine(SSL *s); | - | ||||||||||||||||||||||||||||||
14 | static SUB_STATE_RETURN write_state_machine(SSL *s); | - | ||||||||||||||||||||||||||||||
15 | - | |||||||||||||||||||||||||||||||
16 | OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl) | - | ||||||||||||||||||||||||||||||
17 | { | - | ||||||||||||||||||||||||||||||
18 | return executed 41174 times by 1 test: ssl->statem.hand_state;return ssl->statem.hand_state; Executed by:
executed 41174 times by 1 test: return ssl->statem.hand_state; Executed by:
| 41174 | ||||||||||||||||||||||||||||||
19 | } | - | ||||||||||||||||||||||||||||||
20 | - | |||||||||||||||||||||||||||||||
21 | int SSL_in_init(const SSL *s) | - | ||||||||||||||||||||||||||||||
22 | { | - | ||||||||||||||||||||||||||||||
23 | return executed 180793 times by 1 test: s->statem.in_init;return s->statem.in_init; Executed by:
executed 180793 times by 1 test: return s->statem.in_init; Executed by:
| 180793 | ||||||||||||||||||||||||||||||
24 | } | - | ||||||||||||||||||||||||||||||
25 | - | |||||||||||||||||||||||||||||||
26 | int SSL_is_init_finished(const SSL *s) | - | ||||||||||||||||||||||||||||||
27 | { | - | ||||||||||||||||||||||||||||||
28 | return executed 7657 times by 1 test: !(s->statem.in_init)return !(s->statem.in_init) && (s->statem.hand_state == TLS_ST_OK); Executed by:
executed 7657 times by 1 test: return !(s->statem.in_init) && (s->statem.hand_state == TLS_ST_OK); Executed by:
| 0-7657 | ||||||||||||||||||||||||||||||
29 | } | - | ||||||||||||||||||||||||||||||
30 | - | |||||||||||||||||||||||||||||||
31 | int SSL_in_before(const SSL *s) | - | ||||||||||||||||||||||||||||||
32 | { | - | ||||||||||||||||||||||||||||||
33 | - | |||||||||||||||||||||||||||||||
34 | - | |||||||||||||||||||||||||||||||
35 | - | |||||||||||||||||||||||||||||||
36 | - | |||||||||||||||||||||||||||||||
37 | - | |||||||||||||||||||||||||||||||
38 | - | |||||||||||||||||||||||||||||||
39 | - | |||||||||||||||||||||||||||||||
40 | return executed 44252 times by 1 test: (return (s->statem.hand_state == TLS_ST_BEFORE) && (s->statem.state == MSG_FLOW_UNINITED); Executed by:
executed 44252 times by 1 test: return (s->statem.hand_state == TLS_ST_BEFORE) && (s->statem.state == MSG_FLOW_UNINITED); Executed by:
| 17447-44252 | ||||||||||||||||||||||||||||||
41 | && (
executed 44252 times by 1 test: return (s->statem.hand_state == TLS_ST_BEFORE) && (s->statem.state == MSG_FLOW_UNINITED); Executed by:
| 717-44252 | ||||||||||||||||||||||||||||||
42 | } | - | ||||||||||||||||||||||||||||||
43 | - | |||||||||||||||||||||||||||||||
44 | - | |||||||||||||||||||||||||||||||
45 | - | |||||||||||||||||||||||||||||||
46 | - | |||||||||||||||||||||||||||||||
47 | void ossl_statem_clear(SSL *s) | - | ||||||||||||||||||||||||||||||
48 | { | - | ||||||||||||||||||||||||||||||
49 | s->statem.state = MSG_FLOW_UNINITED; | - | ||||||||||||||||||||||||||||||
50 | s->statem.hand_state = TLS_ST_BEFORE; | - | ||||||||||||||||||||||||||||||
51 | s->statem.in_init = 1; | - | ||||||||||||||||||||||||||||||
52 | s->statem.no_cert_verify = 0; | - | ||||||||||||||||||||||||||||||
53 | } executed 24376 times by 2 tests: end of block Executed by:
| 24376 | ||||||||||||||||||||||||||||||
54 | - | |||||||||||||||||||||||||||||||
55 | - | |||||||||||||||||||||||||||||||
56 | - | |||||||||||||||||||||||||||||||
57 | - | |||||||||||||||||||||||||||||||
58 | void ossl_statem_set_renegotiate(SSL *s) | - | ||||||||||||||||||||||||||||||
59 | { | - | ||||||||||||||||||||||||||||||
60 | s->statem.in_init = 1; | - | ||||||||||||||||||||||||||||||
61 | s->statem.request_state = TLS_ST_SW_HELLO_REQ; | - | ||||||||||||||||||||||||||||||
62 | } executed 32 times by 1 test: end of block Executed by:
| 32 | ||||||||||||||||||||||||||||||
63 | - | |||||||||||||||||||||||||||||||
64 | - | |||||||||||||||||||||||||||||||
65 | - | |||||||||||||||||||||||||||||||
66 | - | |||||||||||||||||||||||||||||||
67 | - | |||||||||||||||||||||||||||||||
68 | void ossl_statem_fatal(SSL *s, int al, int func, int reason, const char *file, | - | ||||||||||||||||||||||||||||||
69 | int line) | - | ||||||||||||||||||||||||||||||
70 | { | - | ||||||||||||||||||||||||||||||
71 | ERR_put_error(20, func, reason, file, line); | - | ||||||||||||||||||||||||||||||
72 | - | |||||||||||||||||||||||||||||||
73 | if (s->statem.in_init
| 0-4071 | ||||||||||||||||||||||||||||||
74 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
75 | s->statem.in_init = 1; | - | ||||||||||||||||||||||||||||||
76 | s->statem.state = MSG_FLOW_ERROR; | - | ||||||||||||||||||||||||||||||
77 | if (al != -1
| 325-3787 | ||||||||||||||||||||||||||||||
78 | && s->statem.enc_write_state != ENC_WRITE_STATE_INVALID
| 0-3787 | ||||||||||||||||||||||||||||||
79 | ssl3_send_alert(s, 2, al); executed 3787 times by 1 test: ssl3_send_alert(s, 2, al); Executed by:
| 3787 | ||||||||||||||||||||||||||||||
80 | } executed 4112 times by 1 test: end of block Executed by:
| 4112 | ||||||||||||||||||||||||||||||
81 | int ossl_statem_in_error(const SSL *s) | - | ||||||||||||||||||||||||||||||
82 | { | - | ||||||||||||||||||||||||||||||
83 | if (s->statem.state == MSG_FLOW_ERROR
| 14-18043 | ||||||||||||||||||||||||||||||
84 | return executed 14 times by 1 test: 1;return 1; Executed by:
executed 14 times by 1 test: return 1; Executed by:
| 14 | ||||||||||||||||||||||||||||||
85 | - | |||||||||||||||||||||||||||||||
86 | return executed 18043 times by 1 test: 0;return 0; Executed by:
executed 18043 times by 1 test: return 0; Executed by:
| 18043 | ||||||||||||||||||||||||||||||
87 | } | - | ||||||||||||||||||||||||||||||
88 | - | |||||||||||||||||||||||||||||||
89 | void ossl_statem_set_in_init(SSL *s, int init) | - | ||||||||||||||||||||||||||||||
90 | { | - | ||||||||||||||||||||||||||||||
91 | s->statem.in_init = init; | - | ||||||||||||||||||||||||||||||
92 | } executed 11815 times by 1 test: end of block Executed by:
| 11815 | ||||||||||||||||||||||||||||||
93 | - | |||||||||||||||||||||||||||||||
94 | int ossl_statem_get_in_handshake(SSL *s) | - | ||||||||||||||||||||||||||||||
95 | { | - | ||||||||||||||||||||||||||||||
96 | return executed 123956 times by 1 test: s->statem.in_handshake;return s->statem.in_handshake; Executed by:
executed 123956 times by 1 test: return s->statem.in_handshake; Executed by:
| 123956 | ||||||||||||||||||||||||||||||
97 | } | - | ||||||||||||||||||||||||||||||
98 | - | |||||||||||||||||||||||||||||||
99 | void ossl_statem_set_in_handshake(SSL *s, int inhand) | - | ||||||||||||||||||||||||||||||
100 | { | - | ||||||||||||||||||||||||||||||
101 | if (inhand
| 0 | ||||||||||||||||||||||||||||||
102 | s->statem.in_handshake++; never executed: s->statem.in_handshake++; | 0 | ||||||||||||||||||||||||||||||
103 | else | - | ||||||||||||||||||||||||||||||
104 | s->statem.in_handshake--; never executed: s->statem.in_handshake--; | 0 | ||||||||||||||||||||||||||||||
105 | } | - | ||||||||||||||||||||||||||||||
106 | - | |||||||||||||||||||||||||||||||
107 | - | |||||||||||||||||||||||||||||||
108 | int ossl_statem_skip_early_data(SSL *s) | - | ||||||||||||||||||||||||||||||
109 | { | - | ||||||||||||||||||||||||||||||
110 | if (s->ext.early_data != 1
| 336-10796 | ||||||||||||||||||||||||||||||
111 | return executed 336 times by 1 test: 0;return 0; Executed by:
executed 336 times by 1 test: return 0; Executed by:
| 336 | ||||||||||||||||||||||||||||||
112 | - | |||||||||||||||||||||||||||||||
113 | if (!s->server
| 0-10796 | ||||||||||||||||||||||||||||||
114 | || s->statem.hand_state != TLS_ST_EARLY_DATA
| 1-10795 | ||||||||||||||||||||||||||||||
115 | || s->hello_retry_request == SSL_HRR_COMPLETE
| 4-10791 | ||||||||||||||||||||||||||||||
116 | return executed 5 times by 1 test: 0;return 0; Executed by:
executed 5 times by 1 test: return 0; Executed by:
| 5 | ||||||||||||||||||||||||||||||
117 | - | |||||||||||||||||||||||||||||||
118 | return executed 10791 times by 1 test: 1;return 1; Executed by:
executed 10791 times by 1 test: return 1; Executed by:
| 10791 | ||||||||||||||||||||||||||||||
119 | } | - | ||||||||||||||||||||||||||||||
120 | void ossl_statem_check_finish_init(SSL *s, int sending) | - | ||||||||||||||||||||||||||||||
121 | { | - | ||||||||||||||||||||||||||||||
122 | if (sending == -1
| 24091-27951 | ||||||||||||||||||||||||||||||
123 | if (s->statem.hand_state == TLS_ST_PENDING_EARLY_DATA_END
| 0-24091 | ||||||||||||||||||||||||||||||
124 | || s->statem.hand_state == TLS_ST_EARLY_DATA
| 4530-19561 | ||||||||||||||||||||||||||||||
125 | ossl_statem_set_in_init(s, 1); | - | ||||||||||||||||||||||||||||||
126 | if (s->early_data_state == SSL_EARLY_DATA_WRITE_RETRY
| 32-4498 | ||||||||||||||||||||||||||||||
127 | - | |||||||||||||||||||||||||||||||
128 | - | |||||||||||||||||||||||||||||||
129 | - | |||||||||||||||||||||||||||||||
130 | - | |||||||||||||||||||||||||||||||
131 | s->early_data_state = SSL_EARLY_DATA_FINISHED_WRITING; | - | ||||||||||||||||||||||||||||||
132 | } executed 32 times by 1 test: end of block Executed by:
| 32 | ||||||||||||||||||||||||||||||
133 | } executed 4530 times by 1 test: end of block Executed by:
| 4530 | ||||||||||||||||||||||||||||||
134 | } executed 24091 times by 1 test: else if (!s->serverend of block Executed by:
| 10157-24091 | ||||||||||||||||||||||||||||||
135 | if ((sending
| 6-14648 | ||||||||||||||||||||||||||||||
136 | || s->statem.hand_state == TLS_ST_EARLY_DATA
| 59-3081 | ||||||||||||||||||||||||||||||
137 | && s->early_data_state != SSL_EARLY_DATA_WRITING
| 12-53 | ||||||||||||||||||||||||||||||
138 | || (!sending
| 3-14648 | ||||||||||||||||||||||||||||||
139 | ossl_statem_set_in_init(s, 1); | - | ||||||||||||||||||||||||||||||
140 | - | |||||||||||||||||||||||||||||||
141 | - | |||||||||||||||||||||||||||||||
142 | - | |||||||||||||||||||||||||||||||
143 | - | |||||||||||||||||||||||||||||||
144 | if (sending
| 0-12 | ||||||||||||||||||||||||||||||
145 | s->early_data_state = SSL_EARLY_DATA_FINISHED_WRITING; executed 12 times by 1 test: s->early_data_state = SSL_EARLY_DATA_FINISHED_WRITING; Executed by:
| 12 | ||||||||||||||||||||||||||||||
146 | } executed 15 times by 1 test: end of block Executed by:
| 15 | ||||||||||||||||||||||||||||||
147 | } executed 17794 times by 1 test: else {end of block Executed by:
| 17794 | ||||||||||||||||||||||||||||||
148 | if (s->early_data_state == SSL_EARLY_DATA_FINISHED_READING
| 36-10121 | ||||||||||||||||||||||||||||||
149 | && s->statem.hand_state == TLS_ST_EARLY_DATA
| 18 | ||||||||||||||||||||||||||||||
150 | ossl_statem_set_in_init(s, 1); executed 18 times by 1 test: ossl_statem_set_in_init(s, 1); Executed by:
| 18 | ||||||||||||||||||||||||||||||
151 | } executed 10157 times by 1 test: end of block Executed by:
| 10157 | ||||||||||||||||||||||||||||||
152 | } | - | ||||||||||||||||||||||||||||||
153 | - | |||||||||||||||||||||||||||||||
154 | void ossl_statem_set_hello_verify_done(SSL *s) | - | ||||||||||||||||||||||||||||||
155 | { | - | ||||||||||||||||||||||||||||||
156 | s->statem.state = MSG_FLOW_UNINITED; | - | ||||||||||||||||||||||||||||||
157 | s->statem.in_init = 1; | - | ||||||||||||||||||||||||||||||
158 | - | |||||||||||||||||||||||||||||||
159 | - | |||||||||||||||||||||||||||||||
160 | - | |||||||||||||||||||||||||||||||
161 | - | |||||||||||||||||||||||||||||||
162 | - | |||||||||||||||||||||||||||||||
163 | - | |||||||||||||||||||||||||||||||
164 | - | |||||||||||||||||||||||||||||||
165 | s->statem.hand_state = TLS_ST_SR_CLNT_HELLO; | - | ||||||||||||||||||||||||||||||
166 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||||||||||||||||||||
167 | - | |||||||||||||||||||||||||||||||
168 | int ossl_statem_connect(SSL *s) | - | ||||||||||||||||||||||||||||||
169 | { | - | ||||||||||||||||||||||||||||||
170 | return executed 15708 times by 1 test: state_machine(s, 0);return state_machine(s, 0); Executed by:
executed 15708 times by 1 test: return state_machine(s, 0); Executed by:
| 15708 | ||||||||||||||||||||||||||||||
171 | } | - | ||||||||||||||||||||||||||||||
172 | - | |||||||||||||||||||||||||||||||
173 | int ossl_statem_accept(SSL *s) | - | ||||||||||||||||||||||||||||||
174 | { | - | ||||||||||||||||||||||||||||||
175 | return executed 13982 times by 1 test: state_machine(s, 1);return state_machine(s, 1); Executed by:
executed 13982 times by 1 test: return state_machine(s, 1); Executed by:
| 13982 | ||||||||||||||||||||||||||||||
176 | } | - | ||||||||||||||||||||||||||||||
177 | - | |||||||||||||||||||||||||||||||
178 | typedef void (*info_cb) (const SSL *, int, int); | - | ||||||||||||||||||||||||||||||
179 | - | |||||||||||||||||||||||||||||||
180 | static info_cb get_callback(SSL *s) | - | ||||||||||||||||||||||||||||||
181 | { | - | ||||||||||||||||||||||||||||||
182 | if (s->info_callback !=
| 20410-60329 | ||||||||||||||||||||||||||||||
183 | ((void *)0)
| 20410-60329 | ||||||||||||||||||||||||||||||
184 | ) | - | ||||||||||||||||||||||||||||||
185 | return executed 20410 times by 1 test: s->info_callback;return s->info_callback; Executed by:
executed 20410 times by 1 test: return s->info_callback; Executed by:
| 20410 | ||||||||||||||||||||||||||||||
186 | else if (s->ctx->info_callback !=
| 72-60257 | ||||||||||||||||||||||||||||||
187 | ((void *)0)
| 72-60257 | ||||||||||||||||||||||||||||||
188 | ) | - | ||||||||||||||||||||||||||||||
189 | return executed 72 times by 1 test: s->ctx->info_callback;return s->ctx->info_callback; Executed by:
executed 72 times by 1 test: return s->ctx->info_callback; Executed by:
| 72 | ||||||||||||||||||||||||||||||
190 | - | |||||||||||||||||||||||||||||||
191 | return executed 60257 times by 1 test: return ((void *)0) ; Executed by:
executed 60257 times by 1 test: return ((void *)0) ; Executed by:
| 60257 | ||||||||||||||||||||||||||||||
192 | ((void *)0) executed 60257 times by 1 test: return ((void *)0) ; Executed by:
| 60257 | ||||||||||||||||||||||||||||||
193 | ; executed 60257 times by 1 test: return ((void *)0) ; Executed by:
| 60257 | ||||||||||||||||||||||||||||||
194 | } | - | ||||||||||||||||||||||||||||||
195 | static int state_machine(SSL *s, int server) | - | ||||||||||||||||||||||||||||||
196 | { | - | ||||||||||||||||||||||||||||||
197 | BUF_MEM *buf = | - | ||||||||||||||||||||||||||||||
198 | ((void *)0) | - | ||||||||||||||||||||||||||||||
199 | ; | - | ||||||||||||||||||||||||||||||
200 | void (*cb) (const SSL *ssl, int type, int val) = | - | ||||||||||||||||||||||||||||||
201 | ((void *)0) | - | ||||||||||||||||||||||||||||||
202 | ; | - | ||||||||||||||||||||||||||||||
203 | OSSL_STATEM *st = &s->statem; | - | ||||||||||||||||||||||||||||||
204 | int ret = -1; | - | ||||||||||||||||||||||||||||||
205 | int ssret; | - | ||||||||||||||||||||||||||||||
206 | - | |||||||||||||||||||||||||||||||
207 | if (st->state == MSG_FLOW_ERROR
| 454-29236 | ||||||||||||||||||||||||||||||
208 | - | |||||||||||||||||||||||||||||||
209 | return executed 454 times by 1 test: -1;return -1; Executed by:
executed 454 times by 1 test: return -1; Executed by:
| 454 | ||||||||||||||||||||||||||||||
210 | } | - | ||||||||||||||||||||||||||||||
211 | - | |||||||||||||||||||||||||||||||
212 | ERR_clear_error(); | - | ||||||||||||||||||||||||||||||
213 | - | |||||||||||||||||||||||||||||||
214 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
215 | =0; | - | ||||||||||||||||||||||||||||||
216 | - | |||||||||||||||||||||||||||||||
217 | cb = get_callback(s); | - | ||||||||||||||||||||||||||||||
218 | - | |||||||||||||||||||||||||||||||
219 | st->in_handshake++; | - | ||||||||||||||||||||||||||||||
220 | if (!SSL_in_init(s)
| 0-29236 | ||||||||||||||||||||||||||||||
221 | - | |||||||||||||||||||||||||||||||
222 | - | |||||||||||||||||||||||||||||||
223 | - | |||||||||||||||||||||||||||||||
224 | - | |||||||||||||||||||||||||||||||
225 | if ((
| 0-7997 | ||||||||||||||||||||||||||||||
226 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||||||||
227 | } executed 8001 times by 1 test: end of block Executed by:
| 8001 | ||||||||||||||||||||||||||||||
228 | if (st->state == MSG_FLOW_UNINITED
| 8001-21235 | ||||||||||||||||||||||||||||||
229 | || st->state == MSG_FLOW_FINISHED
| 1289-19946 | ||||||||||||||||||||||||||||||
230 | if (st->state == MSG_FLOW_UNINITED
| 1289-8001 | ||||||||||||||||||||||||||||||
231 | st->hand_state = TLS_ST_BEFORE; | - | ||||||||||||||||||||||||||||||
232 | st->request_state = TLS_ST_BEFORE; | - | ||||||||||||||||||||||||||||||
233 | } executed 8001 times by 1 test: end of block Executed by:
| 8001 | ||||||||||||||||||||||||||||||
234 | - | |||||||||||||||||||||||||||||||
235 | s->server = server; | - | ||||||||||||||||||||||||||||||
236 | if (cb !=
| 3005-6285 | ||||||||||||||||||||||||||||||
237 | ((void *)0)
| 3005-6285 | ||||||||||||||||||||||||||||||
238 | ) | - | ||||||||||||||||||||||||||||||
239 | cb(s, 0x10, 1); executed 3005 times by 1 test: cb(s, 0x10, 1); Executed by:
| 3005 | ||||||||||||||||||||||||||||||
240 | - | |||||||||||||||||||||||||||||||
241 | - | |||||||||||||||||||||||||||||||
242 | - | |||||||||||||||||||||||||||||||
243 | - | |||||||||||||||||||||||||||||||
244 | - | |||||||||||||||||||||||||||||||
245 | - | |||||||||||||||||||||||||||||||
246 | - | |||||||||||||||||||||||||||||||
247 | if ((
| 384-8906 | ||||||||||||||||||||||||||||||
248 | if ((
| 0-384 | ||||||||||||||||||||||||||||||
249 | (server
| 0 | ||||||||||||||||||||||||||||||
250 | ossl_statem_fatal((s), (-1), (353), ((4|64)), | - | ||||||||||||||||||||||||||||||
251 | __FILE__ | - | ||||||||||||||||||||||||||||||
252 | , | - | ||||||||||||||||||||||||||||||
253 | 358 | - | ||||||||||||||||||||||||||||||
254 | ) | - | ||||||||||||||||||||||||||||||
255 | ; | - | ||||||||||||||||||||||||||||||
256 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||||||||||||||||||||||||||
257 | } | - | ||||||||||||||||||||||||||||||
258 | } executed 384 times by 1 test: else {end of block Executed by:
| 384 | ||||||||||||||||||||||||||||||
259 | if ((
| 0-8906 | ||||||||||||||||||||||||||||||
260 | ossl_statem_fatal((s), (-1), (353), ((4|64)), | - | ||||||||||||||||||||||||||||||
261 | __FILE__ | - | ||||||||||||||||||||||||||||||
262 | , | - | ||||||||||||||||||||||||||||||
263 | 364 | - | ||||||||||||||||||||||||||||||
264 | ) | - | ||||||||||||||||||||||||||||||
265 | ; | - | ||||||||||||||||||||||||||||||
266 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||||||||||||||||||||||||||
267 | } | - | ||||||||||||||||||||||||||||||
268 | } executed 8906 times by 1 test: end of block Executed by:
| 8906 | ||||||||||||||||||||||||||||||
269 | - | |||||||||||||||||||||||||||||||
270 | if (!ssl_security(s, (9 | 0), 0, s->version,
| 0-9290 | ||||||||||||||||||||||||||||||
271 | ((void *)0)
| 0-9290 | ||||||||||||||||||||||||||||||
272 | )
| 0-9290 | ||||||||||||||||||||||||||||||
273 | ossl_statem_fatal((s), (-1), (353), ((4|64)), | - | ||||||||||||||||||||||||||||||
274 | __FILE__ | - | ||||||||||||||||||||||||||||||
275 | , | - | ||||||||||||||||||||||||||||||
276 | 371 | - | ||||||||||||||||||||||||||||||
277 | ) | - | ||||||||||||||||||||||||||||||
278 | ; | - | ||||||||||||||||||||||||||||||
279 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||||||||||||||||||||||||||
280 | } | - | ||||||||||||||||||||||||||||||
281 | - | |||||||||||||||||||||||||||||||
282 | if (s->init_buf ==
| 68-9222 | ||||||||||||||||||||||||||||||
283 | ((void *)0)
| 68-9222 | ||||||||||||||||||||||||||||||
284 | ) { | - | ||||||||||||||||||||||||||||||
285 | if ((
| 0-9222 | ||||||||||||||||||||||||||||||
286 | ((void *)0)
| 0-9222 | ||||||||||||||||||||||||||||||
287 | ) { | - | ||||||||||||||||||||||||||||||
288 | ossl_statem_fatal((s), (-1), (353), ((4|64)), | - | ||||||||||||||||||||||||||||||
289 | __FILE__ | - | ||||||||||||||||||||||||||||||
290 | , | - | ||||||||||||||||||||||||||||||
291 | 378 | - | ||||||||||||||||||||||||||||||
292 | ) | - | ||||||||||||||||||||||||||||||
293 | ; | - | ||||||||||||||||||||||||||||||
294 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||||||||||||||||||||||||||
295 | } | - | ||||||||||||||||||||||||||||||
296 | if (!BUF_MEM_grow(buf, 16384)
| 0-9222 | ||||||||||||||||||||||||||||||
297 | ossl_statem_fatal((s), (-1), (353), ((4|64)), | - | ||||||||||||||||||||||||||||||
298 | __FILE__ | - | ||||||||||||||||||||||||||||||
299 | , | - | ||||||||||||||||||||||||||||||
300 | 383 | - | ||||||||||||||||||||||||||||||
301 | ) | - | ||||||||||||||||||||||||||||||
302 | ; | - | ||||||||||||||||||||||||||||||
303 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||||||||||||||||||||||||||
304 | } | - | ||||||||||||||||||||||||||||||
305 | s->init_buf = buf; | - | ||||||||||||||||||||||||||||||
306 | buf = | - | ||||||||||||||||||||||||||||||
307 | ((void *)0) | - | ||||||||||||||||||||||||||||||
308 | ; | - | ||||||||||||||||||||||||||||||
309 | } executed 9222 times by 1 test: end of block Executed by:
| 9222 | ||||||||||||||||||||||||||||||
310 | - | |||||||||||||||||||||||||||||||
311 | if (!ssl3_setup_buffers(s)
| 0-9290 | ||||||||||||||||||||||||||||||
312 | ossl_statem_fatal((s), (-1), (353), ((4|64)), | - | ||||||||||||||||||||||||||||||
313 | __FILE__ | - | ||||||||||||||||||||||||||||||
314 | , | - | ||||||||||||||||||||||||||||||
315 | 392 | - | ||||||||||||||||||||||||||||||
316 | ) | - | ||||||||||||||||||||||||||||||
317 | ; | - | ||||||||||||||||||||||||||||||
318 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||||||||||||||||||||||||||
319 | } | - | ||||||||||||||||||||||||||||||
320 | s->init_num = 0; | - | ||||||||||||||||||||||||||||||
321 | - | |||||||||||||||||||||||||||||||
322 | - | |||||||||||||||||||||||||||||||
323 | - | |||||||||||||||||||||||||||||||
324 | - | |||||||||||||||||||||||||||||||
325 | s->s3->change_cipher_spec = 0; | - | ||||||||||||||||||||||||||||||
326 | if (!ssl_init_wbio_buffer(s)
| 0-9290 | ||||||||||||||||||||||||||||||
327 | ossl_statem_fatal((s), (-1), (353), ((4|64)), | - | ||||||||||||||||||||||||||||||
328 | __FILE__ | - | ||||||||||||||||||||||||||||||
329 | , | - | ||||||||||||||||||||||||||||||
330 | 411 | - | ||||||||||||||||||||||||||||||
331 | ) | - | ||||||||||||||||||||||||||||||
332 | ; | - | ||||||||||||||||||||||||||||||
333 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||||||||||||||||||||||||||
334 | } | - | ||||||||||||||||||||||||||||||
335 | - | |||||||||||||||||||||||||||||||
336 | if ((
| 1289-8001 | ||||||||||||||||||||||||||||||
337 | || s->renegotiate
| 32-1257 | ||||||||||||||||||||||||||||||
338 | if (!tls_setup_handshake(s)
| 49-7984 | ||||||||||||||||||||||||||||||
339 | - | |||||||||||||||||||||||||||||||
340 | goto executed 49 times by 1 test: end;goto end; Executed by:
executed 49 times by 1 test: goto end; Executed by:
| 49 | ||||||||||||||||||||||||||||||
341 | } | - | ||||||||||||||||||||||||||||||
342 | - | |||||||||||||||||||||||||||||||
343 | if (((
| 0-7952 | ||||||||||||||||||||||||||||||
344 | st->read_state_first_init = 1; executed 7952 times by 1 test: st->read_state_first_init = 1; Executed by:
| 7952 | ||||||||||||||||||||||||||||||
345 | } executed 7984 times by 1 test: end of block Executed by:
| 7984 | ||||||||||||||||||||||||||||||
346 | - | |||||||||||||||||||||||||||||||
347 | st->state = MSG_FLOW_WRITING; | - | ||||||||||||||||||||||||||||||
348 | init_write_state_machine(s); | - | ||||||||||||||||||||||||||||||
349 | } executed 9241 times by 1 test: end of block Executed by:
| 9241 | ||||||||||||||||||||||||||||||
350 | - | |||||||||||||||||||||||||||||||
351 | while (st->state != MSG_FLOW_FINISHED
| 4486-51503 | ||||||||||||||||||||||||||||||
352 | if (st->state == MSG_FLOW_READING
| 18684-32819 | ||||||||||||||||||||||||||||||
353 | ssret = read_state_machine(s); | - | ||||||||||||||||||||||||||||||
354 | if (ssret == SUB_STATE_FINISHED
| 8827-23992 | ||||||||||||||||||||||||||||||
355 | st->state = MSG_FLOW_WRITING; | - | ||||||||||||||||||||||||||||||
356 | init_write_state_machine(s); | - | ||||||||||||||||||||||||||||||
357 | } executed 8827 times by 1 test: else {end of block Executed by:
| 8827 | ||||||||||||||||||||||||||||||
358 | - | |||||||||||||||||||||||||||||||
359 | goto executed 23992 times by 1 test: end;goto end; Executed by:
executed 23992 times by 1 test: goto end; Executed by:
| 23992 | ||||||||||||||||||||||||||||||
360 | } | - | ||||||||||||||||||||||||||||||
361 | } else if (st->state == MSG_FLOW_WRITING
| 0-18684 | ||||||||||||||||||||||||||||||
362 | ssret = write_state_machine(s); | - | ||||||||||||||||||||||||||||||
363 | if (ssret == SUB_STATE_FINISHED
| 5195-13489 | ||||||||||||||||||||||||||||||
364 | st->state = MSG_FLOW_READING; | - | ||||||||||||||||||||||||||||||
365 | init_read_state_machine(s); | - | ||||||||||||||||||||||||||||||
366 | } executed 13489 times by 1 test: else if (ssret == SUB_STATE_END_HANDSHAKEend of block Executed by:
| 709-13489 | ||||||||||||||||||||||||||||||
367 | st->state = MSG_FLOW_FINISHED; | - | ||||||||||||||||||||||||||||||
368 | } executed 4486 times by 1 test: else {end of block Executed by:
| 4486 | ||||||||||||||||||||||||||||||
369 | - | |||||||||||||||||||||||||||||||
370 | goto executed 709 times by 1 test: end;goto end; Executed by:
executed 709 times by 1 test: goto end; Executed by:
| 709 | ||||||||||||||||||||||||||||||
371 | } | - | ||||||||||||||||||||||||||||||
372 | } else { | - | ||||||||||||||||||||||||||||||
373 | - | |||||||||||||||||||||||||||||||
374 | do { if (!(((
never executed: } while (0);ossl_statem_fatal((s), (80), ((353)), (256), __FILE__, 453); | 0 | ||||||||||||||||||||||||||||||
375 | ERR_put_error(20,(353),((2|64)),__FILE__,454); | - | ||||||||||||||||||||||||||||||
376 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||||||||||||||||||||||||||
377 | } | - | ||||||||||||||||||||||||||||||
378 | } | - | ||||||||||||||||||||||||||||||
379 | - | |||||||||||||||||||||||||||||||
380 | ret = 1; | - | ||||||||||||||||||||||||||||||
381 | - | |||||||||||||||||||||||||||||||
382 | end: code before this statement executed 4486 times by 1 test: end: Executed by:
| 4486 | ||||||||||||||||||||||||||||||
383 | st->in_handshake--; | - | ||||||||||||||||||||||||||||||
384 | BUF_MEM_free(buf); | - | ||||||||||||||||||||||||||||||
385 | if (cb !=
| 5872-23364 | ||||||||||||||||||||||||||||||
386 | ((void *)0)
| 5872-23364 | ||||||||||||||||||||||||||||||
387 | ) { | - | ||||||||||||||||||||||||||||||
388 | if (server
| 2220-3652 | ||||||||||||||||||||||||||||||
389 | cb(s, (0x2000|0x02), ret); executed 2220 times by 1 test: cb(s, (0x2000|0x02), ret); Executed by:
| 2220 | ||||||||||||||||||||||||||||||
390 | else | - | ||||||||||||||||||||||||||||||
391 | cb(s, (0x1000|0x02), ret); executed 3652 times by 1 test: cb(s, (0x1000|0x02), ret); Executed by:
| 3652 | ||||||||||||||||||||||||||||||
392 | } | - | ||||||||||||||||||||||||||||||
393 | return executed 29236 times by 1 test: ret;return ret; Executed by:
executed 29236 times by 1 test: return ret; Executed by:
| 29236 | ||||||||||||||||||||||||||||||
394 | } | - | ||||||||||||||||||||||||||||||
395 | - | |||||||||||||||||||||||||||||||
396 | - | |||||||||||||||||||||||||||||||
397 | - | |||||||||||||||||||||||||||||||
398 | - | |||||||||||||||||||||||||||||||
399 | static void init_read_state_machine(SSL *s) | - | ||||||||||||||||||||||||||||||
400 | { | - | ||||||||||||||||||||||||||||||
401 | OSSL_STATEM *st = &s->statem; | - | ||||||||||||||||||||||||||||||
402 | - | |||||||||||||||||||||||||||||||
403 | st->read_state = READ_STATE_HEADER; | - | ||||||||||||||||||||||||||||||
404 | } executed 13489 times by 1 test: end of block Executed by:
| 13489 | ||||||||||||||||||||||||||||||
405 | - | |||||||||||||||||||||||||||||||
406 | static int grow_init_buf(SSL *s, size_t size) { | - | ||||||||||||||||||||||||||||||
407 | - | |||||||||||||||||||||||||||||||
408 | size_t msg_offset = (char *)s->init_msg - s->init_buf->data; | - | ||||||||||||||||||||||||||||||
409 | - | |||||||||||||||||||||||||||||||
410 | if (!BUF_MEM_grow_clean(s->init_buf, (int)size)
| 0-21276 | ||||||||||||||||||||||||||||||
411 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||
412 | - | |||||||||||||||||||||||||||||||
413 | if (size < msg_offset
| 0-21276 | ||||||||||||||||||||||||||||||
414 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||
415 | - | |||||||||||||||||||||||||||||||
416 | s->init_msg = s->init_buf->data + msg_offset; | - | ||||||||||||||||||||||||||||||
417 | - | |||||||||||||||||||||||||||||||
418 | return executed 21276 times by 1 test: 1;return 1; Executed by:
executed 21276 times by 1 test: return 1; Executed by:
| 21276 | ||||||||||||||||||||||||||||||
419 | } | - | ||||||||||||||||||||||||||||||
420 | static SUB_STATE_RETURN read_state_machine(SSL *s) | - | ||||||||||||||||||||||||||||||
421 | { | - | ||||||||||||||||||||||||||||||
422 | OSSL_STATEM *st = &s->statem; | - | ||||||||||||||||||||||||||||||
423 | int ret, mt; | - | ||||||||||||||||||||||||||||||
424 | size_t len = 0; | - | ||||||||||||||||||||||||||||||
425 | int (*transition) (SSL *s, int mt); | - | ||||||||||||||||||||||||||||||
426 | PACKET pkt; | - | ||||||||||||||||||||||||||||||
427 | MSG_PROCESS_RETURN(*process_message) (SSL *s, PACKET *pkt); | - | ||||||||||||||||||||||||||||||
428 | WORK_STATE(*post_process_message) (SSL *s, WORK_STATE wst); | - | ||||||||||||||||||||||||||||||
429 | size_t (*max_message_size) (SSL *s); | - | ||||||||||||||||||||||||||||||
430 | void (*cb) (const SSL *ssl, int type, int val) = | - | ||||||||||||||||||||||||||||||
431 | ((void *)0) | - | ||||||||||||||||||||||||||||||
432 | ; | - | ||||||||||||||||||||||||||||||
433 | - | |||||||||||||||||||||||||||||||
434 | cb = get_callback(s); | - | ||||||||||||||||||||||||||||||
435 | - | |||||||||||||||||||||||||||||||
436 | if (s->server
| 15292-17527 | ||||||||||||||||||||||||||||||
437 | transition = ossl_statem_server_read_transition; | - | ||||||||||||||||||||||||||||||
438 | process_message = ossl_statem_server_process_message; | - | ||||||||||||||||||||||||||||||
439 | max_message_size = ossl_statem_server_max_message_size; | - | ||||||||||||||||||||||||||||||
440 | post_process_message = ossl_statem_server_post_process_message; | - | ||||||||||||||||||||||||||||||
441 | } executed 15292 times by 1 test: else {end of block Executed by:
| 15292 | ||||||||||||||||||||||||||||||
442 | transition = ossl_statem_client_read_transition; | - | ||||||||||||||||||||||||||||||
443 | process_message = ossl_statem_client_process_message; | - | ||||||||||||||||||||||||||||||
444 | max_message_size = ossl_statem_client_max_message_size; | - | ||||||||||||||||||||||||||||||
445 | post_process_message = ossl_statem_client_post_process_message; | - | ||||||||||||||||||||||||||||||
446 | } executed 17527 times by 1 test: end of block Executed by:
| 17527 | ||||||||||||||||||||||||||||||
447 | - | |||||||||||||||||||||||||||||||
448 | if (st->read_state_first_init
| 7890-24929 | ||||||||||||||||||||||||||||||
449 | s->first_packet = 1; | - | ||||||||||||||||||||||||||||||
450 | st->read_state_first_init = 0; | - | ||||||||||||||||||||||||||||||
451 | } executed 7890 times by 1 test: end of block Executed by:
| 7890 | ||||||||||||||||||||||||||||||
452 | - | |||||||||||||||||||||||||||||||
453 | while (1) { | - | ||||||||||||||||||||||||||||||
454 | switch (st->read_state) { | - | ||||||||||||||||||||||||||||||
455 | case executed 42983 times by 1 test: READ_STATE_HEADER:case READ_STATE_HEADER: Executed by:
executed 42983 times by 1 test: case READ_STATE_HEADER: Executed by:
| 42983 | ||||||||||||||||||||||||||||||
456 | - | |||||||||||||||||||||||||||||||
457 | if ((
| 2843-40140 | ||||||||||||||||||||||||||||||
458 | - | |||||||||||||||||||||||||||||||
459 | - | |||||||||||||||||||||||||||||||
460 | - | |||||||||||||||||||||||||||||||
461 | ret = dtls_get_message(s, &mt, &len); | - | ||||||||||||||||||||||||||||||
462 | } executed 2843 times by 1 test: else {end of block Executed by:
| 2843 | ||||||||||||||||||||||||||||||
463 | ret = tls_get_message_header(s, &mt); | - | ||||||||||||||||||||||||||||||
464 | } executed 40140 times by 1 test: end of block Executed by:
| 40140 | ||||||||||||||||||||||||||||||
465 | - | |||||||||||||||||||||||||||||||
466 | if (ret == 0
| 18463-24520 | ||||||||||||||||||||||||||||||
467 | - | |||||||||||||||||||||||||||||||
468 | return executed 18463 times by 1 test: SUB_STATE_ERROR;return SUB_STATE_ERROR; Executed by:
executed 18463 times by 1 test: return SUB_STATE_ERROR; Executed by:
| 18463 | ||||||||||||||||||||||||||||||
469 | } | - | ||||||||||||||||||||||||||||||
470 | - | |||||||||||||||||||||||||||||||
471 | if (cb !=
| 10272-14248 | ||||||||||||||||||||||||||||||
472 | ((void *)0)
| 10272-14248 | ||||||||||||||||||||||||||||||
473 | ) { | - | ||||||||||||||||||||||||||||||
474 | - | |||||||||||||||||||||||||||||||
475 | if (s->server
| 3573-6699 | ||||||||||||||||||||||||||||||
476 | cb(s, (0x2000|0x01), 1); executed 3573 times by 1 test: cb(s, (0x2000|0x01), 1); Executed by:
| 3573 | ||||||||||||||||||||||||||||||
477 | else | - | ||||||||||||||||||||||||||||||
478 | cb(s, (0x1000|0x01), 1); executed 6699 times by 1 test: cb(s, (0x1000|0x01), 1); Executed by:
| 6699 | ||||||||||||||||||||||||||||||
479 | } | - | ||||||||||||||||||||||||||||||
480 | - | |||||||||||||||||||||||||||||||
481 | - | |||||||||||||||||||||||||||||||
482 | - | |||||||||||||||||||||||||||||||
483 | - | |||||||||||||||||||||||||||||||
484 | if (!transition(s, mt)
| 74-24446 | ||||||||||||||||||||||||||||||
485 | return executed 74 times by 1 test: SUB_STATE_ERROR;return SUB_STATE_ERROR; Executed by:
executed 74 times by 1 test: return SUB_STATE_ERROR; Executed by:
| 74 | ||||||||||||||||||||||||||||||
486 | - | |||||||||||||||||||||||||||||||
487 | if (s->s3->tmp.message_size > max_message_size(s)
| 11-24435 | ||||||||||||||||||||||||||||||
488 | ossl_statem_fatal((s), (47), (352), (152), | - | ||||||||||||||||||||||||||||||
489 | __FILE__ | - | ||||||||||||||||||||||||||||||
490 | , | - | ||||||||||||||||||||||||||||||
491 | 601 | - | ||||||||||||||||||||||||||||||
492 | ) | - | ||||||||||||||||||||||||||||||
493 | ; | - | ||||||||||||||||||||||||||||||
494 | return executed 11 times by 1 test: SUB_STATE_ERROR;return SUB_STATE_ERROR; Executed by:
executed 11 times by 1 test: return SUB_STATE_ERROR; Executed by:
| 11 | ||||||||||||||||||||||||||||||
495 | } | - | ||||||||||||||||||||||||||||||
496 | - | |||||||||||||||||||||||||||||||
497 | - | |||||||||||||||||||||||||||||||
498 | if (!(s->method->ssl3_enc->enc_flags & 0x8)
| 1865-22570 | ||||||||||||||||||||||||||||||
499 | && s->s3->tmp.message_size > 0
| 1294-21276 | ||||||||||||||||||||||||||||||
500 | && !grow_init_buf(s, s->s3->tmp.message_size
| 0-21276 | ||||||||||||||||||||||||||||||
501 | + 4)
| 0-21276 | ||||||||||||||||||||||||||||||
502 | ossl_statem_fatal((s), (80), (352), (7), | - | ||||||||||||||||||||||||||||||
503 | __FILE__ | - | ||||||||||||||||||||||||||||||
504 | , | - | ||||||||||||||||||||||||||||||
505 | 611 | - | ||||||||||||||||||||||||||||||
506 | ) | - | ||||||||||||||||||||||||||||||
507 | ; | - | ||||||||||||||||||||||||||||||
508 | return never executed: SUB_STATE_ERROR;return SUB_STATE_ERROR; never executed: return SUB_STATE_ERROR; | 0 | ||||||||||||||||||||||||||||||
509 | } | - | ||||||||||||||||||||||||||||||
510 | - | |||||||||||||||||||||||||||||||
511 | st->read_state = READ_STATE_BODY; | - | ||||||||||||||||||||||||||||||
512 | - | |||||||||||||||||||||||||||||||
513 | - | |||||||||||||||||||||||||||||||
514 | case executed 2419 times by 1 test: READ_STATE_BODY:case READ_STATE_BODY: Executed by:
executed 2419 times by 1 test: case READ_STATE_BODY: Executed by:
code before this statement executed 24435 times by 1 test: case READ_STATE_BODY: Executed by:
| 2419-24435 | ||||||||||||||||||||||||||||||
515 | if (!(s->method->ssl3_enc->enc_flags & 0x8)
| 1865-24989 | ||||||||||||||||||||||||||||||
516 | - | |||||||||||||||||||||||||||||||
517 | ret = tls_get_message_body(s, &len); | - | ||||||||||||||||||||||||||||||
518 | if (ret == 0
| 2478-22511 | ||||||||||||||||||||||||||||||
519 | - | |||||||||||||||||||||||||||||||
520 | return executed 2478 times by 1 test: SUB_STATE_ERROR;return SUB_STATE_ERROR; Executed by:
executed 2478 times by 1 test: return SUB_STATE_ERROR; Executed by:
| 2478 | ||||||||||||||||||||||||||||||
521 | } | - | ||||||||||||||||||||||||||||||
522 | } executed 22511 times by 1 test: end of block Executed by:
| 22511 | ||||||||||||||||||||||||||||||
523 | - | |||||||||||||||||||||||||||||||
524 | s->first_packet = 0; | - | ||||||||||||||||||||||||||||||
525 | if (!PACKET_buf_init(&pkt, s->init_msg, len)
| 0-24376 | ||||||||||||||||||||||||||||||
526 | ossl_statem_fatal((s), (80), (352), ((4|64)), | - | ||||||||||||||||||||||||||||||
527 | __FILE__ | - | ||||||||||||||||||||||||||||||
528 | , | - | ||||||||||||||||||||||||||||||
529 | 631 | - | ||||||||||||||||||||||||||||||
530 | ) | - | ||||||||||||||||||||||||||||||
531 | ; | - | ||||||||||||||||||||||||||||||
532 | return never executed: SUB_STATE_ERROR;return SUB_STATE_ERROR; never executed: return SUB_STATE_ERROR; | 0 | ||||||||||||||||||||||||||||||
533 | } | - | ||||||||||||||||||||||||||||||
534 | ret = process_message(s, &pkt); | - | ||||||||||||||||||||||||||||||
535 | - | |||||||||||||||||||||||||||||||
536 | - | |||||||||||||||||||||||||||||||
537 | s->init_num = 0; | - | ||||||||||||||||||||||||||||||
538 | - | |||||||||||||||||||||||||||||||
539 | switch (ret) { | - | ||||||||||||||||||||||||||||||
540 | case executed 1787 times by 1 test: MSG_PROCESS_ERROR:case MSG_PROCESS_ERROR: Executed by:
executed 1787 times by 1 test: case MSG_PROCESS_ERROR: Executed by:
| 1787 | ||||||||||||||||||||||||||||||
541 | do { if (!(((
never executed: } while (0);ossl_statem_fatal((s), (80), ((352)), (256), __FILE__, 641); | 0-1787 | ||||||||||||||||||||||||||||||
542 | return executed 1787 times by 1 test: SUB_STATE_ERROR;return SUB_STATE_ERROR; Executed by:
executed 1787 times by 1 test: return SUB_STATE_ERROR; Executed by:
| 1787 | ||||||||||||||||||||||||||||||
543 | - | |||||||||||||||||||||||||||||||
544 | case executed 6322 times by 1 test: MSG_PROCESS_FINISHED_READING:case MSG_PROCESS_FINISHED_READING: Executed by:
executed 6322 times by 1 test: case MSG_PROCESS_FINISHED_READING: Executed by:
| 6322 | ||||||||||||||||||||||||||||||
545 | if ((
| 524-5798 | ||||||||||||||||||||||||||||||
546 | dtls1_stop_timer(s); | - | ||||||||||||||||||||||||||||||
547 | } executed 524 times by 1 test: end of block Executed by:
| 524 | ||||||||||||||||||||||||||||||
548 | return executed 6322 times by 1 test: SUB_STATE_FINISHED;return SUB_STATE_FINISHED; Executed by:
executed 6322 times by 1 test: return SUB_STATE_FINISHED; Executed by:
| 6322 | ||||||||||||||||||||||||||||||
549 | - | |||||||||||||||||||||||||||||||
550 | case executed 4929 times by 1 test: MSG_PROCESS_CONTINUE_PROCESSING:case MSG_PROCESS_CONTINUE_PROCESSING: Executed by:
executed 4929 times by 1 test: case MSG_PROCESS_CONTINUE_PROCESSING: Executed by:
| 4929 | ||||||||||||||||||||||||||||||
551 | st->read_state = READ_STATE_POST_PROCESS; | - | ||||||||||||||||||||||||||||||
552 | st->read_state_work = WORK_MORE_A; | - | ||||||||||||||||||||||||||||||
553 | break; executed 4929 times by 1 test: break; Executed by:
| 4929 | ||||||||||||||||||||||||||||||
554 | - | |||||||||||||||||||||||||||||||
555 | default executed 11338 times by 1 test: :default: Executed by:
executed 11338 times by 1 test: default: Executed by:
| 11338 | ||||||||||||||||||||||||||||||
556 | st->read_state = READ_STATE_HEADER; | - | ||||||||||||||||||||||||||||||
557 | break; executed 11338 times by 1 test: break; Executed by:
| 11338 | ||||||||||||||||||||||||||||||
558 | } | - | ||||||||||||||||||||||||||||||
559 | break; executed 16267 times by 1 test: break; Executed by:
| 16267 | ||||||||||||||||||||||||||||||
560 | - | |||||||||||||||||||||||||||||||
561 | case executed 4932 times by 1 test: READ_STATE_POST_PROCESS:case READ_STATE_POST_PROCESS: Executed by:
executed 4932 times by 1 test: case READ_STATE_POST_PROCESS: Executed by:
| 4932 | ||||||||||||||||||||||||||||||
562 | st->read_state_work = post_process_message(s, st->read_state_work); | - | ||||||||||||||||||||||||||||||
563 | switch (st->read_state_work) { | - | ||||||||||||||||||||||||||||||
564 | case executed 1176 times by 1 test: WORK_ERROR:case WORK_ERROR: Executed by:
executed 1176 times by 1 test: case WORK_ERROR: Executed by:
| 1176 | ||||||||||||||||||||||||||||||
565 | do { if (!(((
never executed: } while (0);ossl_statem_fatal((s), (80), ((352)), (256), __FILE__, 665); | 0-1176 | ||||||||||||||||||||||||||||||
566 | - | |||||||||||||||||||||||||||||||
567 | case executed 1 time by 1 test: WORK_MORE_A:case WORK_MORE_A: Executed by:
executed 1 time by 1 test: case WORK_MORE_A: Executed by:
code before this statement executed 1176 times by 1 test: case WORK_MORE_A: Executed by:
| 1-1176 | ||||||||||||||||||||||||||||||
568 | case executed 2 times by 1 test: WORK_MORE_B:case WORK_MORE_B: Executed by:
executed 2 times by 1 test: case WORK_MORE_B: Executed by:
| 2 | ||||||||||||||||||||||||||||||
569 | case never executed: WORK_MORE_C:case WORK_MORE_C: never executed: case WORK_MORE_C: | 0 | ||||||||||||||||||||||||||||||
570 | return executed 1179 times by 1 test: SUB_STATE_ERROR;return SUB_STATE_ERROR; Executed by:
executed 1179 times by 1 test: return SUB_STATE_ERROR; Executed by:
| 1179 | ||||||||||||||||||||||||||||||
571 | - | |||||||||||||||||||||||||||||||
572 | case executed 1248 times by 1 test: WORK_FINISHED_CONTINUE:case WORK_FINISHED_CONTINUE: Executed by:
executed 1248 times by 1 test: case WORK_FINISHED_CONTINUE: Executed by:
| 1248 | ||||||||||||||||||||||||||||||
573 | st->read_state = READ_STATE_HEADER; | - | ||||||||||||||||||||||||||||||
574 | break; executed 1248 times by 1 test: break; Executed by:
| 1248 | ||||||||||||||||||||||||||||||
575 | - | |||||||||||||||||||||||||||||||
576 | case executed 2505 times by 1 test: WORK_FINISHED_STOP:case WORK_FINISHED_STOP: Executed by:
executed 2505 times by 1 test: case WORK_FINISHED_STOP: Executed by:
| 2505 | ||||||||||||||||||||||||||||||
577 | if ((
| 186-2319 | ||||||||||||||||||||||||||||||
578 | dtls1_stop_timer(s); | - | ||||||||||||||||||||||||||||||
579 | } executed 186 times by 1 test: end of block Executed by:
| 186 | ||||||||||||||||||||||||||||||
580 | return executed 2505 times by 1 test: SUB_STATE_FINISHED;return SUB_STATE_FINISHED; Executed by:
executed 2505 times by 1 test: return SUB_STATE_FINISHED; Executed by:
| 2505 | ||||||||||||||||||||||||||||||
581 | } | - | ||||||||||||||||||||||||||||||
582 | break; executed 1248 times by 1 test: break; Executed by:
| 1248 | ||||||||||||||||||||||||||||||
583 | - | |||||||||||||||||||||||||||||||
584 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||
585 | - | |||||||||||||||||||||||||||||||
586 | ossl_statem_fatal((s), (80), (352), ((4|64)), | - | ||||||||||||||||||||||||||||||
587 | __FILE__ | - | ||||||||||||||||||||||||||||||
588 | , | - | ||||||||||||||||||||||||||||||
589 | 687 | - | ||||||||||||||||||||||||||||||
590 | ) | - | ||||||||||||||||||||||||||||||
591 | ; | - | ||||||||||||||||||||||||||||||
592 | return never executed: SUB_STATE_ERROR;return SUB_STATE_ERROR; never executed: return SUB_STATE_ERROR; | 0 | ||||||||||||||||||||||||||||||
593 | } | - | ||||||||||||||||||||||||||||||
594 | } | - | ||||||||||||||||||||||||||||||
595 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
596 | - | |||||||||||||||||||||||||||||||
597 | - | |||||||||||||||||||||||||||||||
598 | - | |||||||||||||||||||||||||||||||
599 | - | |||||||||||||||||||||||||||||||
600 | static int statem_do_write(SSL *s) | - | ||||||||||||||||||||||||||||||
601 | { | - | ||||||||||||||||||||||||||||||
602 | OSSL_STATEM *st = &s->statem; | - | ||||||||||||||||||||||||||||||
603 | - | |||||||||||||||||||||||||||||||
604 | if (st->hand_state == TLS_ST_CW_CHANGE
| 2682-23243 | ||||||||||||||||||||||||||||||
605 | || st->hand_state == TLS_ST_SW_CHANGE
| 1993-21250 | ||||||||||||||||||||||||||||||
606 | if ((
| 359-4316 | ||||||||||||||||||||||||||||||
607 | return executed 359 times by 1 test: dtls1_do_write(s, 20);return dtls1_do_write(s, 20); Executed by:
executed 359 times by 1 test: return dtls1_do_write(s, 20); Executed by:
| 359 | ||||||||||||||||||||||||||||||
608 | else | - | ||||||||||||||||||||||||||||||
609 | return executed 4316 times by 1 test: ssl3_do_write(s, 20);return ssl3_do_write(s, 20); Executed by:
executed 4316 times by 1 test: return ssl3_do_write(s, 20); Executed by:
| 4316 | ||||||||||||||||||||||||||||||
610 | } else { | - | ||||||||||||||||||||||||||||||
611 | return executed 21250 times by 1 test: s->method->ssl3_enc->do_write(s);return s->method->ssl3_enc->do_write(s); Executed by:
executed 21250 times by 1 test: return s->method->ssl3_enc->do_write(s); Executed by:
| 21250 | ||||||||||||||||||||||||||||||
612 | } | - | ||||||||||||||||||||||||||||||
613 | } | - | ||||||||||||||||||||||||||||||
614 | - | |||||||||||||||||||||||||||||||
615 | - | |||||||||||||||||||||||||||||||
616 | - | |||||||||||||||||||||||||||||||
617 | - | |||||||||||||||||||||||||||||||
618 | static void init_write_state_machine(SSL *s) | - | ||||||||||||||||||||||||||||||
619 | { | - | ||||||||||||||||||||||||||||||
620 | OSSL_STATEM *st = &s->statem; | - | ||||||||||||||||||||||||||||||
621 | - | |||||||||||||||||||||||||||||||
622 | st->write_state = WRITE_STATE_TRANSITION; | - | ||||||||||||||||||||||||||||||
623 | } executed 18068 times by 1 test: end of block Executed by:
| 18068 | ||||||||||||||||||||||||||||||
624 | static SUB_STATE_RETURN write_state_machine(SSL *s) | - | ||||||||||||||||||||||||||||||
625 | { | - | ||||||||||||||||||||||||||||||
626 | OSSL_STATEM *st = &s->statem; | - | ||||||||||||||||||||||||||||||
627 | int ret; | - | ||||||||||||||||||||||||||||||
628 | WRITE_TRAN(*transition) (SSL *s); | - | ||||||||||||||||||||||||||||||
629 | WORK_STATE(*pre_work) (SSL *s, WORK_STATE wst); | - | ||||||||||||||||||||||||||||||
630 | WORK_STATE(*post_work) (SSL *s, WORK_STATE wst); | - | ||||||||||||||||||||||||||||||
631 | int (*get_construct_message_f) (SSL *s, WPACKET *pkt, | - | ||||||||||||||||||||||||||||||
632 | int (**confunc) (SSL *s, WPACKET *pkt), | - | ||||||||||||||||||||||||||||||
633 | int *mt); | - | ||||||||||||||||||||||||||||||
634 | void (*cb) (const SSL *ssl, int type, int val) = | - | ||||||||||||||||||||||||||||||
635 | ((void *)0) | - | ||||||||||||||||||||||||||||||
636 | ; | - | ||||||||||||||||||||||||||||||
637 | int (*confunc) (SSL *s, WPACKET *pkt); | - | ||||||||||||||||||||||||||||||
638 | int mt; | - | ||||||||||||||||||||||||||||||
639 | WPACKET pkt; | - | ||||||||||||||||||||||||||||||
640 | - | |||||||||||||||||||||||||||||||
641 | cb = get_callback(s); | - | ||||||||||||||||||||||||||||||
642 | - | |||||||||||||||||||||||||||||||
643 | if (s->server
| 8486-10198 | ||||||||||||||||||||||||||||||
644 | transition = ossl_statem_server_write_transition; | - | ||||||||||||||||||||||||||||||
645 | pre_work = ossl_statem_server_pre_work; | - | ||||||||||||||||||||||||||||||
646 | post_work = ossl_statem_server_post_work; | - | ||||||||||||||||||||||||||||||
647 | get_construct_message_f = ossl_statem_server_construct_message; | - | ||||||||||||||||||||||||||||||
648 | } executed 8486 times by 1 test: else {end of block Executed by:
| 8486 | ||||||||||||||||||||||||||||||
649 | transition = ossl_statem_client_write_transition; | - | ||||||||||||||||||||||||||||||
650 | pre_work = ossl_statem_client_pre_work; | - | ||||||||||||||||||||||||||||||
651 | post_work = ossl_statem_client_post_work; | - | ||||||||||||||||||||||||||||||
652 | get_construct_message_f = ossl_statem_client_construct_message; | - | ||||||||||||||||||||||||||||||
653 | } executed 10198 times by 1 test: end of block Executed by:
| 10198 | ||||||||||||||||||||||||||||||
654 | - | |||||||||||||||||||||||||||||||
655 | while (1) { | - | ||||||||||||||||||||||||||||||
656 | switch (st->write_state) { | - | ||||||||||||||||||||||||||||||
657 | case executed 44838 times by 1 test: WRITE_STATE_TRANSITION:case WRITE_STATE_TRANSITION: Executed by:
executed 44838 times by 1 test: case WRITE_STATE_TRANSITION: Executed by:
| 44838 | ||||||||||||||||||||||||||||||
658 | if (cb !=
| 18455-26383 | ||||||||||||||||||||||||||||||
659 | ((void *)0)
| 18455-26383 | ||||||||||||||||||||||||||||||
660 | ) { | - | ||||||||||||||||||||||||||||||
661 | - | |||||||||||||||||||||||||||||||
662 | if (s->server
| 7964-10491 | ||||||||||||||||||||||||||||||
663 | cb(s, (0x2000|0x01), 1); executed 10491 times by 1 test: cb(s, (0x2000|0x01), 1); Executed by:
| 10491 | ||||||||||||||||||||||||||||||
664 | else | - | ||||||||||||||||||||||||||||||
665 | cb(s, (0x1000|0x01), 1); executed 7964 times by 1 test: cb(s, (0x1000|0x01), 1); Executed by:
| 7964 | ||||||||||||||||||||||||||||||
666 | } | - | ||||||||||||||||||||||||||||||
667 | switch (transition(s)) { | - | ||||||||||||||||||||||||||||||
668 | case executed 31349 times by 1 test: WRITE_TRAN_CONTINUE:case WRITE_TRAN_CONTINUE: Executed by:
executed 31349 times by 1 test: case WRITE_TRAN_CONTINUE: Executed by:
| 31349 | ||||||||||||||||||||||||||||||
669 | st->write_state = WRITE_STATE_PRE_WORK; | - | ||||||||||||||||||||||||||||||
670 | st->write_state_work = WORK_MORE_A; | - | ||||||||||||||||||||||||||||||
671 | break; executed 31349 times by 1 test: break; Executed by:
| 31349 | ||||||||||||||||||||||||||||||
672 | - | |||||||||||||||||||||||||||||||
673 | case executed 13489 times by 1 test: WRITE_TRAN_FINISHED:case WRITE_TRAN_FINISHED: Executed by:
executed 13489 times by 1 test: case WRITE_TRAN_FINISHED: Executed by:
| 13489 | ||||||||||||||||||||||||||||||
674 | return executed 13489 times by 1 test: SUB_STATE_FINISHED;return SUB_STATE_FINISHED; Executed by:
executed 13489 times by 1 test: return SUB_STATE_FINISHED; Executed by:
| 13489 | ||||||||||||||||||||||||||||||
675 | break; dead code: break; | - | ||||||||||||||||||||||||||||||
676 | - | |||||||||||||||||||||||||||||||
677 | case never executed: WRITE_TRAN_ERROR:case WRITE_TRAN_ERROR: never executed: case WRITE_TRAN_ERROR: | 0 | ||||||||||||||||||||||||||||||
678 | do { if (!(((
never executed: } while (0);ossl_statem_fatal((s), (80), ((586)), (256), __FILE__, 802); | 0 | ||||||||||||||||||||||||||||||
679 | return never executed: SUB_STATE_ERROR;return SUB_STATE_ERROR; never executed: return SUB_STATE_ERROR; | 0 | ||||||||||||||||||||||||||||||
680 | } | - | ||||||||||||||||||||||||||||||
681 | break; executed 31349 times by 1 test: break; Executed by:
| 31349 | ||||||||||||||||||||||||||||||
682 | - | |||||||||||||||||||||||||||||||
683 | case executed 31349 times by 1 test: WRITE_STATE_PRE_WORK:case WRITE_STATE_PRE_WORK: Executed by:
executed 31349 times by 1 test: case WRITE_STATE_PRE_WORK: Executed by:
| 31349 | ||||||||||||||||||||||||||||||
684 | switch (st->write_state_work = pre_work(s, st->write_state_work)) { | - | ||||||||||||||||||||||||||||||
685 | case never executed: WORK_ERROR:case WORK_ERROR: never executed: case WORK_ERROR: | 0 | ||||||||||||||||||||||||||||||
686 | do { if (!(((
never executed: } while (0);ossl_statem_fatal((s), (80), ((586)), (256), __FILE__, 810); | 0 | ||||||||||||||||||||||||||||||
687 | - | |||||||||||||||||||||||||||||||
688 | case never executed: WORK_MORE_A:case WORK_MORE_A: never executed: case WORK_MORE_A: code before this statement never executed: case WORK_MORE_A: | 0 | ||||||||||||||||||||||||||||||
689 | case never executed: WORK_MORE_B:case WORK_MORE_B: never executed: case WORK_MORE_B: | 0 | ||||||||||||||||||||||||||||||
690 | case never executed: WORK_MORE_C:case WORK_MORE_C: never executed: case WORK_MORE_C: | 0 | ||||||||||||||||||||||||||||||
691 | return never executed: SUB_STATE_ERROR;return SUB_STATE_ERROR; never executed: return SUB_STATE_ERROR; | 0 | ||||||||||||||||||||||||||||||
692 | - | |||||||||||||||||||||||||||||||
693 | case executed 26863 times by 1 test: WORK_FINISHED_CONTINUE:case WORK_FINISHED_CONTINUE: Executed by:
executed 26863 times by 1 test: case WORK_FINISHED_CONTINUE: Executed by:
| 26863 | ||||||||||||||||||||||||||||||
694 | st->write_state = WRITE_STATE_SEND; | - | ||||||||||||||||||||||||||||||
695 | break; executed 26863 times by 1 test: break; Executed by:
| 26863 | ||||||||||||||||||||||||||||||
696 | - | |||||||||||||||||||||||||||||||
697 | case executed 4486 times by 1 test: WORK_FINISHED_STOP:case WORK_FINISHED_STOP: Executed by:
executed 4486 times by 1 test: case WORK_FINISHED_STOP: Executed by:
| 4486 | ||||||||||||||||||||||||||||||
698 | return executed 4486 times by 1 test: SUB_STATE_END_HANDSHAKE;return SUB_STATE_END_HANDSHAKE; Executed by:
executed 4486 times by 1 test: return SUB_STATE_END_HANDSHAKE; Executed by:
| 4486 | ||||||||||||||||||||||||||||||
699 | } | - | ||||||||||||||||||||||||||||||
700 | if (!get_construct_message_f(s, &pkt, &confunc, &mt)
| 0-26863 | ||||||||||||||||||||||||||||||
701 | - | |||||||||||||||||||||||||||||||
702 | return never executed: SUB_STATE_ERROR;return SUB_STATE_ERROR; never executed: return SUB_STATE_ERROR; | 0 | ||||||||||||||||||||||||||||||
703 | } | - | ||||||||||||||||||||||||||||||
704 | if (mt == -1
| 845-26018 | ||||||||||||||||||||||||||||||
705 | - | |||||||||||||||||||||||||||||||
706 | st->write_state = WRITE_STATE_POST_WORK; | - | ||||||||||||||||||||||||||||||
707 | st->write_state_work = WORK_MORE_A; | - | ||||||||||||||||||||||||||||||
708 | break; executed 845 times by 1 test: break; Executed by:
| 845 | ||||||||||||||||||||||||||||||
709 | } | - | ||||||||||||||||||||||||||||||
710 | if (!WPACKET_init(&pkt, s->init_buf)
| 0-26018 | ||||||||||||||||||||||||||||||
711 | || !s->method->ssl3_enc->set_handshake_header((s), (&pkt), (mt))
| 0-26018 | ||||||||||||||||||||||||||||||
712 | WPACKET_cleanup(&pkt); | - | ||||||||||||||||||||||||||||||
713 | ossl_statem_fatal((s), (80), (586), ((4|64)), | - | ||||||||||||||||||||||||||||||
714 | __FILE__ | - | ||||||||||||||||||||||||||||||
715 | , | - | ||||||||||||||||||||||||||||||
716 | 838 | - | ||||||||||||||||||||||||||||||
717 | ) | - | ||||||||||||||||||||||||||||||
718 | ; | - | ||||||||||||||||||||||||||||||
719 | return never executed: SUB_STATE_ERROR;return SUB_STATE_ERROR; never executed: return SUB_STATE_ERROR; | 0 | ||||||||||||||||||||||||||||||
720 | } | - | ||||||||||||||||||||||||||||||
721 | if (confunc !=
| 8-26010 | ||||||||||||||||||||||||||||||
722 | ((void *)0)
| 8-26010 | ||||||||||||||||||||||||||||||
723 | && !confunc(s, &pkt)
| 93-25917 | ||||||||||||||||||||||||||||||
724 | WPACKET_cleanup(&pkt); | - | ||||||||||||||||||||||||||||||
725 | do { if (!(((
never executed: } while (0);ossl_statem_fatal((s), (80), ((586)), (256), __FILE__, 843); | 0-93 | ||||||||||||||||||||||||||||||
726 | return executed 93 times by 1 test: SUB_STATE_ERROR;return SUB_STATE_ERROR; Executed by:
executed 93 times by 1 test: return SUB_STATE_ERROR; Executed by:
| 93 | ||||||||||||||||||||||||||||||
727 | } | - | ||||||||||||||||||||||||||||||
728 | if (!s->method->ssl3_enc->close_construct_packet((s), (&pkt), (mt))
| 0-25925 | ||||||||||||||||||||||||||||||
729 | || !WPACKET_finish(&pkt)
| 0-25925 | ||||||||||||||||||||||||||||||
730 | WPACKET_cleanup(&pkt); | - | ||||||||||||||||||||||||||||||
731 | ossl_statem_fatal((s), (80), (586), ((4|64)), | - | ||||||||||||||||||||||||||||||
732 | __FILE__ | - | ||||||||||||||||||||||||||||||
733 | , | - | ||||||||||||||||||||||||||||||
734 | 850 | - | ||||||||||||||||||||||||||||||
735 | ) | - | ||||||||||||||||||||||||||||||
736 | ; | - | ||||||||||||||||||||||||||||||
737 | return never executed: SUB_STATE_ERROR;return SUB_STATE_ERROR; never executed: return SUB_STATE_ERROR; | 0 | ||||||||||||||||||||||||||||||
738 | } | - | ||||||||||||||||||||||||||||||
739 | - | |||||||||||||||||||||||||||||||
740 | - | |||||||||||||||||||||||||||||||
741 | - | |||||||||||||||||||||||||||||||
742 | case never executed: case WRITE_STATE_SEND: code before this statement executed 25925 times by 1 test: case WRITE_STATE_SEND: Executed by:
never executed: WRITE_STATE_SEND:case WRITE_STATE_SEND: code before this statement executed 25925 times by 1 test: case WRITE_STATE_SEND: Executed by:
never executed: case WRITE_STATE_SEND: | 0-25925 | ||||||||||||||||||||||||||||||
743 | if ((
| 535-24034 | ||||||||||||||||||||||||||||||
744 | dtls1_start_timer(s); | - | ||||||||||||||||||||||||||||||
745 | } executed 1356 times by 1 test: end of block Executed by:
| 1356 | ||||||||||||||||||||||||||||||
746 | ret = statem_do_write(s); | - | ||||||||||||||||||||||||||||||
747 | if (ret <= 0
| 0-25925 | ||||||||||||||||||||||||||||||
748 | return never executed: SUB_STATE_ERROR;return SUB_STATE_ERROR; never executed: return SUB_STATE_ERROR; | 0 | ||||||||||||||||||||||||||||||
749 | } | - | ||||||||||||||||||||||||||||||
750 | st->write_state = WRITE_STATE_POST_WORK; | - | ||||||||||||||||||||||||||||||
751 | st->write_state_work = WORK_MORE_A; | - | ||||||||||||||||||||||||||||||
752 | - | |||||||||||||||||||||||||||||||
753 | - | |||||||||||||||||||||||||||||||
754 | case executed 1461 times by 1 test: WRITE_STATE_POST_WORK:case WRITE_STATE_POST_WORK: Executed by:
executed 1461 times by 1 test: case WRITE_STATE_POST_WORK: Executed by:
code before this statement executed 25925 times by 1 test: case WRITE_STATE_POST_WORK: Executed by:
| 1461-25925 | ||||||||||||||||||||||||||||||
755 | switch (st->write_state_work = post_work(s, st->write_state_work)) { | - | ||||||||||||||||||||||||||||||
756 | case never executed: WORK_ERROR:case WORK_ERROR: never executed: case WORK_ERROR: | 0 | ||||||||||||||||||||||||||||||
757 | do { if (!(((
never executed: } while (0);ossl_statem_fatal((s), (80), ((586)), (256), __FILE__, 871); | 0 | ||||||||||||||||||||||||||||||
758 | - | |||||||||||||||||||||||||||||||
759 | case executed 512 times by 1 test: case WORK_MORE_A: Executed by:
code before this statement never executed: case WORK_MORE_A: executed 512 times by 1 test: WORK_MORE_A:case WORK_MORE_A: Executed by:
code before this statement never executed: case WORK_MORE_A: executed 512 times by 1 test: case WORK_MORE_A: Executed by:
| 0-512 | ||||||||||||||||||||||||||||||
760 | case executed 104 times by 1 test: WORK_MORE_B:case WORK_MORE_B: Executed by:
executed 104 times by 1 test: case WORK_MORE_B: Executed by:
| 104 | ||||||||||||||||||||||||||||||
761 | case never executed: WORK_MORE_C:case WORK_MORE_C: never executed: case WORK_MORE_C: | 0 | ||||||||||||||||||||||||||||||
762 | return executed 616 times by 1 test: SUB_STATE_ERROR;return SUB_STATE_ERROR; Executed by:
executed 616 times by 1 test: return SUB_STATE_ERROR; Executed by:
| 616 | ||||||||||||||||||||||||||||||
763 | - | |||||||||||||||||||||||||||||||
764 | case executed 26770 times by 1 test: WORK_FINISHED_CONTINUE:case WORK_FINISHED_CONTINUE: Executed by:
executed 26770 times by 1 test: case WORK_FINISHED_CONTINUE: Executed by:
| 26770 | ||||||||||||||||||||||||||||||
765 | st->write_state = WRITE_STATE_TRANSITION; | - | ||||||||||||||||||||||||||||||
766 | break; executed 26770 times by 1 test: break; Executed by:
| 26770 | ||||||||||||||||||||||||||||||
767 | - | |||||||||||||||||||||||||||||||
768 | case never executed: WORK_FINISHED_STOP:case WORK_FINISHED_STOP: never executed: case WORK_FINISHED_STOP: | 0 | ||||||||||||||||||||||||||||||
769 | return never executed: SUB_STATE_END_HANDSHAKE;return SUB_STATE_END_HANDSHAKE; never executed: return SUB_STATE_END_HANDSHAKE; | 0 | ||||||||||||||||||||||||||||||
770 | } | - | ||||||||||||||||||||||||||||||
771 | break; executed 26770 times by 1 test: break; Executed by:
| 26770 | ||||||||||||||||||||||||||||||
772 | - | |||||||||||||||||||||||||||||||
773 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||
774 | ossl_statem_fatal((s), (80), (586), ((4|64)), | - | ||||||||||||||||||||||||||||||
775 | __FILE__ | - | ||||||||||||||||||||||||||||||
776 | , | - | ||||||||||||||||||||||||||||||
777 | 889 | - | ||||||||||||||||||||||||||||||
778 | ) | - | ||||||||||||||||||||||||||||||
779 | ; | - | ||||||||||||||||||||||||||||||
780 | return never executed: SUB_STATE_ERROR;return SUB_STATE_ERROR; never executed: return SUB_STATE_ERROR; | 0 | ||||||||||||||||||||||||||||||
781 | } | - | ||||||||||||||||||||||||||||||
782 | } | - | ||||||||||||||||||||||||||||||
783 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
784 | - | |||||||||||||||||||||||||||||||
785 | - | |||||||||||||||||||||||||||||||
786 | - | |||||||||||||||||||||||||||||||
787 | - | |||||||||||||||||||||||||||||||
788 | int statem_flush(SSL *s) | - | ||||||||||||||||||||||||||||||
789 | { | - | ||||||||||||||||||||||||||||||
790 | s->rwstate = 2; | - | ||||||||||||||||||||||||||||||
791 | if ((
| 616-11529 | ||||||||||||||||||||||||||||||
792 | ((void *)0)
| 616-11529 | ||||||||||||||||||||||||||||||
793 | ) <= 0
| 616-11529 | ||||||||||||||||||||||||||||||
794 | return executed 616 times by 1 test: 0;return 0; Executed by:
executed 616 times by 1 test: return 0; Executed by:
| 616 | ||||||||||||||||||||||||||||||
795 | } | - | ||||||||||||||||||||||||||||||
796 | s->rwstate = 1; | - | ||||||||||||||||||||||||||||||
797 | - | |||||||||||||||||||||||||||||||
798 | return executed 11529 times by 1 test: 1;return 1; Executed by:
executed 11529 times by 1 test: return 1; Executed by:
| 11529 | ||||||||||||||||||||||||||||||
799 | } | - | ||||||||||||||||||||||||||||||
800 | int ossl_statem_app_data_allowed(SSL *s) | - | ||||||||||||||||||||||||||||||
801 | { | - | ||||||||||||||||||||||||||||||
802 | OSSL_STATEM *st = &s->statem; | - | ||||||||||||||||||||||||||||||
803 | - | |||||||||||||||||||||||||||||||
804 | if (st->state == MSG_FLOW_UNINITED
| 0-219 | ||||||||||||||||||||||||||||||
805 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||
806 | - | |||||||||||||||||||||||||||||||
807 | if (!s->s3->in_read_app_data
| 0-213 | ||||||||||||||||||||||||||||||
808 | return executed 219 times by 1 test: 0;return 0; Executed by:
executed 219 times by 1 test: return 0; Executed by:
| 219 | ||||||||||||||||||||||||||||||
809 | - | |||||||||||||||||||||||||||||||
810 | if (s->server
| 0 | ||||||||||||||||||||||||||||||
811 | - | |||||||||||||||||||||||||||||||
812 | - | |||||||||||||||||||||||||||||||
813 | - | |||||||||||||||||||||||||||||||
814 | - | |||||||||||||||||||||||||||||||
815 | if (st->hand_state == TLS_ST_BEFORE
| 0 | ||||||||||||||||||||||||||||||
816 | || st->hand_state == TLS_ST_SR_CLNT_HELLO
| 0 | ||||||||||||||||||||||||||||||
817 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||||||||
818 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
819 | - | |||||||||||||||||||||||||||||||
820 | - | |||||||||||||||||||||||||||||||
821 | - | |||||||||||||||||||||||||||||||
822 | - | |||||||||||||||||||||||||||||||
823 | if (st->hand_state == TLS_ST_CW_CLNT_HELLO
| 0 | ||||||||||||||||||||||||||||||
824 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||||||||
825 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
826 | - | |||||||||||||||||||||||||||||||
827 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||
828 | } | - | ||||||||||||||||||||||||||||||
829 | - | |||||||||||||||||||||||||||||||
830 | - | |||||||||||||||||||||||||||||||
831 | - | |||||||||||||||||||||||||||||||
832 | - | |||||||||||||||||||||||||||||||
833 | - | |||||||||||||||||||||||||||||||
834 | int ossl_statem_export_allowed(SSL *s) | - | ||||||||||||||||||||||||||||||
835 | { | - | ||||||||||||||||||||||||||||||
836 | return executed 6 times by 1 test: s->s3->previous_server_finished_len != 0return s->s3->previous_server_finished_len != 0 && s->statem.hand_state != TLS_ST_SW_FINISHED; Executed by:
executed 6 times by 1 test: return s->s3->previous_server_finished_len != 0 && s->statem.hand_state != TLS_ST_SW_FINISHED; Executed by:
| 0-6 | ||||||||||||||||||||||||||||||
837 | && s->statem.hand_state != TLS_ST_SW_FINISHED
executed 6 times by 1 test: return s->s3->previous_server_finished_len != 0 && s->statem.hand_state != TLS_ST_SW_FINISHED; Executed by:
| 0-6 | ||||||||||||||||||||||||||||||
838 | } | - | ||||||||||||||||||||||||||||||
839 | - | |||||||||||||||||||||||||||||||
840 | - | |||||||||||||||||||||||||||||||
841 | - | |||||||||||||||||||||||||||||||
842 | - | |||||||||||||||||||||||||||||||
843 | - | |||||||||||||||||||||||||||||||
844 | int ossl_statem_export_early_allowed(SSL *s) | - | ||||||||||||||||||||||||||||||
845 | { | - | ||||||||||||||||||||||||||||||
846 | - | |||||||||||||||||||||||||||||||
847 | - | |||||||||||||||||||||||||||||||
848 | - | |||||||||||||||||||||||||||||||
849 | - | |||||||||||||||||||||||||||||||
850 | - | |||||||||||||||||||||||||||||||
851 | return executed 12 times by 1 test: s->ext.early_data == 2return s->ext.early_data == 2 || (!s->server && s->ext.early_data != 0); Executed by:
executed 12 times by 1 test: return s->ext.early_data == 2 || (!s->server && s->ext.early_data != 0); Executed by:
| 6-12 | ||||||||||||||||||||||||||||||
852 | || (!s->server
executed 12 times by 1 test: return s->ext.early_data == 2 || (!s->server && s->ext.early_data != 0); Executed by:
| 0-12 | ||||||||||||||||||||||||||||||
853 | } | - | ||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |