OpenCoverage

d1_lib.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/ssl/d1_lib.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3static void get_current_time(struct timeval *t);-
4static int dtls1_handshake_write(SSL *s);-
5static size_t dtls1_link_min_mtu(void);-
6-
7-
8static const size_t g_probable_mtu[] = { 1500, 512, 256 };-
9-
10const SSL3_ENC_METHOD DTLSv1_enc_data = {-
11 tls1_enc,-
12 tls1_mac,-
13 tls1_setup_key_block,-
14 tls1_generate_master_secret,-
15 tls1_change_cipher_state,-
16 tls1_final_finish_mac,-
17 "client finished", 15,-
18 "server finished", 15,-
19 tls1_alert_code,-
20 tls1_export_keying_material,-
21 0x8 | 0x1,-
22 dtls1_set_handshake_header,-
23 dtls1_close_construct_packet,-
24 dtls1_handshake_write-
25};-
26-
27const SSL3_ENC_METHOD DTLSv1_2_enc_data = {-
28 tls1_enc,-
29 tls1_mac,-
30 tls1_setup_key_block,-
31 tls1_generate_master_secret,-
32 tls1_change_cipher_state,-
33 tls1_final_finish_mac,-
34 "client finished", 15,-
35 "server finished", 15,-
36 tls1_alert_code,-
37 tls1_export_keying_material,-
38 0x8 | 0x1 | 0x2-
39 | 0x4 | 0x10,-
40 dtls1_set_handshake_header,-
41 dtls1_close_construct_packet,-
42 dtls1_handshake_write-
43};-
44-
45long dtls1_default_timeout(void)-
46{-
47-
48-
49-
50-
51 return
executed 305 times by 1 test: return (60 * 60 * 2);
Executed by:
  • libssl.so.1.1
(60 * 60 * 2);
executed 305 times by 1 test: return (60 * 60 * 2);
Executed by:
  • libssl.so.1.1
305
52}-
53-
54int dtls1_new(SSL *s)-
55{-
56 DTLS1_STATE *d1;-
57-
58 if (!DTLS_RECORD_LAYER_new(&s->rlayer)
!DTLS_RECORD_L...ew(&s->rlayer)Description
TRUEnever evaluated
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-373
59 return
never executed: return 0;
0;
never executed: return 0;
0
60 }-
61-
62 if (!ssl3_new(s)
!ssl3_new(s)Description
TRUEnever evaluated
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-373
63 return
never executed: return 0;
0;
never executed: return 0;
0
64 if ((
(d1 = CRYPTO_z...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
d1 = CRYPTO_zalloc(sizeof(*d1), __FILE__, 77)) ==
(d1 = CRYPTO_z...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-373
65 ((void *)0)
(d1 = CRYPTO_z...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-373
66 ) {-
67 ssl3_free(s);-
68 return
never executed: return 0;
0;
never executed: return 0;
0
69 }-
70-
71 d1->buffered_messages = pqueue_new();-
72 d1->sent_messages = pqueue_new();-
73-
74 if (s->server
s->serverDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 372 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
1-372
75 d1->cookie_len = sizeof(s->d1->cookie);-
76 }
executed 1 time by 1 test: end of block
Executed by:
  • libssl.so.1.1
1
77-
78 d1->link_mtu = 0;-
79 d1->mtu = 0;-
80-
81 if (d1->buffered_messages ==
d1->buffered_m...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-373
82 ((void *)0)
d1->buffered_m...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-373
83 || d1->sent_messages ==
d1->sent_messa...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-373
84 ((void *)0)
d1->sent_messa...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-373
85 ) {-
86 pqueue_free(d1->buffered_messages);-
87 pqueue_free(d1->sent_messages);-
88 CRYPTO_free(d1, __FILE__, 95);-
89 ssl3_free(s);-
90 return
never executed: return 0;
0;
never executed: return 0;
0
91 }-
92-
93 s->d1 = d1;-
94-
95 if (!s->method->ssl_clear(s)
!s->method->ssl_clear(s)Description
TRUEnever evaluated
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-373
96 return
never executed: return 0;
0;
never executed: return 0;
0
97-
98 return
executed 373 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
1;
executed 373 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
373
99}-
100-
101static void dtls1_clear_queues(SSL *s)-
102{-
103 dtls1_clear_received_buffer(s);-
104 dtls1_clear_sent_buffer(s);-
105}
executed 1490 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
1490
106-
107void dtls1_clear_received_buffer(SSL *s)-
108{-
109 pitem *item = -
110 ((void *)0)-
111 ;-
112 hm_fragment *frag = -
113 ((void *)0)-
114 ;-
115-
116 while ((
(item = pqueue...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2200 times by 1 test
Evaluated by:
  • libssl.so.1.1
item = pqueue_pop(s->d1->buffered_messages)) !=
(item = pqueue...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2200 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-2200
117 ((void *)0)
(item = pqueue...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2200 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-2200
118 ) {-
119 frag = (hm_fragment *)item->data;-
120 dtls1_hm_fragment_free(frag);-
121 pitem_free(item);-
122 }
never executed: end of block
0
123}
executed 2200 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
2200
124-
125void dtls1_clear_sent_buffer(SSL *s)-
126{-
127 pitem *item = -
128 ((void *)0)-
129 ;-
130 hm_fragment *frag = -
131 ((void *)0)-
132 ;-
133-
134 while ((
(item = pqueue...!= ((void *)0)Description
TRUEevaluated 1891 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 2319 times by 1 test
Evaluated by:
  • libssl.so.1.1
item = pqueue_pop(s->d1->sent_messages)) !=
(item = pqueue...!= ((void *)0)Description
TRUEevaluated 1891 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 2319 times by 1 test
Evaluated by:
  • libssl.so.1.1
1891-2319
135 ((void *)0)
(item = pqueue...!= ((void *)0)Description
TRUEevaluated 1891 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 2319 times by 1 test
Evaluated by:
  • libssl.so.1.1
1891-2319
136 ) {-
137 frag = (hm_fragment *)item->data;-
138 dtls1_hm_fragment_free(frag);-
139 pitem_free(item);-
140 }
executed 1891 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
1891
141}
executed 2319 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
2319
142-
143-
144void dtls1_free(SSL *s)-
145{-
146 DTLS_RECORD_LAYER_free(&s->rlayer);-
147-
148 ssl3_free(s);-
149-
150 dtls1_clear_queues(s);-
151-
152 pqueue_free(s->d1->buffered_messages);-
153 pqueue_free(s->d1->sent_messages);-
154-
155 CRYPTO_free(s->d1, __FILE__, 150);-
156 s->d1 = -
157 ((void *)0)-
158 ;-
159}
executed 373 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
373
160-
161int dtls1_clear(SSL *s)-
162{-
163 pqueue *buffered_messages;-
164 pqueue *sent_messages;-
165 size_t mtu;-
166 size_t link_mtu;-
167-
168 DTLS_RECORD_LAYER_clear(&s->rlayer);-
169-
170 if (s->d1
s->d1Description
TRUEevaluated 1117 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 373 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
373-1117
171 DTLS_timer_cb timer_cb = s->d1->timer_cb;-
172-
173 buffered_messages = s->d1->buffered_messages;-
174 sent_messages = s->d1->sent_messages;-
175 mtu = s->d1->mtu;-
176 link_mtu = s->d1->link_mtu;-
177-
178 dtls1_clear_queues(s);-
179-
180 memset(s->d1, 0, sizeof(*s->d1));-
181-
182-
183 s->d1->timer_cb = timer_cb;-
184-
185 if (s->server
s->serverDescription
TRUEevaluated 408 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 709 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
408-709
186 s->d1->cookie_len = sizeof(s->d1->cookie);-
187 }
executed 408 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
408
188-
189 if (SSL_get_options(s) & 0x00001000U
SSL_get_option... & 0x00001000UDescription
TRUEnever evaluated
FALSEevaluated 1117 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-1117
190 s->d1->mtu = mtu;-
191 s->d1->link_mtu = link_mtu;-
192 }
never executed: end of block
0
193-
194 s->d1->buffered_messages = buffered_messages;-
195 s->d1->sent_messages = sent_messages;-
196 }
executed 1117 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
1117
197-
198 if (!ssl3_clear(s)
!ssl3_clear(s)Description
TRUEnever evaluated
FALSEevaluated 1490 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-1490
199 return
never executed: return 0;
0;
never executed: return 0;
0
200-
201 if (s->method->version == 0x1FFFF
s->method->version == 0x1FFFFDescription
TRUEevaluated 1490 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
)
0-1490
202 s->version = 0xFEFD;
executed 1490 times by 1 test: s->version = 0xFEFD;
Executed by:
  • libssl.so.1.1
1490
203-
204 else if (s->options & 0x00008000U
s->options & 0x00008000UDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
205 s->client_version = s->version = 0x0100;
never executed: s->client_version = s->version = 0x0100;
0
206-
207 else-
208 s->version = s->method->version;
never executed: s->version = s->method->version;
0
209-
210 return
executed 1490 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
1;
executed 1490 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
1490
211}-
212-
213long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg)-
214{-
215 int ret = 0;-
216-
217 switch (cmd) {-
218 case
never executed: case 73:
73:
never executed: case 73:
0
219 if (dtls1_get_timeout(s, (struct timeval *)parg) !=
dtls1_get_time...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
220 ((void *)0)
dtls1_get_time...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
221 ) {-
222 ret = 1;-
223 }
never executed: end of block
0
224 break;
never executed: break;
0
225 case
executed 102 times by 1 test: case 74:
Executed by:
  • libssl.so.1.1
74:
executed 102 times by 1 test: case 74:
Executed by:
  • libssl.so.1.1
102
226 ret = dtls1_handle_timeout(s);-
227 break;
executed 102 times by 1 test: break;
Executed by:
  • libssl.so.1.1
102
228 case
never executed: case 120:
120:
never executed: case 120:
0
229 if (larg < (long)dtls1_link_min_mtu()
larg < (long)d...link_min_mtu()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
230 return
never executed: return 0;
0;
never executed: return 0;
0
231 s->d1->link_mtu = larg;-
232 return
never executed: return 1;
1;
never executed: return 1;
0
233 case
never executed: case 121:
121:
never executed: case 121:
0
234 return
never executed: return (long)dtls1_link_min_mtu();
(long)dtls1_link_min_mtu();
never executed: return (long)dtls1_link_min_mtu();
0
235 case
executed 837 times by 1 test: case 17:
Executed by:
  • libssl.so.1.1
17:
executed 837 times by 1 test: case 17:
Executed by:
  • libssl.so.1.1
837
236-
237-
238-
239-
240 if (larg < (long)dtls1_link_min_mtu() - 48
larg < (long)d...min_mtu() - 48Description
TRUEnever evaluated
FALSEevaluated 837 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-837
241 return
never executed: return 0;
0;
never executed: return 0;
0
242 s->d1->mtu = larg;-
243 return
executed 837 times by 1 test: return larg;
Executed by:
  • libssl.so.1.1
larg;
executed 837 times by 1 test: return larg;
Executed by:
  • libssl.so.1.1
837
244 default
executed 361 times by 1 test: default:
Executed by:
  • libssl.so.1.1
:
executed 361 times by 1 test: default:
Executed by:
  • libssl.so.1.1
361
245 ret = ssl3_ctrl(s, cmd, larg, parg);-
246 break;
executed 361 times by 1 test: break;
Executed by:
  • libssl.so.1.1
361
247 }-
248 return
executed 463 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
ret;
executed 463 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
463
249}-
250-
251void dtls1_start_timer(SSL *s)-
252{-
253 unsigned int sec, usec;-
254 if (s->d1->next_timeout.tv_sec == 0
s->d1->next_ti...ut.tv_sec == 0Description
TRUEevaluated 721 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 858 times by 1 test
Evaluated by:
  • libssl.so.1.1
&& s->d1->next_timeout.tv_usec == 0
s->d1->next_ti...t.tv_usec == 0Description
TRUEevaluated 721 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
) {
0-858
255-
256 if (s->d1->timer_cb !=
s->d1->timer_cb != ((void *)0)Description
TRUEevaluated 93 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 628 times by 1 test
Evaluated by:
  • libssl.so.1.1
93-628
257 ((void *)0)
s->d1->timer_cb != ((void *)0)Description
TRUEevaluated 93 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 628 times by 1 test
Evaluated by:
  • libssl.so.1.1
93-628
258 )-
259 s->d1->timeout_duration_us = s->d1->timer_cb(s, 0);
executed 93 times by 1 test: s->d1->timeout_duration_us = s->d1->timer_cb(s, 0);
Executed by:
  • libssl.so.1.1
93
260 else-
261 s->d1->timeout_duration_us = 1000000;
executed 628 times by 1 test: s->d1->timeout_duration_us = 1000000;
Executed by:
  • libssl.so.1.1
628
262 }-
263-
264-
265 get_current_time(&(s->d1->next_timeout));-
266-
267-
268-
269 sec = s->d1->timeout_duration_us / 1000000;-
270 usec = s->d1->timeout_duration_us - (sec * 1000000);-
271-
272 s->d1->next_timeout.tv_sec += sec;-
273 s->d1->next_timeout.tv_usec += usec;-
274-
275 if (s->d1->next_timeout.tv_usec >= 1000000
s->d1->next_ti...sec >= 1000000Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 1571 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
8-1571
276 s->d1->next_timeout.tv_sec++;-
277 s->d1->next_timeout.tv_usec -= 1000000;-
278 }
executed 8 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
8
279-
280 BIO_ctrl(SSL_get_rbio(s), 45, 0,-
281 &(s->d1->next_timeout));-
282}
executed 1579 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
1579
283-
284struct timeval *dtls1_get_timeout(SSL *s, struct timeval *timeleft)-
285{-
286 struct timeval timenow;-
287-
288-
289 if (s->d1->next_timeout.tv_sec == 0
s->d1->next_ti...ut.tv_sec == 0Description
TRUEevaluated 1284 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 7067 times by 1 test
Evaluated by:
  • libssl.so.1.1
&& s->d1->next_timeout.tv_usec == 0
s->d1->next_ti...t.tv_usec == 0Description
TRUEevaluated 1284 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
) {
0-7067
290 return
executed 1284 times by 1 test: return ((void *)0) ;
Executed by:
  • libssl.so.1.1
executed 1284 times by 1 test: return ((void *)0) ;
Executed by:
  • libssl.so.1.1
1284
291 ((void *)0)
executed 1284 times by 1 test: return ((void *)0) ;
Executed by:
  • libssl.so.1.1
1284
292 ;
executed 1284 times by 1 test: return ((void *)0) ;
Executed by:
  • libssl.so.1.1
1284
293 }-
294-
295-
296 get_current_time(&timenow);-
297-
298-
299 if (s->d1->next_timeout.tv_sec < timenow.tv_sec
s->d1->next_ti...timenow.tv_secDescription
TRUEnever evaluated
FALSEevaluated 7067 times by 1 test
Evaluated by:
  • libssl.so.1.1
||
0-7067
300 (s->d1->next_timeout.tv_sec == timenow.tv_sec
s->d1->next_ti...timenow.tv_secDescription
TRUEevaluated 1813 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 5254 times by 1 test
Evaluated by:
  • libssl.so.1.1
&&
1813-5254
301 s->d1->next_timeout.tv_usec <= timenow.tv_usec
s->d1->next_ti...imenow.tv_usecDescription
TRUEevaluated 45 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 1768 times by 1 test
Evaluated by:
  • libssl.so.1.1
)) {
45-1768
302 memset(timeleft, 0, sizeof(*timeleft));-
303 return
executed 45 times by 1 test: return timeleft;
Executed by:
  • libssl.so.1.1
timeleft;
executed 45 times by 1 test: return timeleft;
Executed by:
  • libssl.so.1.1
45
304 }-
305-
306-
307 memcpy(timeleft, &(s->d1->next_timeout), sizeof(struct timeval));-
308 timeleft->tv_sec -= timenow.tv_sec;-
309 timeleft->tv_usec -= timenow.tv_usec;-
310 if (timeleft->tv_usec < 0
timeleft->tv_usec < 0Description
TRUEevaluated 5254 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 1768 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
1768-5254
311 timeleft->tv_sec--;-
312 timeleft->tv_usec += 1000000;-
313 }
executed 5254 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
5254
314-
315-
316-
317-
318-
319 if (timeleft->tv_sec == 0
timeleft->tv_sec == 0Description
TRUEevaluated 7022 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
&& timeleft->tv_usec < 15000
timeleft->tv_usec < 15000Description
TRUEnever evaluated
FALSEevaluated 7022 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-7022
320 memset(timeleft, 0, sizeof(*timeleft));-
321 }
never executed: end of block
0
322-
323 return
executed 7022 times by 1 test: return timeleft;
Executed by:
  • libssl.so.1.1
timeleft;
executed 7022 times by 1 test: return timeleft;
Executed by:
  • libssl.so.1.1
7022
324}-
325-
326int dtls1_is_timer_expired(SSL *s)-
327{-
328 struct timeval timeleft;-
329-
330-
331 if (dtls1_get_timeout(s, &timeleft) ==
dtls1_get_time...== ((void *)0)Description
TRUEevaluated 1284 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 7067 times by 1 test
Evaluated by:
  • libssl.so.1.1
1284-7067
332 ((void *)0)
dtls1_get_time...== ((void *)0)Description
TRUEevaluated 1284 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 7067 times by 1 test
Evaluated by:
  • libssl.so.1.1
1284-7067
333 ) {-
334 return
executed 1284 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
0;
executed 1284 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
1284
335 }-
336-
337-
338 if (timeleft.tv_sec > 0
timeleft.tv_sec > 0Description
TRUEnever evaluated
FALSEevaluated 7067 times by 1 test
Evaluated by:
  • libssl.so.1.1
|| timeleft.tv_usec > 0
timeleft.tv_usec > 0Description
TRUEevaluated 7022 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 45 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-7067
339 return
executed 7022 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
0;
executed 7022 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
7022
340 }-
341-
342-
343 return
executed 45 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
1;
executed 45 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
45
344}-
345-
346void dtls1_double_timeout(SSL *s)-
347{-
348 s->d1->timeout_duration_us *= 2;-
349 if (s->d1->timeout_duration_us > 60000000
s->d1->timeout..._us > 60000000Description
TRUEnever evaluated
FALSEnever evaluated
)
0
350 s->d1->timeout_duration_us = 60000000;
never executed: s->d1->timeout_duration_us = 60000000;
0
351 dtls1_start_timer(s);-
352}
never executed: end of block
0
353-
354void dtls1_stop_timer(SSL *s)-
355{-
356-
357 memset(&s->d1->timeout, 0, sizeof(s->d1->timeout));-
358 memset(&s->d1->next_timeout, 0, sizeof(s->d1->next_timeout));-
359 s->d1->timeout_duration_us = 1000000;-
360 BIO_ctrl(SSL_get_rbio(s), 45, 0,-
361 &(s->d1->next_timeout));-
362-
363 dtls1_clear_sent_buffer(s);-
364}
executed 826 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
826
365-
366int dtls1_check_timeout_num(SSL *s)-
367{-
368 size_t mtu;-
369-
370 s->d1->timeout.num_alerts++;-
371-
372-
373 if (s->d1->timeout.num_alerts > 2
s->d1->timeout.num_alerts > 2Description
TRUEnever evaluated
FALSEevaluated 51 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-51
374 && !(SSL_get_options(s) & 0x00001000U)
!(SSL_get_opti...& 0x00001000U)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
375 mtu =-
376 BIO_ctrl(SSL_get_wbio(s), 47, 0, -
377 ((void *)0)-
378 );-
379 if (mtu < s->d1->mtu
mtu < s->d1->mtuDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
380 s->d1->mtu = mtu;
never executed: s->d1->mtu = mtu;
0
381 }
never executed: end of block
0
382-
383 if (s->d1->timeout.num_alerts > 12
s->d1->timeout.num_alerts > 12Description
TRUEnever evaluated
FALSEevaluated 51 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-51
384-
385 ossl_statem_fatal((s), (-1), (318), (312),-
386 __FILE__-
387 ,-
388 382-
389 )-
390 ;-
391 return
never executed: return -1;
-1;
never executed: return -1;
0
392 }-
393-
394 return
executed 51 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
0;
executed 51 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
51
395}-
396-
397int dtls1_handle_timeout(SSL *s)-
398{-
399-
400 if (!dtls1_is_timer_expired(s)
!dtls1_is_timer_expired(s)Description
TRUEevaluated 7102 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 45 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
45-7102
401 return
executed 7102 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
0;
executed 7102 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
7102
402 }-
403-
404 if (s->d1->timer_cb !=
s->d1->timer_cb != ((void *)0)Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
0-45
405 ((void *)0)
s->d1->timer_cb != ((void *)0)Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
0-45
406 )-
407 s->d1->timeout_duration_us = s->d1->timer_cb(s, s->d1->timeout_duration_us);
executed 45 times by 1 test: s->d1->timeout_duration_us = s->d1->timer_cb(s, s->d1->timeout_duration_us);
Executed by:
  • libssl.so.1.1
45
408 else-
409 dtls1_double_timeout(s);
never executed: dtls1_double_timeout(s);
0
410-
411 if (dtls1_check_timeout_num(s) < 0
dtls1_check_timeout_num(s) < 0Description
TRUEnever evaluated
FALSEevaluated 45 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-45
412-
413 return
never executed: return -1;
-1;
never executed: return -1;
0
414 }-
415-
416 s->d1->timeout.read_timeouts++;-
417 if (s->d1->timeout.read_timeouts > 2
s->d1->timeout...d_timeouts > 2Description
TRUEnever evaluated
FALSEevaluated 45 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-45
418 s->d1->timeout.read_timeouts = 1;-
419 }
never executed: end of block
0
420-
421 dtls1_start_timer(s);-
422-
423 return
executed 45 times by 1 test: return dtls1_retransmit_buffered_messages(s);
Executed by:
  • libssl.so.1.1
dtls1_retransmit_buffered_messages(s);
executed 45 times by 1 test: return dtls1_retransmit_buffered_messages(s);
Executed by:
  • libssl.so.1.1
45
424}-
425-
426static void get_current_time(struct timeval *t)-
427{-
428 gettimeofday(t, -
429 ((void *)0)-
430 );-
431-
432}
executed 8646 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
8646
433-
434-
435-
436-
437-
438int DTLSv1_listen(SSL *s, BIO_ADDR *client)-
439{-
440 int next, n, ret = 0, clearpkt = 0;-
441 unsigned char cookie[256];-
442 unsigned char seq[8];-
443 const unsigned char *data;-
444 unsigned char *buf;-
445 size_t fragoff, fraglen, msglen;-
446 unsigned int rectype, versmajor, msgseq, msgtype, clientvers, cookielen;-
447 BIO *rbio, *wbio;-
448 BUF_MEM *bufm;-
449 BIO_ADDR *tmpclient = -
450 ((void *)0)-
451 ;-
452 PACKET pkt, msgpkt, msgpayload, session, cookiepkt;-
453-
454 if (s->handshake_func ==
s->handshake_f...== ((void *)0)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
0-9
455 ((void *)0)
s->handshake_f...== ((void *)0)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
0-9
456 ) {-
457-
458 SSL_set_accept_state(s);-
459 }
executed 9 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
9
460-
461-
462 if (!SSL_clear(s)
!SSL_clear(s)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-9
463 return
never executed: return -1;
-1;
never executed: return -1;
0
464-
465 ERR_clear_error();-
466-
467 rbio = SSL_get_rbio(s);-
468 wbio = SSL_get_wbio(s);-
469-
470 if (!rbio
!rbioDescription
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
|| !wbio
!wbioDescription
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-9
471 ERR_put_error(20,(350),(128),__FILE__,475);-
472 return
never executed: return -1;
-1;
never executed: return -1;
0
473 }-
474-
475-
476-
477-
478-
479-
480 BIO_ctrl(SSL_get_rbio(s), 71, 1, -
481 ((void *)0)-
482 );-
483 if ((
(s->version & ...FEFF & 0xff00)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
s->version & 0xff00) != (0xFEFF & 0xff00)
(s->version & ...FEFF & 0xff00)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-9
484 ERR_put_error(20,(350),(259),__FILE__,494);-
485 return
never executed: return -1;
-1;
never executed: return -1;
0
486 }-
487-
488 if (s->init_buf ==
s->init_buf == ((void *)0)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
0-9
489 ((void *)0)
s->init_buf == ((void *)0)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
0-9
490 ) {-
491 if ((
(bufm = BUF_ME...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
bufm = BUF_MEM_new()) ==
(bufm = BUF_ME...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-9
492 ((void *)0)
(bufm = BUF_ME...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-9
493 ) {-
494 ERR_put_error(20,(350),((1|64)),__FILE__,500);-
495 return
never executed: return -1;
-1;
never executed: return -1;
0
496 }-
497-
498 if (!BUF_MEM_grow(bufm, 16384)
!BUF_MEM_grow(bufm, 16384)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-9
499 BUF_MEM_free(bufm);-
500 ERR_put_error(20,(350),((1|64)),__FILE__,506);-
501 return
never executed: return -1;
-1;
never executed: return -1;
0
502 }-
503 s->init_buf = bufm;-
504 }
executed 9 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
9
505 buf = (unsigned char *)s->init_buf->data;-
506-
507 do {-
508-
509-
510 -
511 (*__errno_location ())-
512 =0;-
513 n = BIO_read(rbio, buf, 16384);-
514-
515 if (n <= 0
n <= 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
3-9
516 if (BIO_test_flags(rbio, 0x08)
BIO_test_flags(rbio, 0x08)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
) {
0-3
517-
518 goto
executed 3 times by 1 test: goto end;
Executed by:
  • libssl.so.1.1
end;
executed 3 times by 1 test: goto end;
Executed by:
  • libssl.so.1.1
3
519 }-
520 return
never executed: return -1;
-1;
never executed: return -1;
0
521 }-
522-
523-
524 clearpkt = 1;-
525-
526 if (!PACKET_buf_init(&pkt, buf, n)
!PACKET_buf_init(&pkt, buf, n)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-9
527 ERR_put_error(20,(350),((4|64)),__FILE__,539);-
528 return
never executed: return -1;
-1;
never executed: return -1;
0
529 }-
530 if (n < 13
n < 13Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
1-8
531 ERR_put_error(20,(350),(298),__FILE__,554);-
532 goto
executed 1 time by 1 test: goto end;
Executed by:
  • libssl.so.1.1
end;
executed 1 time by 1 test: goto end;
Executed by:
  • libssl.so.1.1
1
533 }-
534-
535 if (s->msg_callback
s->msg_callbackDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-8
536 s->msg_callback(0, 0, 0x100, buf,
never executed: s->msg_callback(0, 0, 0x100, buf, 13, s, s->msg_callback_arg);
0
537 13, s, s->msg_callback_arg);
never executed: s->msg_callback(0, 0, 0x100, buf, 13, s, s->msg_callback_arg);
0
538-
539-
540 if (!PACKET_get_1(&pkt, &rectype)
!PACKET_get_1(&pkt, &rectype)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-8
541 || !PACKET_get_1(&pkt, &versmajor)
!PACKET_get_1(...t, &versmajor)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-8
542 ERR_put_error(20,(350),(159),__FILE__,565);-
543 goto
never executed: goto end;
end;
never executed: goto end;
0
544 }-
545-
546 if (rectype != 22
rectype != 22Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-8
547 ERR_put_error(20,(350),(244),__FILE__,570);-
548 goto
never executed: goto end;
end;
never executed: goto end;
0
549 }-
550-
551-
552-
553-
554-
555 if (versmajor != 0xFE
versmajor != 0xFEDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-8
556 ERR_put_error(20,(350),(116),__FILE__,579);-
557 goto
never executed: goto end;
end;
never executed: goto end;
0
558 }-
559-
560 if (!PACKET_forward(&pkt, 1)
!PACKET_forward(&pkt, 1)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-8
561-
562 || !PACKET_copy_bytes(&pkt, seq, 8)
!PACKET_copy_b...(&pkt, seq, 8)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-8
563 || !PACKET_get_length_prefixed_2(&pkt, &msgpkt)
!PACKET_get_le...&pkt, &msgpkt)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-8
564 ERR_put_error(20,(350),(159),__FILE__,587);-
565 goto
never executed: goto end;
end;
never executed: goto end;
0
566 }-
567-
568-
569-
570-
571-
572-
573 if (seq[0] != 0
seq[0] != 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
|| seq[1] != 0
seq[1] != 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-8
574 ERR_put_error(20,(350),(244),__FILE__,597);-
575 goto
never executed: goto end;
end;
never executed: goto end;
0
576 }-
577-
578-
579 data = PACKET_data(&msgpkt);-
580-
581-
582 if (!PACKET_get_1(&msgpkt, &msgtype)
!PACKET_get_1(...pkt, &msgtype)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-8
583 || !PACKET_get_net_3_len(&msgpkt, &msglen)
!PACKET_get_ne...gpkt, &msglen)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-8
584 || !PACKET_get_net_2(&msgpkt, &msgseq)
!PACKET_get_ne...gpkt, &msgseq)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-8
585 || !PACKET_get_net_3_len(&msgpkt, &fragoff)
!PACKET_get_ne...pkt, &fragoff)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-8
586 || !PACKET_get_net_3_len(&msgpkt, &fraglen)
!PACKET_get_ne...pkt, &fraglen)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-8
587 || !PACKET_get_sub_packet(&msgpkt, &msgpayload, fraglen)
!PACKET_get_su...load, fraglen)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-8
588 || PACKET_remaining(&msgpkt) != 0
PACKET_remaining(&msgpkt) != 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-8
589 ERR_put_error(20,(350),(159),__FILE__,612);-
590 goto
never executed: goto end;
end;
never executed: goto end;
0
591 }-
592-
593 if (msgtype != 1
msgtype != 1Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-8
594 ERR_put_error(20,(350),(244),__FILE__,617);-
595 goto
never executed: goto end;
end;
never executed: goto end;
0
596 }-
597-
598-
599 if (msgseq > 2
msgseq > 2Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-8
600 ERR_put_error(20,(350),(402),__FILE__,623);-
601 goto
never executed: goto end;
end;
never executed: goto end;
0
602 }-
603 if (fragoff != 0
fragoff != 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libssl.so.1.1
|| fraglen > msglen
fraglen > msglenDescription
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-7
604-
605 ERR_put_error(20,(350),(401),__FILE__,636);-
606 goto
executed 1 time by 1 test: goto end;
Executed by:
  • libssl.so.1.1
end;
executed 1 time by 1 test: goto end;
Executed by:
  • libssl.so.1.1
1
607 }-
608-
609 if (s->msg_callback
s->msg_callbackDescription
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-7
610 s->msg_callback(0, s->version, 22, data,
never executed: s->msg_callback(0, s->version, 22, data, fraglen + 12, s, s->msg_callback_arg);
0
611 fraglen + 12, s,
never executed: s->msg_callback(0, s->version, 22, data, fraglen + 12, s, s->msg_callback_arg);
0
612 s->msg_callback_arg);
never executed: s->msg_callback(0, s->version, 22, data, fraglen + 12, s, s->msg_callback_arg);
0
613-
614 if (!PACKET_get_net_2(&msgpayload, &clientvers)
!PACKET_get_ne..., &clientvers)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-7
615 ERR_put_error(20,(350),(159),__FILE__,646);-
616 goto
never executed: goto end;
end;
never executed: goto end;
0
617 }-
618-
619-
620-
621-
622 if (((((
((((clientvers...od->version)))Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libssl.so.1.1
clientvers) == 0x0100) ? 0xff00 : (clientvers)) > ((((unsigned int)s->method->version) == 0x0100) ? 0xff00 : ((unsigned int)s->method->version)))
((((clientvers...od->version)))Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libssl.so.1.1
&&
0-7
623 s->method->version != 0x1FFFF
s->method->version != 0x1FFFFDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
624 ERR_put_error(20,(350),(267),__FILE__,655);-
625 goto
never executed: goto end;
end;
never executed: goto end;
0
626 }-
627-
628 if (!PACKET_forward(&msgpayload, 32)
!PACKET_forwar...sgpayload, 32)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-7
629 || !PACKET_get_length_prefixed_1(&msgpayload, &session)
!PACKET_get_le...oad, &session)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-7
630 || !PACKET_get_length_prefixed_1(&msgpayload, &cookiepkt)
!PACKET_get_le...d, &cookiepkt)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
2-5
631-
632-
633-
634-
635 ERR_put_error(20,(350),(159),__FILE__,666);-
636 goto
executed 2 times by 1 test: goto end;
Executed by:
  • libssl.so.1.1
end;
executed 2 times by 1 test: goto end;
Executed by:
  • libssl.so.1.1
2
637 }-
638-
639-
640-
641-
642-
643 if (PACKET_remaining(&cookiepkt) == 0
PACKET_remaini...ookiepkt) == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
2-3
644 next = 1;-
645 }
executed 2 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
else {
2
646-
647-
648-
649 if (s->ctx->app_verify_cookie_cb ==
s->ctx->app_ve...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
650 ((void *)0)
s->ctx->app_ve...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
651 ) {-
652 ERR_put_error(20,(350),(403),__FILE__,681);-
653-
654 return
never executed: return -1;
-1;
never executed: return -1;
0
655 }-
656 if (s->ctx->app_verify_cookie_cb(s, PACKET_data(&cookiepkt),
s->ctx->app_ve...okiepkt)) == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libssl.so.1.1
1-2
657 (unsigned int)PACKET_remaining(&cookiepkt)) == 0
s->ctx->app_ve...okiepkt)) == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
1-2
658-
659-
660-
661-
662 next = 1;-
663 }
executed 1 time by 1 test: end of block
Executed by:
  • libssl.so.1.1
else {
1
664-
665 next = 2;-
666 }
executed 2 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
2
667 }-
668-
669 if (next == 1
next == 1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
2-3
670 WPACKET wpkt;-
671 unsigned int version;-
672 size_t wreclen;-
673 BIO_ctrl(SSL_get_rbio(s), 71, 0, -
674 ((void *)0)-
675 );-
676 BIO_read(rbio, buf, 16384);-
677 BIO_ctrl(SSL_get_rbio(s), 71, 1, -
678 ((void *)0)-
679 );-
680-
681-
682 if (s->ctx->app_gen_cookie_cb ==
s->ctx->app_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
683 ((void *)0)
s->ctx->app_ge...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
684 ||-
685 s->ctx->app_gen_cookie_cb(s, cookie, &cookielen) == 0
s->ctx->app_ge...ookielen) == 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
||
0-3
686 cookielen > 255
cookielen > 255Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-3
687 ERR_put_error(20,(350),(400),__FILE__,721);-
688-
689 return
never executed: return -1;
-1;
never executed: return -1;
0
690 }-
691-
692-
693-
694-
695-
696-
697 version = (
(s->method->ve...on == 0x1FFFF)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
s->method->version == 0x1FFFF)
(s->method->ve...on == 0x1FFFF)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
? 0xFEFF
0-3
698 : s->version;-
699-
700-
701 if (!WPACKET_init(&wpkt, s->init_buf)
!WPACKET_init(..., s->init_buf)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
702 || !WPACKET_put_bytes__((&wpkt), (22), 1)
!WPACKET_put_b...pkt), (22), 1)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
703 || !WPACKET_put_bytes__((&wpkt), (version), 2)
!WPACKET_put_b... (version), 2)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
704-
705-
706-
707-
708 || !WPACKET_memcpy(&wpkt, seq, 8)
!WPACKET_memcpy(&wpkt, seq, 8)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
709-
710 || !WPACKET_start_sub_packet_len__((&wpkt), 2)
!WPACKET_start...__((&wpkt), 2)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
711-
712 || !WPACKET_put_bytes__((&wpkt), (3), 1)
!WPACKET_put_b...wpkt), (3), 1)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
713-
714-
715-
716-
717-
718-
719-
720 || !WPACKET_put_bytes__((&wpkt), (0), 3)
!WPACKET_put_b...wpkt), (0), 3)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
721-
722-
723-
724-
725 || !WPACKET_put_bytes__((&wpkt), (0), 2)
!WPACKET_put_b...wpkt), (0), 2)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
726-
727-
728-
729-
730 || !WPACKET_put_bytes__((&wpkt), (0), 3)
!WPACKET_put_b...wpkt), (0), 3)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
731-
732-
733-
734-
735-
736-
737 || !WPACKET_start_sub_packet_len__((&wpkt), 3)
!WPACKET_start...__((&wpkt), 3)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
738-
739 || !dtls_raw_hello_verify_request(&wpkt, cookie, cookielen)
!dtls_raw_hell...ie, cookielen)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
740-
741 || !WPACKET_close(&wpkt)
!WPACKET_close(&wpkt)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
742-
743 || !WPACKET_close(&wpkt)
!WPACKET_close(&wpkt)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
744 || !WPACKET_get_total_written(&wpkt, &wreclen)
!WPACKET_get_t...pkt, &wreclen)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
745 || !WPACKET_finish(&wpkt)
!WPACKET_finish(&wpkt)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-3
746 ERR_put_error(20,(350),((4|64)),__FILE__,780);-
747 WPACKET_cleanup(&wpkt);-
748-
749 return
never executed: return -1;
-1;
never executed: return -1;
0
750 }-
751 memcpy(&buf[13 + 1],-
752 &buf[13 + 12 - 3],-
753 3);-
754-
755 if (s->msg_callback
s->msg_callbackDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-3
756 s->msg_callback(1, 0, 0x100, buf,
never executed: s->msg_callback(1, 0, 0x100, buf, 13, s, s->msg_callback_arg);
0
757 13, s, s->msg_callback_arg);
never executed: s->msg_callback(1, 0, 0x100, buf, 13, s, s->msg_callback_arg);
0
758-
759 if ((
(tmpclient = B...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
tmpclient = BIO_ADDR_new()) ==
(tmpclient = B...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
760 ((void *)0)
(tmpclient = B...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
761 ) {-
762 ERR_put_error(20,(350),((1|64)),__FILE__,802);-
763 goto
never executed: goto end;
end;
never executed: goto end;
0
764 }-
765-
766-
767-
768-
769-
770-
771 if ((
(int)BIO_ctrl(...mpclient)) > 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
int)BIO_ctrl(rbio, 46, 0, (char *)(tmpclient)) > 0
(int)BIO_ctrl(...mpclient)) > 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-3
772 (void)(int)BIO_ctrl(wbio, 44, 0, (char *)(tmpclient));-
773 }
never executed: end of block
0
774 BIO_ADDR_free(tmpclient);-
775 tmpclient = -
776 ((void *)0)-
777 ;-
778-
779-
780 if (BIO_write(wbio, buf, wreclen) < (int)wreclen
BIO_write(wbio...< (int)wreclenDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-3
781 if (BIO_test_flags(wbio, 0x08)
BIO_test_flags(wbio, 0x08)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
782-
783-
784-
785-
786 goto
never executed: goto end;
end;
never executed: goto end;
0
787 }-
788 return
never executed: return -1;
-1;
never executed: return -1;
0
789 }-
790-
791 if ((
(int)BIO_ctrl(...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
int)BIO_ctrl(wbio,11,0,
(int)BIO_ctrl(...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
792 ((void *)0)
(int)BIO_ctrl(...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-3
793 ) <= 0
(int)BIO_ctrl(...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-3
794 if (BIO_test_flags(wbio, 0x08)
BIO_test_flags(wbio, 0x08)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
795-
796-
797-
798-
799 goto
never executed: goto end;
end;
never executed: goto end;
0
800 }-
801 return
never executed: return -1;
-1;
never executed: return -1;
0
802 }-
803 }
executed 3 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
3
804 }
executed 5 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
while (next != 2
next != 2Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libssl.so.1.1
);
2-5
805-
806-
807-
808-
809 s->d1->handshake_read_seq = 1;-
810 s->d1->handshake_write_seq = 1;-
811 s->d1->next_handshake_write_seq = 1;-
812 DTLS_RECORD_LAYER_set_write_sequence(&s->rlayer, seq);-
813-
814-
815-
816-
817-
818 SSL_set_options(s, 0x00002000U);-
819-
820-
821-
822-
823-
824 ossl_statem_set_hello_verify_done(s);-
825-
826-
827-
828-
829 if ((
(int)BIO_ctrl(...(client)) <= 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
int)BIO_ctrl(rbio, 46, 0, (char *)(client)) <= 0
(int)BIO_ctrl(...(client)) <= 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
)
0-2
830 BIO_ADDR_clear(client);
executed 2 times by 1 test: BIO_ADDR_clear(client);
Executed by:
  • libssl.so.1.1
2
831-
832 ret = 1;-
833 clearpkt = 0;-
834 end:
code before this statement executed 2 times by 1 test: end:
Executed by:
  • libssl.so.1.1
2
835 BIO_ADDR_free(tmpclient);-
836 BIO_ctrl(SSL_get_rbio(s), 71, 0, -
837 ((void *)0)-
838 );-
839 if (clearpkt
clearpktDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
2-7
840-
841 BIO_read(rbio, buf, 16384);-
842 }
executed 7 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
7
843 return
executed 9 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
ret;
executed 9 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
9
844}-
845-
846-
847static int dtls1_handshake_write(SSL *s)-
848{-
849 return
executed 1532 times by 1 test: return dtls1_do_write(s, 22);
Executed by:
  • libssl.so.1.1
dtls1_do_write(s, 22);
executed 1532 times by 1 test: return dtls1_do_write(s, 22);
Executed by:
  • libssl.so.1.1
1532
850}-
851-
852int dtls1_shutdown(SSL *s)-
853{-
854 int ret;-
855 ret = ssl3_shutdown(s);-
856-
857-
858-
859 return
executed 438 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
ret;
executed 438 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
438
860}-
861-
862int dtls1_query_mtu(SSL *s)-
863{-
864 if (s->d1->link_mtu
s->d1->link_mtuDescription
TRUEnever evaluated
FALSEevaluated 2013 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-2013
865 s->d1->mtu =-
866 s->d1->link_mtu - (unsigned int)BIO_ctrl((SSL_get_wbio(s)), 49, 0, -
867 ((void *)0)-
868 );-
869 s->d1->link_mtu = 0;-
870 }
never executed: end of block
0
871-
872-
873 if (s->d1->mtu < dtls1_min_mtu(s)
s->d1->mtu < dtls1_min_mtu(s)Description
TRUEevaluated 359 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 1654 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
359-1654
874 if (!(SSL_get_options(s) & 0x00001000U)
!(SSL_get_opti...& 0x00001000U)Description
TRUEevaluated 359 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
) {
0-359
875 s->d1->mtu =-
876 BIO_ctrl(SSL_get_wbio(s), 40, 0, -
877 ((void *)0)-
878 );-
879-
880-
881-
882-
883-
884 if (s->d1->mtu < dtls1_min_mtu(s)
s->d1->mtu < dtls1_min_mtu(s)Description
TRUEevaluated 359 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
) {
0-359
885-
886 s->d1->mtu = dtls1_min_mtu(s);-
887 BIO_ctrl(SSL_get_wbio(s), 42,-
888 (long)s->d1->mtu, -
889 ((void *)0)-
890 );-
891 }
executed 359 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
359
892 }
executed 359 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
else
359
893 return
never executed: return 0;
0;
never executed: return 0;
0
894 }-
895 return
executed 2013 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
1;
executed 2013 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
2013
896}-
897-
898static size_t dtls1_link_min_mtu(void)-
899{-
900 return
executed 5581 times by 1 test: return (g_probable_mtu[(sizeof(g_probable_mtu) / sizeof(g_probable_mtu[0])) - 1]);
Executed by:
  • libssl.so.1.1
(g_probable_mtu[(sizeof(g_probable_mtu) /
executed 5581 times by 1 test: return (g_probable_mtu[(sizeof(g_probable_mtu) / sizeof(g_probable_mtu[0])) - 1]);
Executed by:
  • libssl.so.1.1
5581
901 sizeof(g_probable_mtu[0])) - 1]);
executed 5581 times by 1 test: return (g_probable_mtu[(sizeof(g_probable_mtu) / sizeof(g_probable_mtu[0])) - 1]);
Executed by:
  • libssl.so.1.1
5581
902}-
903-
904size_t dtls1_min_mtu(SSL *s)-
905{-
906 return
executed 4744 times by 1 test: return dtls1_link_min_mtu() - (unsigned int)BIO_ctrl((SSL_get_wbio(s)), 49, 0, ((void *)0) );
Executed by:
  • libssl.so.1.1
dtls1_link_min_mtu() - (unsigned int)BIO_ctrl((SSL_get_wbio(s)), 49, 0,
executed 4744 times by 1 test: return dtls1_link_min_mtu() - (unsigned int)BIO_ctrl((SSL_get_wbio(s)), 49, 0, ((void *)0) );
Executed by:
  • libssl.so.1.1
4744
907 ((void *)0)
executed 4744 times by 1 test: return dtls1_link_min_mtu() - (unsigned int)BIO_ctrl((SSL_get_wbio(s)), 49, 0, ((void *)0) );
Executed by:
  • libssl.so.1.1
4744
908 );
executed 4744 times by 1 test: return dtls1_link_min_mtu() - (unsigned int)BIO_ctrl((SSL_get_wbio(s)), 49, 0, ((void *)0) );
Executed by:
  • libssl.so.1.1
4744
909}-
910-
911size_t DTLS_get_data_mtu(const SSL *s)-
912{-
913 size_t mac_overhead, int_overhead, blocksize, ext_overhead;-
914 const SSL_CIPHER *ciph = SSL_get_current_cipher(s);-
915 size_t mtu = s->d1->mtu;-
916-
917 if (ciph ==
ciph == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 810 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-810
918 ((void *)0)
ciph == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 810 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-810
919 )-
920 return
never executed: return 0;
0;
never executed: return 0;
0
921-
922 if (!ssl_cipher_get_overhead(ciph, &mac_overhead, &int_overhead,
!ssl_cipher_ge...&ext_overhead)Description
TRUEnever evaluated
FALSEevaluated 810 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-810
923 &blocksize, &ext_overhead)
!ssl_cipher_ge...&ext_overhead)Description
TRUEnever evaluated
FALSEevaluated 810 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-810
924 return
never executed: return 0;
0;
never executed: return 0;
0
925-
926 if ((
(s->s3->flags & 0x0100)Description
TRUEevaluated 270 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 540 times by 1 test
Evaluated by:
  • libssl.so.1.1
s->s3->flags & 0x0100)
(s->s3->flags & 0x0100)Description
TRUEevaluated 270 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 540 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
270-540
927 ext_overhead += mac_overhead;
executed 270 times by 1 test: ext_overhead += mac_overhead;
Executed by:
  • libssl.so.1.1
270
928 else-
929 int_overhead += mac_overhead;
executed 540 times by 1 test: int_overhead += mac_overhead;
Executed by:
  • libssl.so.1.1
540
930-
931-
932 if (ext_overhead + 13 >= mtu
ext_overhead + 13 >= mtuDescription
TRUEnever evaluated
FALSEevaluated 810 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-810
933 return
never executed: return 0;
0;
never executed: return 0;
0
934 mtu -= ext_overhead + 13;-
935-
936-
937-
938 if (blocksize
blocksizeDescription
TRUEevaluated 360 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 450 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
360-450
939 mtu -= (mtu % blocksize);
executed 360 times by 1 test: mtu -= (mtu % blocksize);
Executed by:
  • libssl.so.1.1
360
940-
941-
942 if (int_overhead >= mtu
int_overhead >= mtuDescription
TRUEnever evaluated
FALSEevaluated 810 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-810
943 return
never executed: return 0;
0;
never executed: return 0;
0
944 mtu -= int_overhead;-
945-
946 return
executed 810 times by 1 test: return mtu;
Executed by:
  • libssl.so.1.1
mtu;
executed 810 times by 1 test: return mtu;
Executed by:
  • libssl.so.1.1
810
947}-
948-
949void DTLS_set_timer_cb(SSL *s, DTLS_timer_cb cb)-
950{-
951 s->d1->timer_cb = cb;-
952}
executed 50 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
50
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2