Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bio/bss_bio.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | - | |||||||||||||
6 | static int bio_new(BIO *bio); | - | ||||||||||||
7 | static int bio_free(BIO *bio); | - | ||||||||||||
8 | static int bio_read(BIO *bio, char *buf, int size); | - | ||||||||||||
9 | static int bio_write(BIO *bio, const char *buf, int num); | - | ||||||||||||
10 | static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr); | - | ||||||||||||
11 | static int bio_puts(BIO *bio, const char *str); | - | ||||||||||||
12 | - | |||||||||||||
13 | static int bio_make_pair(BIO *bio1, BIO *bio2); | - | ||||||||||||
14 | static void bio_destroy_pair(BIO *bio); | - | ||||||||||||
15 | - | |||||||||||||
16 | static const BIO_METHOD methods_biop = { | - | ||||||||||||
17 | (19|0x0400), | - | ||||||||||||
18 | "BIO pair", | - | ||||||||||||
19 | - | |||||||||||||
20 | bwrite_conv, | - | ||||||||||||
21 | bio_write, | - | ||||||||||||
22 | - | |||||||||||||
23 | bread_conv, | - | ||||||||||||
24 | bio_read, | - | ||||||||||||
25 | bio_puts, | - | ||||||||||||
26 | - | |||||||||||||
27 | ((void *)0) | - | ||||||||||||
28 | , | - | ||||||||||||
29 | bio_ctrl, | - | ||||||||||||
30 | bio_new, | - | ||||||||||||
31 | bio_free, | - | ||||||||||||
32 | - | |||||||||||||
33 | ((void *)0) | - | ||||||||||||
34 | - | |||||||||||||
35 | }; | - | ||||||||||||
36 | - | |||||||||||||
37 | const BIO_METHOD *BIO_s_bio(void) | - | ||||||||||||
38 | { | - | ||||||||||||
39 | return executed 176 times by 1 test: &methods_biop;return &methods_biop; Executed by:
executed 176 times by 1 test: return &methods_biop; Executed by:
| 176 | ||||||||||||
40 | } | - | ||||||||||||
41 | - | |||||||||||||
42 | struct bio_bio_st { | - | ||||||||||||
43 | BIO *peer; | - | ||||||||||||
44 | - | |||||||||||||
45 | - | |||||||||||||
46 | - | |||||||||||||
47 | - | |||||||||||||
48 | int closed; | - | ||||||||||||
49 | size_t len; | - | ||||||||||||
50 | size_t offset; | - | ||||||||||||
51 | size_t size; | - | ||||||||||||
52 | char *buf; | - | ||||||||||||
53 | size_t request; | - | ||||||||||||
54 | - | |||||||||||||
55 | - | |||||||||||||
56 | - | |||||||||||||
57 | - | |||||||||||||
58 | }; | - | ||||||||||||
59 | - | |||||||||||||
60 | static int bio_new(BIO *bio) | - | ||||||||||||
61 | { | - | ||||||||||||
62 | struct bio_bio_st *b = CRYPTO_zalloc(sizeof(*b), __FILE__, 80); | - | ||||||||||||
63 | - | |||||||||||||
64 | if (b ==
| 0-176 | ||||||||||||
65 | ((void *)0)
| 0-176 | ||||||||||||
66 | ) | - | ||||||||||||
67 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
68 | - | |||||||||||||
69 | - | |||||||||||||
70 | b->size = 17 * 1024; | - | ||||||||||||
71 | - | |||||||||||||
72 | bio->ptr = b; | - | ||||||||||||
73 | return executed 176 times by 1 test: 1;return 1; Executed by:
executed 176 times by 1 test: return 1; Executed by:
| 176 | ||||||||||||
74 | } | - | ||||||||||||
75 | - | |||||||||||||
76 | static int bio_free(BIO *bio) | - | ||||||||||||
77 | { | - | ||||||||||||
78 | struct bio_bio_st *b; | - | ||||||||||||
79 | - | |||||||||||||
80 | if (bio ==
| 0-176 | ||||||||||||
81 | ((void *)0)
| 0-176 | ||||||||||||
82 | ) | - | ||||||||||||
83 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
84 | b = bio->ptr; | - | ||||||||||||
85 | - | |||||||||||||
86 | - | |||||||||||||
87 | ((void) (0)) | - | ||||||||||||
88 | ; | - | ||||||||||||
89 | - | |||||||||||||
90 | if (b->peer
| 88 | ||||||||||||
91 | bio_destroy_pair(bio); executed 88 times by 1 test: bio_destroy_pair(bio); Executed by:
| 88 | ||||||||||||
92 | - | |||||||||||||
93 | CRYPTO_free(b->buf, __FILE__, 105); | - | ||||||||||||
94 | CRYPTO_free(b, __FILE__, 106); | - | ||||||||||||
95 | - | |||||||||||||
96 | return executed 176 times by 1 test: 1;return 1; Executed by:
executed 176 times by 1 test: return 1; Executed by:
| 176 | ||||||||||||
97 | } | - | ||||||||||||
98 | - | |||||||||||||
99 | static int bio_read(BIO *bio, char *buf, int size_) | - | ||||||||||||
100 | { | - | ||||||||||||
101 | size_t size = size_; | - | ||||||||||||
102 | size_t rest; | - | ||||||||||||
103 | struct bio_bio_st *b, *peer_b; | - | ||||||||||||
104 | - | |||||||||||||
105 | BIO_clear_flags(bio, ((0x01|0x02|0x04)|0x08)); | - | ||||||||||||
106 | - | |||||||||||||
107 | if (!bio->init
| 0-6936 | ||||||||||||
108 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
109 | - | |||||||||||||
110 | b = bio->ptr; | - | ||||||||||||
111 | - | |||||||||||||
112 | ((void) (0)) | - | ||||||||||||
113 | ; | - | ||||||||||||
114 | - | |||||||||||||
115 | ((void) (0)) | - | ||||||||||||
116 | ; | - | ||||||||||||
117 | peer_b = b->peer->ptr; | - | ||||||||||||
118 | - | |||||||||||||
119 | ((void) (0)) | - | ||||||||||||
120 | ; | - | ||||||||||||
121 | - | |||||||||||||
122 | ((void) (0)) | - | ||||||||||||
123 | ; | - | ||||||||||||
124 | - | |||||||||||||
125 | peer_b->request = 0; | - | ||||||||||||
126 | - | |||||||||||||
127 | if (buf ==
| 0-6936 | ||||||||||||
128 | ((void *)0)
| 0-6936 | ||||||||||||
129 | || size == 0
| 0-6936 | ||||||||||||
130 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
131 | - | |||||||||||||
132 | if (peer_b->len == 0
| 3201-3735 | ||||||||||||
133 | if (peer_b->closed
| 0-3735 | ||||||||||||
134 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
135 | else { | - | ||||||||||||
136 | BIO_set_flags(bio, (0x01|0x08)); | - | ||||||||||||
137 | if (size <= peer_b->size
| 364-3371 | ||||||||||||
138 | peer_b->request = size; executed 3371 times by 1 test: peer_b->request = size; Executed by:
| 3371 | ||||||||||||
139 | else | - | ||||||||||||
140 | - | |||||||||||||
141 | - | |||||||||||||
142 | - | |||||||||||||
143 | peer_b->request = peer_b->size; executed 364 times by 1 test: peer_b->request = peer_b->size; Executed by:
| 364 | ||||||||||||
144 | return executed 3735 times by 1 test: -1;return -1; Executed by:
executed 3735 times by 1 test: return -1; Executed by:
| 3735 | ||||||||||||
145 | } | - | ||||||||||||
146 | } | - | ||||||||||||
147 | - | |||||||||||||
148 | - | |||||||||||||
149 | if (peer_b->len < size
| 858-2343 | ||||||||||||
150 | size = peer_b->len; executed 858 times by 1 test: size = peer_b->len; Executed by:
| 858 | ||||||||||||
151 | - | |||||||||||||
152 | - | |||||||||||||
153 | - | |||||||||||||
154 | rest = size; | - | ||||||||||||
155 | - | |||||||||||||
156 | - | |||||||||||||
157 | ((void) (0)) | - | ||||||||||||
158 | ; | - | ||||||||||||
159 | do { | - | ||||||||||||
160 | size_t chunk; | - | ||||||||||||
161 | - | |||||||||||||
162 | - | |||||||||||||
163 | ((void) (0)) | - | ||||||||||||
164 | ; | - | ||||||||||||
165 | if (peer_b->offset + rest <= peer_b->size
| 78-3201 | ||||||||||||
166 | chunk = rest; executed 3201 times by 1 test: chunk = rest; Executed by:
| 3201 | ||||||||||||
167 | else | - | ||||||||||||
168 | - | |||||||||||||
169 | chunk = peer_b->size - peer_b->offset; executed 78 times by 1 test: chunk = peer_b->size - peer_b->offset; Executed by:
| 78 | ||||||||||||
170 | - | |||||||||||||
171 | ((void) (0)) | - | ||||||||||||
172 | ; | - | ||||||||||||
173 | - | |||||||||||||
174 | memcpy(buf, peer_b->buf + peer_b->offset, chunk); | - | ||||||||||||
175 | - | |||||||||||||
176 | peer_b->len -= chunk; | - | ||||||||||||
177 | if (peer_b->len
| 1583-1696 | ||||||||||||
178 | peer_b->offset += chunk; | - | ||||||||||||
179 | - | |||||||||||||
180 | ((void) (0)) | - | ||||||||||||
181 | ; | - | ||||||||||||
182 | if (peer_b->offset == peer_b->size
| 78-1618 | ||||||||||||
183 | peer_b->offset = 0; executed 78 times by 1 test: peer_b->offset = 0; Executed by:
| 78 | ||||||||||||
184 | buf += chunk; | - | ||||||||||||
185 | } executed 1696 times by 1 test: else {end of block Executed by:
| 1696 | ||||||||||||
186 | - | |||||||||||||
187 | - | |||||||||||||
188 | ((void) (0)) | - | ||||||||||||
189 | ; | - | ||||||||||||
190 | peer_b->offset = 0; | - | ||||||||||||
191 | } executed 1583 times by 1 test: end of block Executed by:
| 1583 | ||||||||||||
192 | rest -= chunk; | - | ||||||||||||
193 | } executed 3279 times by 1 test: end of block Executed by:
| 3279 | ||||||||||||
194 | while (rest
| 78-3201 | ||||||||||||
195 | - | |||||||||||||
196 | return executed 3201 times by 1 test: size;return size; Executed by:
executed 3201 times by 1 test: return size; Executed by:
| 3201 | ||||||||||||
197 | } | - | ||||||||||||
198 | static ssize_t bio_nread0(BIO *bio, char **buf) | - | ||||||||||||
199 | { | - | ||||||||||||
200 | struct bio_bio_st *b, *peer_b; | - | ||||||||||||
201 | ssize_t num; | - | ||||||||||||
202 | - | |||||||||||||
203 | BIO_clear_flags(bio, ((0x01|0x02|0x04)|0x08)); | - | ||||||||||||
204 | - | |||||||||||||
205 | if (!bio->init
| 0-403 | ||||||||||||
206 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
207 | - | |||||||||||||
208 | b = bio->ptr; | - | ||||||||||||
209 | - | |||||||||||||
210 | ((void) (0)) | - | ||||||||||||
211 | ; | - | ||||||||||||
212 | - | |||||||||||||
213 | ((void) (0)) | - | ||||||||||||
214 | ; | - | ||||||||||||
215 | peer_b = b->peer->ptr; | - | ||||||||||||
216 | - | |||||||||||||
217 | ((void) (0)) | - | ||||||||||||
218 | ; | - | ||||||||||||
219 | - | |||||||||||||
220 | ((void) (0)) | - | ||||||||||||
221 | ; | - | ||||||||||||
222 | - | |||||||||||||
223 | peer_b->request = 0; | - | ||||||||||||
224 | - | |||||||||||||
225 | if (peer_b->len == 0
| 0-403 | ||||||||||||
226 | char dummy; | - | ||||||||||||
227 | - | |||||||||||||
228 | - | |||||||||||||
229 | return never executed: bio_read(bio, &dummy, 1);return bio_read(bio, &dummy, 1); never executed: return bio_read(bio, &dummy, 1); | 0 | ||||||||||||
230 | } | - | ||||||||||||
231 | - | |||||||||||||
232 | num = peer_b->len; | - | ||||||||||||
233 | if (peer_b->size < peer_b->offset + num
| 0-403 | ||||||||||||
234 | - | |||||||||||||
235 | num = peer_b->size - peer_b->offset; never executed: num = peer_b->size - peer_b->offset; | 0 | ||||||||||||
236 | - | |||||||||||||
237 | ((void) (0)) | - | ||||||||||||
238 | ; | - | ||||||||||||
239 | - | |||||||||||||
240 | if (buf !=
| 0-403 | ||||||||||||
241 | ((void *)0)
| 0-403 | ||||||||||||
242 | ) | - | ||||||||||||
243 | * executed 403 times by 1 test: buf = peer_b->buf + peer_b->offset;*buf = peer_b->buf + peer_b->offset; Executed by:
executed 403 times by 1 test: *buf = peer_b->buf + peer_b->offset; Executed by:
| 403 | ||||||||||||
244 | return executed 403 times by 1 test: num;return num; Executed by:
executed 403 times by 1 test: return num; Executed by:
| 403 | ||||||||||||
245 | } | - | ||||||||||||
246 | - | |||||||||||||
247 | static ssize_t bio_nread(BIO *bio, char **buf, size_t num_) | - | ||||||||||||
248 | { | - | ||||||||||||
249 | struct bio_bio_st *b, *peer_b; | - | ||||||||||||
250 | ssize_t num, available; | - | ||||||||||||
251 | - | |||||||||||||
252 | if (num_ > 0x7fffffffffffffffL
| 0-403 | ||||||||||||
253 | num = 0x7fffffffffffffffL; never executed: num = 0x7fffffffffffffffL; | 0 | ||||||||||||
254 | else | - | ||||||||||||
255 | num = (ssize_t) num_; executed 403 times by 1 test: num = (ssize_t) num_; Executed by:
| 403 | ||||||||||||
256 | - | |||||||||||||
257 | available = bio_nread0(bio, buf); | - | ||||||||||||
258 | if (num > available
| 0-403 | ||||||||||||
259 | num = available; never executed: num = available; | 0 | ||||||||||||
260 | if (num <= 0
| 0-403 | ||||||||||||
261 | return never executed: num;return num; never executed: return num; | 0 | ||||||||||||
262 | - | |||||||||||||
263 | b = bio->ptr; | - | ||||||||||||
264 | peer_b = b->peer->ptr; | - | ||||||||||||
265 | - | |||||||||||||
266 | peer_b->len -= num; | - | ||||||||||||
267 | if (peer_b->len
| 0-403 | ||||||||||||
268 | peer_b->offset += num; | - | ||||||||||||
269 | - | |||||||||||||
270 | ((void) (0)) | - | ||||||||||||
271 | ; | - | ||||||||||||
272 | if (peer_b->offset == peer_b->size
| 0 | ||||||||||||
273 | peer_b->offset = 0; never executed: peer_b->offset = 0; | 0 | ||||||||||||
274 | } never executed: elseend of block | 0 | ||||||||||||
275 | peer_b->offset = 0; executed 403 times by 1 test: peer_b->offset = 0; Executed by:
| 403 | ||||||||||||
276 | - | |||||||||||||
277 | return executed 403 times by 1 test: num;return num; Executed by:
executed 403 times by 1 test: return num; Executed by:
| 403 | ||||||||||||
278 | } | - | ||||||||||||
279 | - | |||||||||||||
280 | static int bio_write(BIO *bio, const char *buf, int num_) | - | ||||||||||||
281 | { | - | ||||||||||||
282 | size_t num = num_; | - | ||||||||||||
283 | size_t rest; | - | ||||||||||||
284 | struct bio_bio_st *b; | - | ||||||||||||
285 | - | |||||||||||||
286 | BIO_clear_flags(bio, ((0x01|0x02|0x04)|0x08)); | - | ||||||||||||
287 | - | |||||||||||||
288 | if (!bio->init
| 0-2434 | ||||||||||||
289 | ((void *)0)
| 0-2434 | ||||||||||||
290 | || num == 0
| 0-2434 | ||||||||||||
291 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
292 | - | |||||||||||||
293 | b = bio->ptr; | - | ||||||||||||
294 | - | |||||||||||||
295 | ((void) (0)) | - | ||||||||||||
296 | ; | - | ||||||||||||
297 | - | |||||||||||||
298 | ((void) (0)) | - | ||||||||||||
299 | ; | - | ||||||||||||
300 | - | |||||||||||||
301 | ((void) (0)) | - | ||||||||||||
302 | ; | - | ||||||||||||
303 | - | |||||||||||||
304 | b->request = 0; | - | ||||||||||||
305 | if (b->closed
| 0-2434 | ||||||||||||
306 | - | |||||||||||||
307 | ERR_put_error(32,(113),(124),__FILE__,289); | - | ||||||||||||
308 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||
309 | } | - | ||||||||||||
310 | - | |||||||||||||
311 | - | |||||||||||||
312 | ((void) (0)) | - | ||||||||||||
313 | ; | - | ||||||||||||
314 | - | |||||||||||||
315 | if (b->len == b->size
| 1047-1387 | ||||||||||||
316 | BIO_set_flags(bio, (0x02|0x08)); | - | ||||||||||||
317 | return executed 1047 times by 1 test: -1;return -1; Executed by:
executed 1047 times by 1 test: return -1; Executed by:
| 1047 | ||||||||||||
318 | } | - | ||||||||||||
319 | - | |||||||||||||
320 | - | |||||||||||||
321 | if (num > b->size - b->len
| 674-713 | ||||||||||||
322 | num = b->size - b->len; executed 713 times by 1 test: num = b->size - b->len; Executed by:
| 713 | ||||||||||||
323 | - | |||||||||||||
324 | - | |||||||||||||
325 | - | |||||||||||||
326 | rest = num; | - | ||||||||||||
327 | - | |||||||||||||
328 | - | |||||||||||||
329 | ((void) (0)) | - | ||||||||||||
330 | ; | - | ||||||||||||
331 | do { | - | ||||||||||||
332 | size_t write_offset; | - | ||||||||||||
333 | size_t chunk; | - | ||||||||||||
334 | - | |||||||||||||
335 | - | |||||||||||||
336 | ((void) (0)) | - | ||||||||||||
337 | ; | - | ||||||||||||
338 | - | |||||||||||||
339 | write_offset = b->offset + b->len; | - | ||||||||||||
340 | if (write_offset >= b->size
| 350-1064 | ||||||||||||
341 | write_offset -= b->size; executed 350 times by 1 test: write_offset -= b->size; Executed by:
| 350 | ||||||||||||
342 | - | |||||||||||||
343 | - | |||||||||||||
344 | if (write_offset + rest <= b->size
| 27-1387 | ||||||||||||
345 | chunk = rest; executed 1387 times by 1 test: chunk = rest; Executed by:
| 1387 | ||||||||||||
346 | else | - | ||||||||||||
347 | - | |||||||||||||
348 | chunk = b->size - write_offset; executed 27 times by 1 test: chunk = b->size - write_offset; Executed by:
| 27 | ||||||||||||
349 | - | |||||||||||||
350 | memcpy(b->buf + write_offset, buf, chunk); | - | ||||||||||||
351 | - | |||||||||||||
352 | b->len += chunk; | - | ||||||||||||
353 | - | |||||||||||||
354 | - | |||||||||||||
355 | ((void) (0)) | - | ||||||||||||
356 | ; | - | ||||||||||||
357 | - | |||||||||||||
358 | rest -= chunk; | - | ||||||||||||
359 | buf += chunk; | - | ||||||||||||
360 | } executed 1414 times by 1 test: end of block Executed by:
| 1414 | ||||||||||||
361 | while (rest
| 27-1387 | ||||||||||||
362 | - | |||||||||||||
363 | return executed 1387 times by 1 test: num;return num; Executed by:
executed 1387 times by 1 test: return num; Executed by:
| 1387 | ||||||||||||
364 | } | - | ||||||||||||
365 | static ssize_t bio_nwrite0(BIO *bio, char **buf) | - | ||||||||||||
366 | { | - | ||||||||||||
367 | struct bio_bio_st *b; | - | ||||||||||||
368 | size_t num; | - | ||||||||||||
369 | size_t write_offset; | - | ||||||||||||
370 | - | |||||||||||||
371 | BIO_clear_flags(bio, ((0x01|0x02|0x04)|0x08)); | - | ||||||||||||
372 | - | |||||||||||||
373 | if (!bio->init
| 0-2110 | ||||||||||||
374 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
375 | - | |||||||||||||
376 | b = bio->ptr; | - | ||||||||||||
377 | - | |||||||||||||
378 | ((void) (0)) | - | ||||||||||||
379 | ; | - | ||||||||||||
380 | - | |||||||||||||
381 | ((void) (0)) | - | ||||||||||||
382 | ; | - | ||||||||||||
383 | - | |||||||||||||
384 | ((void) (0)) | - | ||||||||||||
385 | ; | - | ||||||||||||
386 | - | |||||||||||||
387 | b->request = 0; | - | ||||||||||||
388 | if (b->closed
| 0-2110 | ||||||||||||
389 | ERR_put_error(32,(122),(124),__FILE__,365); | - | ||||||||||||
390 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||
391 | } | - | ||||||||||||
392 | - | |||||||||||||
393 | - | |||||||||||||
394 | ((void) (0)) | - | ||||||||||||
395 | ; | - | ||||||||||||
396 | - | |||||||||||||
397 | if (b->len == b->size
| 0-2110 | ||||||||||||
398 | BIO_set_flags(bio, (0x02|0x08)); | - | ||||||||||||
399 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||
400 | } | - | ||||||||||||
401 | - | |||||||||||||
402 | num = b->size - b->len; | - | ||||||||||||
403 | write_offset = b->offset + b->len; | - | ||||||||||||
404 | if (write_offset >= b->size
| 0-2110 | ||||||||||||
405 | write_offset -= b->size; never executed: write_offset -= b->size; | 0 | ||||||||||||
406 | if (write_offset + num > b->size
| 0-2110 | ||||||||||||
407 | - | |||||||||||||
408 | - | |||||||||||||
409 | - | |||||||||||||
410 | - | |||||||||||||
411 | - | |||||||||||||
412 | num = b->size - write_offset; never executed: num = b->size - write_offset; | 0 | ||||||||||||
413 | - | |||||||||||||
414 | if (buf !=
| 0-2110 | ||||||||||||
415 | ((void *)0)
| 0-2110 | ||||||||||||
416 | ) | - | ||||||||||||
417 | * executed 2110 times by 1 test: buf = b->buf + write_offset;*buf = b->buf + write_offset; Executed by:
executed 2110 times by 1 test: *buf = b->buf + write_offset; Executed by:
| 2110 | ||||||||||||
418 | - | |||||||||||||
419 | ((void) (0)) | - | ||||||||||||
420 | ; | - | ||||||||||||
421 | - | |||||||||||||
422 | return executed 2110 times by 1 test: num;return num; Executed by:
executed 2110 times by 1 test: return num; Executed by:
| 2110 | ||||||||||||
423 | } | - | ||||||||||||
424 | - | |||||||||||||
425 | static ssize_t bio_nwrite(BIO *bio, char **buf, size_t num_) | - | ||||||||||||
426 | { | - | ||||||||||||
427 | struct bio_bio_st *b; | - | ||||||||||||
428 | ssize_t num, space; | - | ||||||||||||
429 | - | |||||||||||||
430 | if (num_ > 0x7fffffffffffffffL
| 0-1055 | ||||||||||||
431 | num = 0x7fffffffffffffffL; never executed: num = 0x7fffffffffffffffL; | 0 | ||||||||||||
432 | else | - | ||||||||||||
433 | num = (ssize_t) num_; executed 1055 times by 1 test: num = (ssize_t) num_; Executed by:
| 1055 | ||||||||||||
434 | - | |||||||||||||
435 | space = bio_nwrite0(bio, buf); | - | ||||||||||||
436 | if (num > space
| 0-1055 | ||||||||||||
437 | num = space; never executed: num = space; | 0 | ||||||||||||
438 | if (num <= 0
| 0-1055 | ||||||||||||
439 | return never executed: num;return num; never executed: return num; | 0 | ||||||||||||
440 | b = bio->ptr; | - | ||||||||||||
441 | - | |||||||||||||
442 | ((void) (0)) | - | ||||||||||||
443 | ; | - | ||||||||||||
444 | b->len += num; | - | ||||||||||||
445 | - | |||||||||||||
446 | ((void) (0)) | - | ||||||||||||
447 | ; | - | ||||||||||||
448 | - | |||||||||||||
449 | return executed 1055 times by 1 test: num;return num; Executed by:
executed 1055 times by 1 test: return num; Executed by:
| 1055 | ||||||||||||
450 | } | - | ||||||||||||
451 | - | |||||||||||||
452 | static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr) | - | ||||||||||||
453 | { | - | ||||||||||||
454 | long ret; | - | ||||||||||||
455 | struct bio_bio_st *b = bio->ptr; | - | ||||||||||||
456 | - | |||||||||||||
457 | - | |||||||||||||
458 | ((void) (0)) | - | ||||||||||||
459 | ; | - | ||||||||||||
460 | - | |||||||||||||
461 | switch (cmd) { | - | ||||||||||||
462 | - | |||||||||||||
463 | - | |||||||||||||
464 | case executed 176 times by 1 test: 136:case 136: Executed by:
executed 176 times by 1 test: case 136: Executed by:
| 176 | ||||||||||||
465 | if (b->peer
| 0-176 | ||||||||||||
466 | ERR_put_error(32,(103),(123),__FILE__,430); | - | ||||||||||||
467 | ret = 0; | - | ||||||||||||
468 | } never executed: else if (num == 0end of block
| 0-176 | ||||||||||||
469 | ERR_put_error(32,(103),(125),__FILE__,433); | - | ||||||||||||
470 | ret = 0; | - | ||||||||||||
471 | } never executed: else {end of block | 0 | ||||||||||||
472 | size_t new_size = num; | - | ||||||||||||
473 | - | |||||||||||||
474 | if (b->size != new_size
| 0-176 | ||||||||||||
475 | CRYPTO_free(b->buf, __FILE__, 439); | - | ||||||||||||
476 | b->buf = | - | ||||||||||||
477 | ((void *)0) | - | ||||||||||||
478 | ; | - | ||||||||||||
479 | b->size = new_size; | - | ||||||||||||
480 | } executed 176 times by 1 test: end of block Executed by:
| 176 | ||||||||||||
481 | ret = 1; | - | ||||||||||||
482 | } executed 176 times by 1 test: end of block Executed by:
| 176 | ||||||||||||
483 | break; executed 176 times by 1 test: break; Executed by:
| 176 | ||||||||||||
484 | - | |||||||||||||
485 | case never executed: 137:case 137: never executed: case 137: | 0 | ||||||||||||
486 | ret = (long)b->size; | - | ||||||||||||
487 | break; never executed: break; | 0 | ||||||||||||
488 | - | |||||||||||||
489 | case executed 88 times by 1 test: 138:case 138: Executed by:
executed 88 times by 1 test: case 138: Executed by:
| 88 | ||||||||||||
490 | { | - | ||||||||||||
491 | BIO *other_bio = ptr; | - | ||||||||||||
492 | - | |||||||||||||
493 | if (bio_make_pair(bio, other_bio)
| 0-88 | ||||||||||||
494 | ret = 1; executed 88 times by 1 test: ret = 1; Executed by:
| 88 | ||||||||||||
495 | else | - | ||||||||||||
496 | ret = 0; never executed: ret = 0; | 0 | ||||||||||||
497 | } | - | ||||||||||||
498 | break; executed 88 times by 1 test: break; Executed by:
| 88 | ||||||||||||
499 | - | |||||||||||||
500 | case never executed: 139:case 139: never executed: case 139: | 0 | ||||||||||||
501 | - | |||||||||||||
502 | - | |||||||||||||
503 | - | |||||||||||||
504 | - | |||||||||||||
505 | bio_destroy_pair(bio); | - | ||||||||||||
506 | ret = 1; | - | ||||||||||||
507 | break; never executed: break; | 0 | ||||||||||||
508 | - | |||||||||||||
509 | case executed 1814 times by 1 test: 140:case 140: Executed by:
executed 1814 times by 1 test: case 140: Executed by:
| 1814 | ||||||||||||
510 | - | |||||||||||||
511 | - | |||||||||||||
512 | - | |||||||||||||
513 | - | |||||||||||||
514 | if (b->peer ==
| 0-1814 | ||||||||||||
515 | ((void *)0)
| 0-1814 | ||||||||||||
516 | || b->closed
| 0-1814 | ||||||||||||
517 | ret = 0; never executed: ret = 0; | 0 | ||||||||||||
518 | else | - | ||||||||||||
519 | ret = (long)b->size - b->len; executed 1814 times by 1 test: ret = (long)b->size - b->len; Executed by:
| 1814 | ||||||||||||
520 | break; executed 1814 times by 1 test: break; Executed by:
| 1814 | ||||||||||||
521 | - | |||||||||||||
522 | case executed 1411 times by 1 test: 141:case 141: Executed by:
executed 1411 times by 1 test: case 141: Executed by:
| 1411 | ||||||||||||
523 | - | |||||||||||||
524 | - | |||||||||||||
525 | - | |||||||||||||
526 | - | |||||||||||||
527 | - | |||||||||||||
528 | ret = (long)b->request; | - | ||||||||||||
529 | break; executed 1411 times by 1 test: break; Executed by:
| 1411 | ||||||||||||
530 | - | |||||||||||||
531 | case never executed: 147:case 147: never executed: case 147: | 0 | ||||||||||||
532 | - | |||||||||||||
533 | - | |||||||||||||
534 | - | |||||||||||||
535 | - | |||||||||||||
536 | - | |||||||||||||
537 | b->request = 0; | - | ||||||||||||
538 | ret = 1; | - | ||||||||||||
539 | break; never executed: break; | 0 | ||||||||||||
540 | - | |||||||||||||
541 | case never executed: 142:case 142: never executed: case 142: | 0 | ||||||||||||
542 | - | |||||||||||||
543 | b->closed = 1; | - | ||||||||||||
544 | ret = 1; | - | ||||||||||||
545 | break; never executed: break; | 0 | ||||||||||||
546 | - | |||||||||||||
547 | case never executed: 143:case 143: never executed: case 143: | 0 | ||||||||||||
548 | - | |||||||||||||
549 | ret = (long)bio_nread0(bio, ptr); | - | ||||||||||||
550 | break; never executed: break; | 0 | ||||||||||||
551 | - | |||||||||||||
552 | case executed 403 times by 1 test: 144:case 144: Executed by:
executed 403 times by 1 test: case 144: Executed by:
| 403 | ||||||||||||
553 | - | |||||||||||||
554 | ret = (long)bio_nread(bio, ptr, (size_t)num); | - | ||||||||||||
555 | break; executed 403 times by 1 test: break; Executed by:
| 403 | ||||||||||||
556 | - | |||||||||||||
557 | case executed 1055 times by 1 test: 145:case 145: Executed by:
executed 1055 times by 1 test: case 145: Executed by:
| 1055 | ||||||||||||
558 | - | |||||||||||||
559 | ret = (long)bio_nwrite0(bio, ptr); | - | ||||||||||||
560 | break; executed 1055 times by 1 test: break; Executed by:
| 1055 | ||||||||||||
561 | - | |||||||||||||
562 | case executed 1055 times by 1 test: 146:case 146: Executed by:
executed 1055 times by 1 test: case 146: Executed by:
| 1055 | ||||||||||||
563 | - | |||||||||||||
564 | ret = (long)bio_nwrite(bio, ptr, (size_t)num); | - | ||||||||||||
565 | break; executed 1055 times by 1 test: break; Executed by:
| 1055 | ||||||||||||
566 | - | |||||||||||||
567 | - | |||||||||||||
568 | - | |||||||||||||
569 | case never executed: 1:case 1: never executed: case 1: | 0 | ||||||||||||
570 | if (b->buf !=
| 0 | ||||||||||||
571 | ((void *)0)
| 0 | ||||||||||||
572 | ) { | - | ||||||||||||
573 | b->len = 0; | - | ||||||||||||
574 | b->offset = 0; | - | ||||||||||||
575 | } never executed: end of block | 0 | ||||||||||||
576 | ret = 0; | - | ||||||||||||
577 | break; never executed: break; | 0 | ||||||||||||
578 | - | |||||||||||||
579 | case never executed: 8:case 8: never executed: case 8: | 0 | ||||||||||||
580 | ret = bio->shutdown; | - | ||||||||||||
581 | break; never executed: break; | 0 | ||||||||||||
582 | - | |||||||||||||
583 | case never executed: 9:case 9: never executed: case 9: | 0 | ||||||||||||
584 | bio->shutdown = (int)num; | - | ||||||||||||
585 | ret = 1; | - | ||||||||||||
586 | break; never executed: break; | 0 | ||||||||||||
587 | - | |||||||||||||
588 | case executed 3225 times by 1 test: 10:case 10: Executed by:
executed 3225 times by 1 test: case 10: Executed by:
| 3225 | ||||||||||||
589 | if (b->peer !=
| 0-3225 | ||||||||||||
590 | ((void *)0)
| 0-3225 | ||||||||||||
591 | ) { | - | ||||||||||||
592 | struct bio_bio_st *peer_b = b->peer->ptr; | - | ||||||||||||
593 | - | |||||||||||||
594 | ret = (long)peer_b->len; | - | ||||||||||||
595 | } executed 3225 times by 1 test: elseend of block Executed by:
| 3225 | ||||||||||||
596 | ret = 0; never executed: ret = 0; | 0 | ||||||||||||
597 | break; executed 3225 times by 1 test: break; Executed by:
| 3225 | ||||||||||||
598 | - | |||||||||||||
599 | case never executed: 13:case 13: never executed: case 13: | 0 | ||||||||||||
600 | if (b->buf !=
| 0 | ||||||||||||
601 | ((void *)0)
| 0 | ||||||||||||
602 | ) | - | ||||||||||||
603 | ret = (long)b->len; never executed: ret = (long)b->len; | 0 | ||||||||||||
604 | else | - | ||||||||||||
605 | ret = 0; never executed: ret = 0; | 0 | ||||||||||||
606 | break; never executed: break; | 0 | ||||||||||||
607 | - | |||||||||||||
608 | case never executed: 12:case 12: never executed: case 12: | 0 | ||||||||||||
609 | - | |||||||||||||
610 | { | - | ||||||||||||
611 | BIO *other_bio = ptr; | - | ||||||||||||
612 | struct bio_bio_st *other_b; | - | ||||||||||||
613 | - | |||||||||||||
614 | - | |||||||||||||
615 | ((void) (0)) | - | ||||||||||||
616 | ; | - | ||||||||||||
617 | other_b = other_bio->ptr; | - | ||||||||||||
618 | - | |||||||||||||
619 | ((void) (0)) | - | ||||||||||||
620 | ; | - | ||||||||||||
621 | - | |||||||||||||
622 | - | |||||||||||||
623 | ((void) (0)) | - | ||||||||||||
624 | ; | - | ||||||||||||
625 | - | |||||||||||||
626 | other_b->size = b->size; | - | ||||||||||||
627 | } | - | ||||||||||||
628 | - | |||||||||||||
629 | ret = 1; | - | ||||||||||||
630 | break; never executed: break; | 0 | ||||||||||||
631 | - | |||||||||||||
632 | case executed 183 times by 1 test: 11:case 11: Executed by:
executed 183 times by 1 test: case 11: Executed by:
| 183 | ||||||||||||
633 | ret = 1; | - | ||||||||||||
634 | break; executed 183 times by 1 test: break; Executed by:
| 183 | ||||||||||||
635 | - | |||||||||||||
636 | case never executed: 2:case 2: never executed: case 2: | 0 | ||||||||||||
637 | if (b->peer !=
| 0 | ||||||||||||
638 | ((void *)0)
| 0 | ||||||||||||
639 | ) { | - | ||||||||||||
640 | struct bio_bio_st *peer_b = b->peer->ptr; | - | ||||||||||||
641 | - | |||||||||||||
642 | if (peer_b->len == 0
| 0 | ||||||||||||
643 | ret = 1; never executed: ret = 1; | 0 | ||||||||||||
644 | else | - | ||||||||||||
645 | ret = 0; never executed: ret = 0; | 0 | ||||||||||||
646 | } else { | - | ||||||||||||
647 | ret = 1; | - | ||||||||||||
648 | } never executed: end of block | 0 | ||||||||||||
649 | break; never executed: break; | 0 | ||||||||||||
650 | - | |||||||||||||
651 | default executed 204 times by 1 test: :default: Executed by:
executed 204 times by 1 test: default: Executed by:
| 204 | ||||||||||||
652 | ret = 0; | - | ||||||||||||
653 | } executed 204 times by 1 test: end of block Executed by:
| 204 | ||||||||||||
654 | return executed 9614 times by 1 test: ret;return ret; Executed by:
executed 9614 times by 1 test: return ret; Executed by:
| 9614 | ||||||||||||
655 | } | - | ||||||||||||
656 | - | |||||||||||||
657 | static int bio_puts(BIO *bio, const char *str) | - | ||||||||||||
658 | { | - | ||||||||||||
659 | return never executed: bio_write(bio, str, strlen(str));return bio_write(bio, str, strlen(str)); never executed: return bio_write(bio, str, strlen(str)); | 0 | ||||||||||||
660 | } | - | ||||||||||||
661 | - | |||||||||||||
662 | static int bio_make_pair(BIO *bio1, BIO *bio2) | - | ||||||||||||
663 | { | - | ||||||||||||
664 | struct bio_bio_st *b1, *b2; | - | ||||||||||||
665 | - | |||||||||||||
666 | - | |||||||||||||
667 | ((void) (0)) | - | ||||||||||||
668 | ; | - | ||||||||||||
669 | - | |||||||||||||
670 | ((void) (0)) | - | ||||||||||||
671 | ; | - | ||||||||||||
672 | - | |||||||||||||
673 | b1 = bio1->ptr; | - | ||||||||||||
674 | b2 = bio2->ptr; | - | ||||||||||||
675 | - | |||||||||||||
676 | if (b1->peer !=
| 0-88 | ||||||||||||
677 | ((void *)0)
| 0-88 | ||||||||||||
678 | || b2->peer !=
| 0-88 | ||||||||||||
679 | ((void *)0)
| 0-88 | ||||||||||||
680 | ) { | - | ||||||||||||
681 | ERR_put_error(32,(121),(123),__FILE__,619); | - | ||||||||||||
682 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
683 | } | - | ||||||||||||
684 | - | |||||||||||||
685 | if (b1->buf ==
| 0-88 | ||||||||||||
686 | ((void *)0)
| 0-88 | ||||||||||||
687 | ) { | - | ||||||||||||
688 | b1->buf = CRYPTO_malloc(b1->size, __FILE__, 624); | - | ||||||||||||
689 | if (b1->buf ==
| 0-88 | ||||||||||||
690 | ((void *)0)
| 0-88 | ||||||||||||
691 | ) { | - | ||||||||||||
692 | ERR_put_error(32,(121),((1|64)),__FILE__,626); | - | ||||||||||||
693 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
694 | } | - | ||||||||||||
695 | b1->len = 0; | - | ||||||||||||
696 | b1->offset = 0; | - | ||||||||||||
697 | } executed 88 times by 1 test: end of block Executed by:
| 88 | ||||||||||||
698 | - | |||||||||||||
699 | if (b2->buf ==
| 0-88 | ||||||||||||
700 | ((void *)0)
| 0-88 | ||||||||||||
701 | ) { | - | ||||||||||||
702 | b2->buf = CRYPTO_malloc(b2->size, __FILE__, 634); | - | ||||||||||||
703 | if (b2->buf ==
| 0-88 | ||||||||||||
704 | ((void *)0)
| 0-88 | ||||||||||||
705 | ) { | - | ||||||||||||
706 | ERR_put_error(32,(121),((1|64)),__FILE__,636); | - | ||||||||||||
707 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
708 | } | - | ||||||||||||
709 | b2->len = 0; | - | ||||||||||||
710 | b2->offset = 0; | - | ||||||||||||
711 | } executed 88 times by 1 test: end of block Executed by:
| 88 | ||||||||||||
712 | - | |||||||||||||
713 | b1->peer = bio2; | - | ||||||||||||
714 | b1->closed = 0; | - | ||||||||||||
715 | b1->request = 0; | - | ||||||||||||
716 | b2->peer = bio1; | - | ||||||||||||
717 | b2->closed = 0; | - | ||||||||||||
718 | b2->request = 0; | - | ||||||||||||
719 | - | |||||||||||||
720 | bio1->init = 1; | - | ||||||||||||
721 | bio2->init = 1; | - | ||||||||||||
722 | - | |||||||||||||
723 | return executed 88 times by 1 test: 1;return 1; Executed by:
executed 88 times by 1 test: return 1; Executed by:
| 88 | ||||||||||||
724 | } | - | ||||||||||||
725 | - | |||||||||||||
726 | static void bio_destroy_pair(BIO *bio) | - | ||||||||||||
727 | { | - | ||||||||||||
728 | struct bio_bio_st *b = bio->ptr; | - | ||||||||||||
729 | - | |||||||||||||
730 | if (b !=
| 0-88 | ||||||||||||
731 | ((void *)0)
| 0-88 | ||||||||||||
732 | ) { | - | ||||||||||||
733 | BIO *peer_bio = b->peer; | - | ||||||||||||
734 | - | |||||||||||||
735 | if (peer_bio !=
| 0-88 | ||||||||||||
736 | ((void *)0)
| 0-88 | ||||||||||||
737 | ) { | - | ||||||||||||
738 | struct bio_bio_st *peer_b = peer_bio->ptr; | - | ||||||||||||
739 | - | |||||||||||||
740 | - | |||||||||||||
741 | ((void) (0)) | - | ||||||||||||
742 | ; | - | ||||||||||||
743 | - | |||||||||||||
744 | ((void) (0)) | - | ||||||||||||
745 | ; | - | ||||||||||||
746 | - | |||||||||||||
747 | peer_b->peer = | - | ||||||||||||
748 | ((void *)0) | - | ||||||||||||
749 | ; | - | ||||||||||||
750 | peer_bio->init = 0; | - | ||||||||||||
751 | - | |||||||||||||
752 | ((void) (0)) | - | ||||||||||||
753 | ; | - | ||||||||||||
754 | peer_b->len = 0; | - | ||||||||||||
755 | peer_b->offset = 0; | - | ||||||||||||
756 | - | |||||||||||||
757 | b->peer = | - | ||||||||||||
758 | ((void *)0) | - | ||||||||||||
759 | ; | - | ||||||||||||
760 | bio->init = 0; | - | ||||||||||||
761 | - | |||||||||||||
762 | ((void) (0)) | - | ||||||||||||
763 | ; | - | ||||||||||||
764 | b->len = 0; | - | ||||||||||||
765 | b->offset = 0; | - | ||||||||||||
766 | } executed 88 times by 1 test: end of block Executed by:
| 88 | ||||||||||||
767 | } executed 88 times by 1 test: end of block Executed by:
| 88 | ||||||||||||
768 | } executed 88 times by 1 test: end of block Executed by:
| 88 | ||||||||||||
769 | - | |||||||||||||
770 | - | |||||||||||||
771 | int BIO_new_bio_pair(BIO **bio1_p, size_t writebuf1, | - | ||||||||||||
772 | BIO **bio2_p, size_t writebuf2) | - | ||||||||||||
773 | { | - | ||||||||||||
774 | BIO *bio1 = | - | ||||||||||||
775 | ((void *)0) | - | ||||||||||||
776 | , *bio2 = | - | ||||||||||||
777 | ((void *)0) | - | ||||||||||||
778 | ; | - | ||||||||||||
779 | long r; | - | ||||||||||||
780 | int ret = 0; | - | ||||||||||||
781 | - | |||||||||||||
782 | bio1 = BIO_new(BIO_s_bio()); | - | ||||||||||||
783 | if (bio1 ==
| 0-88 | ||||||||||||
784 | ((void *)0)
| 0-88 | ||||||||||||
785 | ) | - | ||||||||||||
786 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
787 | bio2 = BIO_new(BIO_s_bio()); | - | ||||||||||||
788 | if (bio2 ==
| 0-88 | ||||||||||||
789 | ((void *)0)
| 0-88 | ||||||||||||
790 | ) | - | ||||||||||||
791 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
792 | - | |||||||||||||
793 | if (writebuf1
| 0-88 | ||||||||||||
794 | r = (int)BIO_ctrl(bio1,136,writebuf1, | - | ||||||||||||
795 | ((void *)0) | - | ||||||||||||
796 | ); | - | ||||||||||||
797 | if (!r
| 0-88 | ||||||||||||
798 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
799 | } executed 88 times by 1 test: end of block Executed by:
| 88 | ||||||||||||
800 | if (writebuf2
| 0-88 | ||||||||||||
801 | r = (int)BIO_ctrl(bio2,136,writebuf2, | - | ||||||||||||
802 | ((void *)0) | - | ||||||||||||
803 | ); | - | ||||||||||||
804 | if (!r
| 0-88 | ||||||||||||
805 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
806 | } executed 88 times by 1 test: end of block Executed by:
| 88 | ||||||||||||
807 | - | |||||||||||||
808 | r = (int)BIO_ctrl(bio1,138,0,bio2); | - | ||||||||||||
809 | if (!r
| 0-88 | ||||||||||||
810 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
811 | ret = 1; | - | ||||||||||||
812 | - | |||||||||||||
813 | err: code before this statement executed 88 times by 1 test: err: Executed by:
| 88 | ||||||||||||
814 | if (ret == 0
| 0-88 | ||||||||||||
815 | BIO_free(bio1); | - | ||||||||||||
816 | bio1 = | - | ||||||||||||
817 | ((void *)0) | - | ||||||||||||
818 | ; | - | ||||||||||||
819 | BIO_free(bio2); | - | ||||||||||||
820 | bio2 = | - | ||||||||||||
821 | ((void *)0) | - | ||||||||||||
822 | ; | - | ||||||||||||
823 | } never executed: end of block | 0 | ||||||||||||
824 | - | |||||||||||||
825 | *bio1_p = bio1; | - | ||||||||||||
826 | *bio2_p = bio2; | - | ||||||||||||
827 | return executed 88 times by 1 test: ret;return ret; Executed by:
executed 88 times by 1 test: return ret; Executed by:
| 88 | ||||||||||||
828 | } | - | ||||||||||||
829 | - | |||||||||||||
830 | size_t BIO_ctrl_get_write_guarantee(BIO *bio) | - | ||||||||||||
831 | { | - | ||||||||||||
832 | return executed 1814 times by 1 test: BIO_ctrl(bio, 140, 0, return BIO_ctrl(bio, 140, 0, ((void *)0) ); Executed by:
executed 1814 times by 1 test: return BIO_ctrl(bio, 140, 0, ((void *)0) ); Executed by:
| 1814 | ||||||||||||
833 | ((void *)0) executed 1814 times by 1 test: return BIO_ctrl(bio, 140, 0, ((void *)0) ); Executed by:
| 1814 | ||||||||||||
834 | ); executed 1814 times by 1 test: return BIO_ctrl(bio, 140, 0, ((void *)0) ); Executed by:
| 1814 | ||||||||||||
835 | } | - | ||||||||||||
836 | - | |||||||||||||
837 | size_t BIO_ctrl_get_read_request(BIO *bio) | - | ||||||||||||
838 | { | - | ||||||||||||
839 | return executed 1411 times by 1 test: BIO_ctrl(bio, 141, 0, return BIO_ctrl(bio, 141, 0, ((void *)0) ); Executed by:
executed 1411 times by 1 test: return BIO_ctrl(bio, 141, 0, ((void *)0) ); Executed by:
| 1411 | ||||||||||||
840 | ((void *)0) executed 1411 times by 1 test: return BIO_ctrl(bio, 141, 0, ((void *)0) ); Executed by:
| 1411 | ||||||||||||
841 | ); executed 1411 times by 1 test: return BIO_ctrl(bio, 141, 0, ((void *)0) ); Executed by:
| 1411 | ||||||||||||
842 | } | - | ||||||||||||
843 | - | |||||||||||||
844 | int BIO_ctrl_reset_read_request(BIO *bio) | - | ||||||||||||
845 | { | - | ||||||||||||
846 | return never executed: (BIO_ctrl(bio, 147, 0, return (BIO_ctrl(bio, 147, 0, ((void *)0) ) != 0); never executed: return (BIO_ctrl(bio, 147, 0, ((void *)0) ) != 0); | 0 | ||||||||||||
847 | ((void *)0) never executed: return (BIO_ctrl(bio, 147, 0, ((void *)0) ) != 0); | 0 | ||||||||||||
848 | ) != 0); never executed: return (BIO_ctrl(bio, 147, 0, ((void *)0) ) != 0); | 0 | ||||||||||||
849 | } | - | ||||||||||||
850 | - | |||||||||||||
851 | - | |||||||||||||
852 | - | |||||||||||||
853 | - | |||||||||||||
854 | - | |||||||||||||
855 | - | |||||||||||||
856 | int BIO_nread0(BIO *bio, char **buf) | - | ||||||||||||
857 | { | - | ||||||||||||
858 | long ret; | - | ||||||||||||
859 | - | |||||||||||||
860 | if (!bio->init
| 0 | ||||||||||||
861 | ERR_put_error(32,(124),(120),__FILE__,753); | - | ||||||||||||
862 | return never executed: -2;return -2; never executed: return -2; | 0 | ||||||||||||
863 | } | - | ||||||||||||
864 | - | |||||||||||||
865 | ret = BIO_ctrl(bio, 143, 0, buf); | - | ||||||||||||
866 | if (ret > 0x7fffffff
| 0 | ||||||||||||
867 | return never executed: 0x7fffffff;return 0x7fffffff; never executed: return 0x7fffffff; | 0 | ||||||||||||
868 | else | - | ||||||||||||
869 | return never executed: (int)ret;return (int)ret; never executed: return (int)ret; | 0 | ||||||||||||
870 | } | - | ||||||||||||
871 | - | |||||||||||||
872 | int BIO_nread(BIO *bio, char **buf, int num) | - | ||||||||||||
873 | { | - | ||||||||||||
874 | int ret; | - | ||||||||||||
875 | - | |||||||||||||
876 | if (!bio->init
| 0-403 | ||||||||||||
877 | ERR_put_error(32,(123),(120),__FILE__,769); | - | ||||||||||||
878 | return never executed: -2;return -2; never executed: return -2; | 0 | ||||||||||||
879 | } | - | ||||||||||||
880 | - | |||||||||||||
881 | ret = (int)BIO_ctrl(bio, 144, num, buf); | - | ||||||||||||
882 | if (ret > 0
| 0-403 | ||||||||||||
883 | bio->num_read += ret; executed 403 times by 1 test: bio->num_read += ret; Executed by:
| 403 | ||||||||||||
884 | return executed 403 times by 1 test: ret;return ret; Executed by:
executed 403 times by 1 test: return ret; Executed by:
| 403 | ||||||||||||
885 | } | - | ||||||||||||
886 | - | |||||||||||||
887 | int BIO_nwrite0(BIO *bio, char **buf) | - | ||||||||||||
888 | { | - | ||||||||||||
889 | long ret; | - | ||||||||||||
890 | - | |||||||||||||
891 | if (!bio->init
| 0-1055 | ||||||||||||
892 | ERR_put_error(32,(122),(120),__FILE__,784); | - | ||||||||||||
893 | return never executed: -2;return -2; never executed: return -2; | 0 | ||||||||||||
894 | } | - | ||||||||||||
895 | - | |||||||||||||
896 | ret = BIO_ctrl(bio, 145, 0, buf); | - | ||||||||||||
897 | if (ret > 0x7fffffff
| 0-1055 | ||||||||||||
898 | return never executed: 0x7fffffff;return 0x7fffffff; never executed: return 0x7fffffff; | 0 | ||||||||||||
899 | else | - | ||||||||||||
900 | return executed 1055 times by 1 test: (int)ret;return (int)ret; Executed by:
executed 1055 times by 1 test: return (int)ret; Executed by:
| 1055 | ||||||||||||
901 | } | - | ||||||||||||
902 | - | |||||||||||||
903 | int BIO_nwrite(BIO *bio, char **buf, int num) | - | ||||||||||||
904 | { | - | ||||||||||||
905 | int ret; | - | ||||||||||||
906 | - | |||||||||||||
907 | if (!bio->init
| 0-1055 | ||||||||||||
908 | ERR_put_error(32,(125),(120),__FILE__,800); | - | ||||||||||||
909 | return never executed: -2;return -2; never executed: return -2; | 0 | ||||||||||||
910 | } | - | ||||||||||||
911 | - | |||||||||||||
912 | ret = BIO_ctrl(bio, 146, num, buf); | - | ||||||||||||
913 | if (ret > 0
| 0-1055 | ||||||||||||
914 | bio->num_write += ret; executed 1055 times by 1 test: bio->num_write += ret; Executed by:
| 1055 | ||||||||||||
915 | return executed 1055 times by 1 test: ret;return ret; Executed by:
executed 1055 times by 1 test: return ret; Executed by:
| 1055 | ||||||||||||
916 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |