OpenCoverage

packet_locl.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/ssl/packet_locl.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2typedef struct {-
3-
4 const unsigned char *curr;-
5-
6 size_t remaining;-
7} PACKET;-
8-
9-
10static inline void packet_forward(PACKET *pkt, size_t len)-
11{-
12 pkt->curr += len;-
13 pkt->remaining -= len;-
14}
executed 686115 times by 8 tests: end of block
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
686115
15-
16-
17-
18-
19static inline size_t PACKET_remaining(const PACKET *pkt)-
20{-
21 return
executed 890144 times by 8 tests: return pkt->remaining;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
pkt->remaining;
executed 890144 times by 8 tests: return pkt->remaining;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
890144
22}-
23-
24-
25-
26-
27-
28-
29-
30static inline const unsigned char *PACKET_end(const PACKET *pkt)-
31{-
32 return
executed 29 times by 2 tests: return pkt->curr + pkt->remaining;
Executed by:
  • libssl.so.1.1
  • packettest
pkt->curr + pkt->remaining;
executed 29 times by 2 tests: return pkt->curr + pkt->remaining;
Executed by:
  • libssl.so.1.1
  • packettest
29
33}-
34-
35-
36-
37-
38-
39static inline const unsigned char *PACKET_data(const PACKET *pkt)-
40{-
41 return
executed 18283 times by 3 tests: return pkt->curr;
Executed by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
pkt->curr;
executed 18283 times by 3 tests: return pkt->curr;
Executed by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
18283
42}-
43-
44-
45-
46-
47-
48-
49 static inline int PACKET_buf_init(PACKET *pkt,-
50 const unsigned char *buf,-
51 size_t len)-
52{-
53-
54 if (len > (size_t)(
len > (size_t)...551615UL) / 2)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • packettest
FALSEevaluated 80687 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1-80687
55 (18446744073709551615UL)
len > (size_t)...551615UL) / 2)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • packettest
FALSEevaluated 80687 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1-80687
56 / 2)
len > (size_t)...551615UL) / 2)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • packettest
FALSEevaluated 80687 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
)
1-80687
57 return
executed 1 time by 1 test: return 0;
Executed by:
  • packettest
0;
executed 1 time by 1 test: return 0;
Executed by:
  • packettest
1
58-
59 pkt->curr = buf;-
60 pkt->remaining = len;-
61 return
executed 80687 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1;
executed 80687 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
80687
62}-
63-
64-
65static inline void PACKET_null_init(PACKET *pkt)-
66{-
67 pkt->curr = -
68 ((void *)0)-
69 ;-
70 pkt->remaining = 0;-
71}
executed 6090 times by 2 tests: end of block
Executed by:
  • libssl.so.1.1
  • packettest
6090
72-
73-
74-
75-
76-
77-
78 static inline int PACKET_equal(const PACKET *pkt, const void *ptr,-
79 size_t num)-
80{-
81 if (PACKET_remaining(pkt) != num
PACKET_remaining(pkt) != numDescription
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 46 times by 4 tests
Evaluated by:
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
)
7-46
82 return
executed 7 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 7 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
7
83 return
executed 46 times by 4 tests: return CRYPTO_memcmp(pkt->curr, ptr, num) == 0;
Executed by:
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
CRYPTO_memcmp(pkt->curr, ptr, num) == 0;
executed 46 times by 4 tests: return CRYPTO_memcmp(pkt->curr, ptr, num) == 0;
Executed by:
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
46
84}-
85-
86-
87-
88-
89-
90-
91 static inline int PACKET_peek_sub_packet(const PACKET *pkt,-
92 PACKET *subpkt, size_t len)-
93{-
94 if (PACKET_remaining(pkt) < len
PACKET_remaining(pkt) < lenDescription
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 1620 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
)
3-1620
95 return
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
3
96-
97 return
executed 1620 times by 2 tests: return PACKET_buf_init(subpkt, pkt->curr, len);
Executed by:
  • libssl.so.1.1
  • packettest
PACKET_buf_init(subpkt, pkt->curr, len);
executed 1620 times by 2 tests: return PACKET_buf_init(subpkt, pkt->curr, len);
Executed by:
  • libssl.so.1.1
  • packettest
1620
98}-
99-
100-
101-
102-
103-
104-
105 static inline int PACKET_get_sub_packet(PACKET *pkt,-
106 PACKET *subpkt, size_t len)-
107{-
108 if (!PACKET_peek_sub_packet(pkt, subpkt, len)
!PACKET_peek_s..., subpkt, len)Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 1620 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
)
3-1620
109 return
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
3
110-
111 packet_forward(pkt, len);-
112-
113 return
executed 1620 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
1;
executed 1620 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
1620
114}-
115-
116-
117-
118-
119-
120 static inline int PACKET_peek_net_2(const PACKET *pkt,-
121 unsigned int *data)-
122{-
123 if (PACKET_remaining(pkt) < 2
PACKET_remaining(pkt) < 2Description
TRUEevaluated 1473 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 343455 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
)
1473-343455
124 return
executed 1473 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 1473 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
1473
125-
126 *data = ((unsigned int)(*pkt->curr)) << 8;-
127 *data |= *(pkt->curr + 1);-
128-
129 return
executed 343455 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1;
executed 343455 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
343455
130}-
131-
132-
133-
134 static inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data)-
135{-
136 if (!PACKET_peek_net_2(pkt, data)
!PACKET_peek_net_2(pkt, data)Description
TRUEevaluated 1473 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 343455 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
)
1473-343455
137 return
executed 1473 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 1473 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
1473
138-
139 packet_forward(pkt, 2);-
140-
141 return
executed 343455 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1;
executed 343455 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
343455
142}-
143-
144-
145 static inline int PACKET_get_net_2_len(PACKET *pkt, size_t *data)-
146{-
147 unsigned int i;-
148 int ret = PACKET_get_net_2(pkt, &i);-
149-
150 if (ret
retDescription
TRUEevaluated 103335 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
)
0-103335
151 *
executed 103335 times by 1 test: *data = (size_t)i;
Executed by:
  • libssl.so.1.1
data = (size_t)i;
executed 103335 times by 1 test: *data = (size_t)i;
Executed by:
  • libssl.so.1.1
103335
152-
153 return
executed 103335 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
ret;
executed 103335 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
103335
154}-
155-
156-
157-
158-
159-
160 static inline int PACKET_peek_net_3(const PACKET *pkt,-
161 unsigned long *data)-
162{-
163 if (PACKET_remaining(pkt) < 3
PACKET_remaining(pkt) < 3Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 7079 times by 3 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
)
3-7079
164 return
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
3
165-
166 *data = ((unsigned long)(*pkt->curr)) << 16;-
167 *data |= ((unsigned long)(*(pkt->curr + 1))) << 8;-
168 *data |= *(pkt->curr + 2);-
169-
170 return
executed 7079 times by 3 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
1;
executed 7079 times by 3 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
7079
171}-
172-
173-
174-
175 static inline int PACKET_get_net_3(PACKET *pkt, unsigned long *data)-
176{-
177 if (!PACKET_peek_net_3(pkt, data)
!PACKET_peek_net_3(pkt, data)Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 7079 times by 3 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
)
3-7079
178 return
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
3
179-
180 packet_forward(pkt, 3);-
181-
182 return
executed 7079 times by 3 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
1;
executed 7079 times by 3 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
7079
183}-
184-
185-
186 static inline int PACKET_get_net_3_len(PACKET *pkt, size_t *data)-
187{-
188 unsigned long i;-
189 int ret = PACKET_get_net_3(pkt, &i);-
190-
191 if (ret
retDescription
TRUEevaluated 35 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
)
0-35
192 *
executed 35 times by 1 test: *data = (size_t)i;
Executed by:
  • libssl.so.1.1
data = (size_t)i;
executed 35 times by 1 test: *data = (size_t)i;
Executed by:
  • libssl.so.1.1
35
193-
194 return
executed 35 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
ret;
executed 35 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
35
195}-
196-
197-
198-
199-
200-
201 static inline int PACKET_peek_net_4(const PACKET *pkt,-
202 unsigned long *data)-
203{-
204 if (PACKET_remaining(pkt) < 4
PACKET_remaining(pkt) < 4Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 3198 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
)
3-3198
205 return
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
3
206-
207 *data = ((unsigned long)(*pkt->curr)) << 24;-
208 *data |= ((unsigned long)(*(pkt->curr + 1))) << 16;-
209 *data |= ((unsigned long)(*(pkt->curr + 2))) << 8;-
210 *data |= *(pkt->curr + 3);-
211-
212 return
executed 3198 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
1;
executed 3198 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
3198
213}-
214-
215-
216-
217 static inline int PACKET_get_net_4(PACKET *pkt, unsigned long *data)-
218{-
219 if (!PACKET_peek_net_4(pkt, data)
!PACKET_peek_net_4(pkt, data)Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 3198 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
)
3-3198
220 return
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 3 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
3
221-
222 packet_forward(pkt, 4);-
223-
224 return
executed 3198 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
1;
executed 3198 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
3198
225}-
226-
227-
228 static inline int PACKET_get_net_4_len(PACKET *pkt, size_t *data)-
229{-
230 unsigned long i;-
231 int ret = PACKET_get_net_4(pkt, &i);-
232-
233 if (ret
retDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
234 *
never executed: *data = (size_t)i;
data = (size_t)i;
never executed: *data = (size_t)i;
0
235-
236 return
never executed: return ret;
ret;
never executed: return ret;
0
237}-
238-
239-
240 static inline int PACKET_peek_1(const PACKET *pkt,-
241 unsigned int *data)-
242{-
243 if (!PACKET_remaining(pkt)
!PACKET_remaining(pkt)Description
TRUEevaluated 863 times by 3 tests
Evaluated by:
  • asynciotest
  • libssl.so.1.1
  • packettest
FALSEevaluated 142462 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
)
863-142462
244 return
executed 863 times by 3 tests: return 0;
Executed by:
  • asynciotest
  • libssl.so.1.1
  • packettest
0;
executed 863 times by 3 tests: return 0;
Executed by:
  • asynciotest
  • libssl.so.1.1
  • packettest
863
245-
246 *data = *pkt->curr;-
247-
248 return
executed 142462 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1;
executed 142462 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
142462
249}-
250-
251-
252 static inline int PACKET_get_1(PACKET *pkt, unsigned int *data)-
253{-
254 if (!PACKET_peek_1(pkt, data)
!PACKET_peek_1(pkt, data)Description
TRUEevaluated 863 times by 3 tests
Evaluated by:
  • asynciotest
  • libssl.so.1.1
  • packettest
FALSEevaluated 142462 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
)
863-142462
255 return
executed 863 times by 3 tests: return 0;
Executed by:
  • asynciotest
  • libssl.so.1.1
  • packettest
0;
executed 863 times by 3 tests: return 0;
Executed by:
  • asynciotest
  • libssl.so.1.1
  • packettest
863
256-
257 packet_forward(pkt, 1);-
258-
259 return
executed 142462 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1;
executed 142462 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
142462
260}-
261-
262-
263 static inline int PACKET_get_1_len(PACKET *pkt, size_t *data)-
264{-
265 unsigned int i;-
266 int ret = PACKET_get_1(pkt, &i);-
267-
268 if (ret
retDescription
TRUEevaluated 2506 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
)
0-2506
269 *
executed 2506 times by 1 test: *data = (size_t)i;
Executed by:
  • libssl.so.1.1
data = (size_t)i;
executed 2506 times by 1 test: *data = (size_t)i;
Executed by:
  • libssl.so.1.1
2506
270-
271 return
executed 2506 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
ret;
executed 2506 times by 1 test: return ret;
Executed by:
  • libssl.so.1.1
2506
272}-
273-
274-
275-
276-
277-
278 static inline int PACKET_peek_4(const PACKET *pkt,-
279 unsigned long *data)-
280{-
281 if (PACKET_remaining(pkt) < 4
PACKET_remaining(pkt) < 4Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • packettest
FALSEevaluated 2 times by 1 test
Evaluated by:
  • packettest
)
1-2
282 return
executed 1 time by 1 test: return 0;
Executed by:
  • packettest
0;
executed 1 time by 1 test: return 0;
Executed by:
  • packettest
1
283-
284 *data = *pkt->curr;-
285 *data |= ((unsigned long)(*(pkt->curr + 1))) << 8;-
286 *data |= ((unsigned long)(*(pkt->curr + 2))) << 16;-
287 *data |= ((unsigned long)(*(pkt->curr + 3))) << 24;-
288-
289 return
executed 2 times by 1 test: return 1;
Executed by:
  • packettest
1;
executed 2 times by 1 test: return 1;
Executed by:
  • packettest
2
290}-
291-
292-
293-
294-
295-
296-
297 static inline int PACKET_get_4(PACKET *pkt, unsigned long *data)-
298{-
299 if (!PACKET_peek_4(pkt, data)
!PACKET_peek_4(pkt, data)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • packettest
FALSEevaluated 2 times by 1 test
Evaluated by:
  • packettest
)
1-2
300 return
executed 1 time by 1 test: return 0;
Executed by:
  • packettest
0;
executed 1 time by 1 test: return 0;
Executed by:
  • packettest
1
301-
302 packet_forward(pkt, 4);-
303-
304 return
executed 2 times by 1 test: return 1;
Executed by:
  • packettest
1;
executed 2 times by 1 test: return 1;
Executed by:
  • packettest
2
305}-
306-
307-
308-
309-
310-
311-
312-
313 static inline int PACKET_peek_bytes(const PACKET *pkt,-
314 const unsigned char **data,-
315 size_t len)-
316{-
317 if (PACKET_remaining(pkt) < len
PACKET_remaining(pkt) < lenDescription
TRUEevaluated 154 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 99507 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
)
154-99507
318 return
executed 154 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 154 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
154
319-
320 *data = pkt->curr;-
321-
322 return
executed 99507 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1;
executed 99507 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
99507
323}-
324-
325-
326-
327-
328-
329-
330-
331 static inline int PACKET_get_bytes(PACKET *pkt,-
332 const unsigned char **data,-
333 size_t len)-
334{-
335 if (!PACKET_peek_bytes(pkt, data, len)
!PACKET_peek_b...kt, data, len)Description
TRUEevaluated 154 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 99507 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
)
154-99507
336 return
executed 154 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 154 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
154
337-
338 packet_forward(pkt, len);-
339-
340 return
executed 99507 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1;
executed 99507 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
99507
341}-
342-
343-
344 static inline int PACKET_peek_copy_bytes(const PACKET *pkt,-
345 unsigned char *data,-
346 size_t len)-
347{-
348 if (PACKET_remaining(pkt) < len
PACKET_remaining(pkt) < lenDescription
TRUEevaluated 3137 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 87500 times by 4 tests
Evaluated by:
  • bad_dtls_test
  • libssl.so.1.1
  • packettest
  • tls13ccstest
)
3137-87500
349 return
executed 3137 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
0;
executed 3137 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
3137
350-
351 memcpy(data, pkt->curr, len);-
352-
353 return
executed 87500 times by 4 tests: return 1;
Executed by:
  • bad_dtls_test
  • libssl.so.1.1
  • packettest
  • tls13ccstest
1;
executed 87500 times by 4 tests: return 1;
Executed by:
  • bad_dtls_test
  • libssl.so.1.1
  • packettest
  • tls13ccstest
87500
354}-
355-
356-
357-
358-
359-
360 static inline int PACKET_copy_bytes(PACKET *pkt,-
361 unsigned char *data, size_t len)-
362{-
363 if (!PACKET_peek_copy_bytes(pkt, data, len)
!PACKET_peek_c...kt, data, len)Description
TRUEevaluated 3137 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 87500 times by 4 tests
Evaluated by:
  • bad_dtls_test
  • libssl.so.1.1
  • packettest
  • tls13ccstest
)
3137-87500
364 return
executed 3137 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
0;
executed 3137 times by 1 test: return 0;
Executed by:
  • libssl.so.1.1
3137
365-
366 packet_forward(pkt, len);-
367-
368 return
executed 87500 times by 4 tests: return 1;
Executed by:
  • bad_dtls_test
  • libssl.so.1.1
  • packettest
  • tls13ccstest
1;
executed 87500 times by 4 tests: return 1;
Executed by:
  • bad_dtls_test
  • libssl.so.1.1
  • packettest
  • tls13ccstest
87500
369}-
370 static inline int PACKET_copy_all(const PACKET *pkt,-
371 unsigned char *dest,-
372 size_t dest_len, size_t *len)-
373{-
374 if (PACKET_remaining(pkt) > dest_len
PACKET_remaini...kt) > dest_lenDescription
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 7406 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
) {
2-7406
375 *len = 0;-
376 return
executed 2 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 2 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
2
377 }-
378 *len = pkt->remaining;-
379 memcpy(dest, pkt->curr, pkt->remaining);-
380 return
executed 7406 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
1;
executed 7406 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
7406
381}-
382 static inline int PACKET_memdup(const PACKET *pkt,-
383 unsigned char **data, size_t *len)-
384{-
385 size_t length;-
386-
387 CRYPTO_free(*data, __FILE__, 420);-
388 *data = -
389 ((void *)0)-
390 ;-
391 *len = 0;-
392-
393 length = PACKET_remaining(pkt);-
394-
395 if (length == 0
length == 0Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 4703 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
)
42-4703
396 return
executed 42 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
1;
executed 42 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
42
397-
398 *data = CRYPTO_memdup((pkt->curr), length, __FILE__, 429);-
399 if (*
*data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4703 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
data ==
*data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4703 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
0-4703
400 ((void *)0)
*data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4703 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
0-4703
401 )-
402 return
never executed: return 0;
0;
never executed: return 0;
0
403-
404 *len = length;-
405 return
executed 4703 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
1;
executed 4703 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
4703
406}-
407 static inline int PACKET_strndup(const PACKET *pkt, char **data)-
408{-
409 CRYPTO_free(*data, __FILE__, 449);-
410-
411-
412 *data = CRYPTO_strndup((const char *)pkt->curr, PACKET_remaining(pkt), __FILE__, 452);-
413 return
executed 647 times by 3 tests: return (*data != ((void *)0) );
Executed by:
  • libssl.so.1.1
  • packettest
  • servername_test
(*data !=
executed 647 times by 3 tests: return (*data != ((void *)0) );
Executed by:
  • libssl.so.1.1
  • packettest
  • servername_test
647
414 ((void *)0)
executed 647 times by 3 tests: return (*data != ((void *)0) );
Executed by:
  • libssl.so.1.1
  • packettest
  • servername_test
647
415 );
executed 647 times by 3 tests: return (*data != ((void *)0) );
Executed by:
  • libssl.so.1.1
  • packettest
  • servername_test
647
416}-
417-
418-
419static inline int PACKET_contains_zero_byte(const PACKET *pkt)-
420{-
421 return
executed 610 times by 3 tests: return memchr(pkt->curr, 0, pkt->remaining) != ((void *)0) ;
Executed by:
  • libssl.so.1.1
  • packettest
  • servername_test
memchr(pkt->curr, 0, pkt->remaining) !=
executed 610 times by 3 tests: return memchr(pkt->curr, 0, pkt->remaining) != ((void *)0) ;
Executed by:
  • libssl.so.1.1
  • packettest
  • servername_test
610
422 ((void *)0)
executed 610 times by 3 tests: return memchr(pkt->curr, 0, pkt->remaining) != ((void *)0) ;
Executed by:
  • libssl.so.1.1
  • packettest
  • servername_test
610
423 ;
executed 610 times by 3 tests: return memchr(pkt->curr, 0, pkt->remaining) != ((void *)0) ;
Executed by:
  • libssl.so.1.1
  • packettest
  • servername_test
610
424}-
425-
426-
427 static inline int PACKET_forward(PACKET *pkt, size_t len)-
428{-
429 if (PACKET_remaining(pkt) < len
PACKET_remaining(pkt) < lenDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • packettest
FALSEevaluated 1292 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
)
1-1292
430 return
executed 1 time by 1 test: return 0;
Executed by:
  • packettest
0;
executed 1 time by 1 test: return 0;
Executed by:
  • packettest
1
431-
432 packet_forward(pkt, len);-
433-
434 return
executed 1292 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1;
executed 1292 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1292
435}-
436 static inline int PACKET_get_length_prefixed_1(PACKET *pkt,-
437 PACKET *subpkt)-
438{-
439 unsigned int length;-
440 const unsigned char *data;-
441 PACKET tmp = *pkt;-
442 if (!PACKET_get_1(&tmp, &length)
!PACKET_get_1(&tmp, &length)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 14579 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
||
9-14579
443 !PACKET_get_bytes(&tmp, &data, (size_t)length)
!PACKET_get_by...size_t)length)Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 14563 times by 8 tests
Evaluated by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
) {
16-14563
444 return
executed 25 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 25 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
25
445 }-
446-
447 *pkt = tmp;-
448 subpkt->curr = data;-
449 subpkt->remaining = length;-
450-
451 return
executed 14563 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1;
executed 14563 times by 8 tests: return 1;
Executed by:
  • asynciotest
  • bad_dtls_test
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
14563
452}-
453-
454-
455-
456-
457-
458 static inline int PACKET_as_length_prefixed_1(PACKET *pkt,-
459 PACKET *subpkt)-
460{-
461 unsigned int length;-
462 const unsigned char *data;-
463 PACKET tmp = *pkt;-
464 if (!PACKET_get_1(&tmp, &length)
!PACKET_get_1(&tmp, &length)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 4710 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
||
6-4710
465 !PACKET_get_bytes(&tmp, &data, (size_t)length)
!PACKET_get_by...size_t)length)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 4705 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
||
5-4705
466 PACKET_remaining(&tmp) != 0
PACKET_remaining(&tmp) != 0Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 4701 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
) {
4-4701
467 return
executed 15 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 15 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
15
468 }-
469-
470 *pkt = tmp;-
471 subpkt->curr = data;-
472 subpkt->remaining = length;-
473-
474 return
executed 4701 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
1;
executed 4701 times by 2 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
4701
475}-
476 static inline int PACKET_get_length_prefixed_2(PACKET *pkt,-
477 PACKET *subpkt)-
478{-
479 unsigned int length;-
480 const unsigned char *data;-
481 PACKET tmp = *pkt;-
482-
483 if (!PACKET_get_net_2(&tmp, &length)
!PACKET_get_ne...&tmp, &length)Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 50631 times by 7 tests
Evaluated by:
  • asynciotest
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
||
23-50631
484 !PACKET_get_bytes(&tmp, &data, (size_t)length)
!PACKET_get_by...size_t)length)Description
TRUEevaluated 82 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 50549 times by 7 tests
Evaluated by:
  • asynciotest
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
) {
82-50549
485 return
executed 105 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 105 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
105
486 }-
487-
488 *pkt = tmp;-
489 subpkt->curr = data;-
490 subpkt->remaining = length;-
491-
492 return
executed 50549 times by 7 tests: return 1;
Executed by:
  • asynciotest
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
1;
executed 50549 times by 7 tests: return 1;
Executed by:
  • asynciotest
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
  • tls13ccstest
50549
493}-
494-
495-
496-
497-
498-
499 static inline int PACKET_as_length_prefixed_2(PACKET *pkt,-
500 PACKET *subpkt)-
501{-
502 unsigned int length;-
503 const unsigned char *data;-
504 PACKET tmp = *pkt;-
505-
506 if (!PACKET_get_net_2(&tmp, &length)
!PACKET_get_ne...&tmp, &length)Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 14275 times by 5 tests
Evaluated by:
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
||
13-14275
507 !PACKET_get_bytes(&tmp, &data, (size_t)length)
!PACKET_get_by...size_t)length)Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 14245 times by 5 tests
Evaluated by:
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
||
30-14245
508 PACKET_remaining(&tmp) != 0
PACKET_remaining(&tmp) != 0Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
FALSEevaluated 14236 times by 5 tests
Evaluated by:
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
) {
9-14236
509 return
executed 52 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
0;
executed 52 times by 2 tests: return 0;
Executed by:
  • libssl.so.1.1
  • packettest
52
510 }-
511-
512 *pkt = tmp;-
513 subpkt->curr = data;-
514 subpkt->remaining = length;-
515-
516 return
executed 14236 times by 5 tests: return 1;
Executed by:
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
1;
executed 14236 times by 5 tests: return 1;
Executed by:
  • clienthellotest
  • libssl.so.1.1
  • packettest
  • servername_test
  • sslapitest
14236
517}-
518 static inline int PACKET_get_length_prefixed_3(PACKET *pkt,-
519 PACKET *subpkt)-
520{-
521 unsigned long length;-
522 const unsigned char *data;-
523 PACKET tmp = *pkt;-
524 if (!PACKET_get_net_3(&tmp, &length)
!PACKET_get_ne...&tmp, &length)Description
TRUEnever evaluated
FALSEevaluated 137 times by 3 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
||
0-137
525 !PACKET_get_bytes(&tmp, &data, (size_t)length)
!PACKET_get_by...size_t)length)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • packettest
FALSEevaluated 136 times by 3 tests
Evaluated by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
) {
1-136
526 return
executed 1 time by 1 test: return 0;
Executed by:
  • packettest
0;
executed 1 time by 1 test: return 0;
Executed by:
  • packettest
1
527 }-
528-
529 *pkt = tmp;-
530 subpkt->curr = data;-
531 subpkt->remaining = length;-
532-
533 return
executed 136 times by 3 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
1;
executed 136 times by 3 tests: return 1;
Executed by:
  • libssl.so.1.1
  • packettest
  • tls13ccstest
136
534}-
535-
536-
537-
538typedef struct wpacket_sub WPACKET_SUB;-
539struct wpacket_sub {-
540-
541 WPACKET_SUB *parent;-
542-
543-
544-
545-
546-
547 size_t packet_len;-
548-
549-
550 size_t lenbytes;-
551-
552-
553 size_t pwritten;-
554-
555-
556 unsigned int flags;-
557};-
558-
559typedef struct wpacket_st WPACKET;-
560struct wpacket_st {-
561-
562 BUF_MEM *buf;-
563-
564-
565 unsigned char *staticbuf;-
566-
567-
568-
569-
570-
571 size_t curr;-
572-
573-
574 size_t written;-
575-
576-
577 size_t maxsize;-
578-
579-
580 WPACKET_SUB *subs;-
581};-
582int WPACKET_init_len(WPACKET *pkt, BUF_MEM *buf, size_t lenbytes);-
583-
584-
585-
586-
587-
588int WPACKET_init(WPACKET *pkt, BUF_MEM *buf);-
589-
590-
591-
592-
593-
594-
595int WPACKET_init_static_len(WPACKET *pkt, unsigned char *buf, size_t len,-
596 size_t lenbytes);-
597-
598-
599-
600int WPACKET_set_flags(WPACKET *pkt, unsigned int flags);-
601-
602-
603-
604-
605-
606-
607-
608int WPACKET_close(WPACKET *pkt);-
609-
610-
611-
612-
613-
614int WPACKET_finish(WPACKET *pkt);-
615int WPACKET_fill_lengths(WPACKET *pkt);-
616-
617-
618-
619-
620-
621-
622int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes);-
623int WPACKET_start_sub_packet(WPACKET *pkt);-
624int WPACKET_allocate_bytes(WPACKET *pkt, size_t len,-
625 unsigned char **allocbytes);-
626-
627-
628-
629-
630-
631-
632-
633int WPACKET_sub_allocate_bytes__(WPACKET *pkt, size_t len,-
634 unsigned char **allocbytes, size_t lenbytes);-
635int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes);-
636-
637-
638-
639-
640int WPACKET_sub_reserve_bytes__(WPACKET *pkt, size_t len,-
641 unsigned char **allocbytes, size_t lenbytes);-
642int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t bytes);-
643int WPACKET_set_max_size(WPACKET *pkt, size_t maxsize);-
644-
645-
646int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len);-
647-
648-
649int WPACKET_memset(WPACKET *pkt, int ch, size_t len);-
650-
651-
652-
653-
654-
655-
656int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len,-
657 size_t lenbytes);-
658int WPACKET_get_total_written(WPACKET *pkt, size_t *written);-
659-
660-
661-
662-
663-
664int WPACKET_get_length(WPACKET *pkt, size_t *len);-
665-
666-
667-
668-
669-
670unsigned char *WPACKET_get_curr(WPACKET *pkt);-
671-
672-
673void WPACKET_cleanup(WPACKET *pkt);-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2