OpenCoverage

bio_lib.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/bio/bio_lib.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/* $OpenBSD: bio_lib.c,v 1.28 2018/05/01 13:29:09 tb Exp $ */-
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)-
3 * All rights reserved.-
4 *-
5 * This package is an SSL implementation written-
6 * by Eric Young (eay@cryptsoft.com).-
7 * The implementation was written so as to conform with Netscapes SSL.-
8 *-
9 * This library is free for commercial and non-commercial use as long as-
10 * the following conditions are aheared to. The following conditions-
11 * apply to all code found in this distribution, be it the RC4, RSA,-
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation-
13 * included with this distribution is covered by the same copyright terms-
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).-
15 *-
16 * Copyright remains Eric Young's, and as such any Copyright notices in-
17 * the code are not to be removed.-
18 * If this package is used in a product, Eric Young should be given attribution-
19 * as the author of the parts of the library used.-
20 * This can be in the form of a textual message at program startup or-
21 * in documentation (online or textual) provided with the package.-
22 *-
23 * Redistribution and use in source and binary forms, with or without-
24 * modification, are permitted provided that the following conditions-
25 * are met:-
26 * 1. Redistributions of source code must retain the copyright-
27 * notice, this list of conditions and the following disclaimer.-
28 * 2. Redistributions in binary form must reproduce the above copyright-
29 * notice, this list of conditions and the following disclaimer in the-
30 * documentation and/or other materials provided with the distribution.-
31 * 3. All advertising materials mentioning features or use of this software-
32 * must display the following acknowledgement:-
33 * "This product includes cryptographic software written by-
34 * Eric Young (eay@cryptsoft.com)"-
35 * The word 'cryptographic' can be left out if the rouines from the library-
36 * being used are not cryptographic related :-).-
37 * 4. If you include any Windows specific code (or a derivative thereof) from-
38 * the apps directory (application code) you must include an acknowledgement:-
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"-
40 *-
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND-
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE-
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE-
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE-
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL-
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS-
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)-
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT-
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY-
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF-
51 * SUCH DAMAGE.-
52 *-
53 * The licence and distribution terms for any publically available version or-
54 * derivative of this code cannot be changed. i.e. this code cannot simply be-
55 * copied and put under another distribution licence-
56 * [including the GNU Public Licence.]-
57 */-
58-
59#include <errno.h>-
60#include <stdio.h>-
61-
62#include <openssl/bio.h>-
63#include <openssl/crypto.h>-
64#include <openssl/err.h>-
65#include <openssl/stack.h>-
66-
67int-
68BIO_get_new_index(void)-
69{-
70 static int bio_type_index = BIO_TYPE_START;-
71 int index;-
72-
73 /* The index will collide with the BIO flag bits if it exceeds 255. */-
74 index = CRYPTO_add(&bio_type_index, 1, CRYPTO_LOCK_BIO);-
75 if (index > 255)
index > 255Description
TRUEnever evaluated
FALSEnever evaluated
0
76 return -1;
never executed: return -1;
0
77-
78 return index;
never executed: return index;
0
79}-
80-
81BIO *-
82BIO_new(const BIO_METHOD *method)-
83{-
84 BIO *ret = NULL;-
85-
86 ret = malloc(sizeof(BIO));-
87 if (ret == NULL) {
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2194 times by 18 tests
Evaluated by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-2194
88 BIOerror(ERR_R_MALLOC_FAILURE);-
89 return (NULL);
never executed: return ( ((void *)0) );
0
90 }-
91 if (!BIO_set(ret, method)) {
!BIO_set(ret, method)Description
TRUEnever evaluated
FALSEevaluated 2194 times by 18 tests
Evaluated by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-2194
92 free(ret);-
93 ret = NULL;-
94 }
never executed: end of block
0
95 return (ret);
executed 2194 times by 18 tests: return (ret);
Executed by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
2194
96}-
97-
98int-
99BIO_set(BIO *bio, const BIO_METHOD *method)-
100{-
101 bio->method = method;-
102 bio->callback = NULL;-
103 bio->cb_arg = NULL;-
104 bio->init = 0;-
105 bio->shutdown = 1;-
106 bio->flags = 0;-
107 bio->retry_reason = 0;-
108 bio->num = 0;-
109 bio->ptr = NULL;-
110 bio->prev_bio = NULL;-
111 bio->next_bio = NULL;-
112 bio->references = 1;-
113 bio->num_read = 0L;-
114 bio->num_write = 0L;-
115 CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);-
116 if (method->create != NULL)
method->create != ((void *)0)Description
TRUEevaluated 2190 times by 18 tests
Evaluated by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tlstest
4-2190
117 if (!method->create(bio)) {
!method->create(bio)Description
TRUEnever evaluated
FALSEevaluated 2190 times by 18 tests
Evaluated by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-2190
118 CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio,-
119 &bio->ex_data);-
120 return (0);
never executed: return (0);
0
121 }-
122 return (1);
executed 2194 times by 18 tests: return (1);
Executed by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
2194
123}-
124-
125int-
126BIO_free(BIO *a)-
127{-
128 int i;-
129-
130 if (a == NULL)
a == ((void *)0)Description
TRUEevaluated 1177 times by 12 tests
Evaluated by:
  • cipher_list
  • cipherstest
  • clienttest
  • freenull
  • libcrypto.so.44.0.1
  • servertest
  • ssl_versions
  • ssltest
  • tls_ext_alpn
  • tls_prf
  • tlsexttest
  • tlstest
FALSEevaluated 2331 times by 17 tests
Evaluated by:
  • asn1test
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
1177-2331
131 return (0);
executed 1177 times by 12 tests: return (0);
Executed by:
  • cipher_list
  • cipherstest
  • clienttest
  • freenull
  • libcrypto.so.44.0.1
  • servertest
  • ssl_versions
  • ssltest
  • tls_ext_alpn
  • tls_prf
  • tlsexttest
  • tlstest
1177
132-
133 i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO);-
134 if (i > 0)
i > 0Description
TRUEevaluated 144 times by 3 tests
Evaluated by:
  • clienttest
  • servertest
  • ssltest
FALSEevaluated 2187 times by 17 tests
Evaluated by:
  • asn1test
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
144-2187
135 return (1);
executed 144 times by 3 tests: return (1);
Executed by:
  • clienttest
  • servertest
  • ssltest
144
136 if ((a->callback != NULL) &&
(a->callback != ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 2187 times by 17 tests
Evaluated by:
  • asn1test
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-2187
137 ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
((i = (int)a->...0L, 1L)) <= 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
138 return (i);
never executed: return (i);
0
139-
140 CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);-
141-
142 if (a->method != NULL && a->method->destroy != NULL)
a->method != ((void *)0)Description
TRUEevaluated 2187 times by 17 tests
Evaluated by:
  • asn1test
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEnever evaluated
a->method->des...!= ((void *)0)Description
TRUEevaluated 2183 times by 17 tests
Evaluated by:
  • asn1test
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tlstest
0-2187
143 a->method->destroy(a);
executed 2183 times by 17 tests: a->method->destroy(a);
Executed by:
  • asn1test
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
2183
144 free(a);-
145 return (1);
executed 2187 times by 17 tests: return (1);
Executed by:
  • asn1test
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
2187
146}-
147-
148void-
149BIO_vfree(BIO *a)-
150{-
151 BIO_free(a);-
152}
never executed: end of block
0
153-
154int-
155BIO_up_ref(BIO *bio)-
156{-
157 int refs = CRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO);-
158 return (refs > 1) ? 1 : 0;
never executed: return (refs > 1) ? 1 : 0;
(refs > 1)Description
TRUEnever evaluated
FALSEnever evaluated
0
159}-
160-
161void *-
162BIO_get_data(BIO *a)-
163{-
164 return (a->ptr);
never executed: return (a->ptr);
0
165}-
166-
167void-
168BIO_set_data(BIO *a, void *ptr)-
169{-
170 a->ptr = ptr;-
171}
never executed: end of block
0
172-
173void-
174BIO_set_init(BIO *a, int init)-
175{-
176 a->init = init;-
177}
never executed: end of block
0
178-
179int-
180BIO_get_shutdown(BIO *a)-
181{-
182 return (a->shutdown);
never executed: return (a->shutdown);
0
183}-
184-
185void-
186BIO_set_shutdown(BIO *a, int shut)-
187{-
188 a->shutdown = shut;-
189}
never executed: end of block
0
190-
191void-
192BIO_clear_flags(BIO *b, int flags)-
193{-
194 b->flags &= ~flags;-
195}
executed 16325 times by 9 tests: end of block
Executed by:
  • asn1test
  • base64test
  • clienttest
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
16325
196-
197int-
198BIO_test_flags(const BIO *b, int flags)-
199{-
200 return (b->flags & flags);
executed 8275 times by 6 tests: return (b->flags & flags);
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
8275
201}-
202-
203void-
204BIO_set_flags(BIO *b, int flags)-
205{-
206 b->flags |= flags;-
207}
executed 7145 times by 6 tests: end of block
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
7145
208-
209long-
210(*BIO_get_callback(const BIO *b))(struct bio_st *, int, const char *, int,-
211 long, long)-
212{-
213 return b->callback;
never executed: return b->callback;
0
214}-
215-
216void-
217BIO_set_callback(BIO *b, long (*cb)(struct bio_st *, int, const char *, int,-
218 long, long))-
219{-
220 b->callback = cb;-
221}
never executed: end of block
0
222-
223void-
224BIO_set_callback_arg(BIO *b, char *arg)-
225{-
226 b->cb_arg = arg;-
227}
never executed: end of block
0
228-
229char *-
230BIO_get_callback_arg(const BIO *b)-
231{-
232 return b->cb_arg;
never executed: return b->cb_arg;
0
233}-
234-
235const char *-
236BIO_method_name(const BIO *b)-
237{-
238 return b->method->name;
never executed: return b->method->name;
0
239}-
240-
241int-
242BIO_method_type(const BIO *b)-
243{-
244 return b->method->type;
executed 6 times by 2 tests: return b->method->type;
Executed by:
  • pkcs7test
  • tlstest
6
245}-
246-
247int-
248BIO_read(BIO *b, void *out, int outl)-
249{-
250 int i;-
251 long (*cb)(BIO *, int, const char *, int, long, long);-
252-
253 if ((b == NULL) || (b->method == NULL) || (b->method->bread == NULL)) {
(b == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 7824 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
(b->method == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 7824 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
(b->method->br... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 7824 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-7824
254 BIOerror(BIO_R_UNSUPPORTED_METHOD);-
255 return (-2);
never executed: return (-2);
0
256 }-
257-
258 cb = b->callback;-
259 if ((cb != NULL) &&
(cb != ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 7824 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-7824
260 ((i = (int)cb(b, BIO_CB_READ, out, outl, 0L, 1L)) <= 0))
((i = (int)cb(...0L, 1L)) <= 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
261 return (i);
never executed: return (i);
0
262-
263 if (!b->init) {
!b->initDescription
TRUEnever evaluated
FALSEevaluated 7824 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-7824
264 BIOerror(BIO_R_UNINITIALIZED);-
265 return (-2);
never executed: return (-2);
0
266 }-
267-
268 i = b->method->bread(b, out, outl);-
269-
270 if (i > 0)
i > 0Description
TRUEevaluated 3606 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 4218 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
3606-4218
271 b->num_read += (unsigned long)i;
executed 3606 times by 7 tests: b->num_read += (unsigned long)i;
Executed by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
3606
272-
273 if (cb != NULL)
cb != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7824 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-7824
274 i = (int)cb(b, BIO_CB_READ|BIO_CB_RETURN, out, outl,
never executed: i = (int)cb(b, 0x02|0x80, out, outl, 0L, (long)i);
0
275 0L, (long)i);
never executed: i = (int)cb(b, 0x02|0x80, out, outl, 0L, (long)i);
0
276 return (i);
executed 7824 times by 7 tests: return (i);
Executed by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
7824
277}-
278-
279int-
280BIO_write(BIO *b, const void *in, int inl)-
281{-
282 int i;-
283 long (*cb)(BIO *, int, const char *, int, long, long);-
284-
285 if (b == NULL)
b == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 800946 times by 13 tests
Evaluated by:
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-800946
286 return (0);
never executed: return (0);
0
287-
288 cb = b->callback;-
289 if ((b->method == NULL) || (b->method->bwrite == NULL)) {
(b->method == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 800946 times by 13 tests
Evaluated by:
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
(b->method->bw... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 800946 times by 13 tests
Evaluated by:
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-800946
290 BIOerror(BIO_R_UNSUPPORTED_METHOD);-
291 return (-2);
never executed: return (-2);
0
292 }-
293-
294 if ((cb != NULL) &&
(cb != ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 800946 times by 13 tests
Evaluated by:
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-800946
295 ((i = (int)cb(b, BIO_CB_WRITE, in, inl, 0L, 1L)) <= 0))
((i = (int)cb(...0L, 1L)) <= 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
296 return (i);
never executed: return (i);
0
297-
298 if (!b->init) {
!b->initDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • ssltest
FALSEevaluated 800898 times by 13 tests
Evaluated by:
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
48-800898
299 BIOerror(BIO_R_UNINITIALIZED);-
300 return (-2);
executed 48 times by 1 test: return (-2);
Executed by:
  • ssltest
48
301 }-
302-
303 i = b->method->bwrite(b, in, inl);-
304-
305 if (i > 0)
i > 0Description
TRUEevaluated 798926 times by 13 tests
Evaluated by:
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 1972 times by 3 tests
Evaluated by:
  • base64test
  • ssltest
  • tlstest
1972-798926
306 b->num_write += (unsigned long)i;
executed 798926 times by 13 tests: b->num_write += (unsigned long)i;
Executed by:
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
798926
307-
308 if (cb != NULL)
cb != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 800898 times by 13 tests
Evaluated by:
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-800898
309 i = (int)cb(b, BIO_CB_WRITE|BIO_CB_RETURN, in, inl,
never executed: i = (int)cb(b, 0x03|0x80, in, inl, 0L, (long)i);
0
310 0L, (long)i);
never executed: i = (int)cb(b, 0x03|0x80, in, inl, 0L, (long)i);
0
311 return (i);
executed 800898 times by 13 tests: return (i);
Executed by:
  • base64test
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
800898
312}-
313-
314int-
315BIO_puts(BIO *b, const char *in)-
316{-
317 int i;-
318 long (*cb)(BIO *, int, const char *, int, long, long);-
319-
320 if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) {
(b == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 9012 times by 5 tests
Evaluated by:
  • bntest
  • dhtest
  • dsatest
  • ecdhtest
  • libcrypto.so.44.0.1
(b->method == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 9012 times by 5 tests
Evaluated by:
  • bntest
  • dhtest
  • dsatest
  • ecdhtest
  • libcrypto.so.44.0.1
(b->method->bp... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 9012 times by 5 tests
Evaluated by:
  • bntest
  • dhtest
  • dsatest
  • ecdhtest
  • libcrypto.so.44.0.1
0-9012
321 BIOerror(BIO_R_UNSUPPORTED_METHOD);-
322 return (-2);
never executed: return (-2);
0
323 }-
324-
325 cb = b->callback;-
326-
327 if ((cb != NULL) &&
(cb != ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 9012 times by 5 tests
Evaluated by:
  • bntest
  • dhtest
  • dsatest
  • ecdhtest
  • libcrypto.so.44.0.1
0-9012
328 ((i = (int)cb(b, BIO_CB_PUTS, in, 0, 0L, 1L)) <= 0))
((i = (int)cb(...0L, 1L)) <= 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
329 return (i);
never executed: return (i);
0
330-
331 if (!b->init) {
!b->initDescription
TRUEnever evaluated
FALSEevaluated 9012 times by 5 tests
Evaluated by:
  • bntest
  • dhtest
  • dsatest
  • ecdhtest
  • libcrypto.so.44.0.1
0-9012
332 BIOerror(BIO_R_UNINITIALIZED);-
333 return (-2);
never executed: return (-2);
0
334 }-
335-
336 i = b->method->bputs(b, in);-
337-
338 if (i > 0)
i > 0Description
TRUEevaluated 9012 times by 5 tests
Evaluated by:
  • bntest
  • dhtest
  • dsatest
  • ecdhtest
  • libcrypto.so.44.0.1
FALSEnever evaluated
0-9012
339 b->num_write += (unsigned long)i;
executed 9012 times by 5 tests: b->num_write += (unsigned long)i;
Executed by:
  • bntest
  • dhtest
  • dsatest
  • ecdhtest
  • libcrypto.so.44.0.1
9012
340-
341 if (cb != NULL)
cb != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9012 times by 5 tests
Evaluated by:
  • bntest
  • dhtest
  • dsatest
  • ecdhtest
  • libcrypto.so.44.0.1
0-9012
342 i = (int)cb(b, BIO_CB_PUTS|BIO_CB_RETURN, in, 0, 0L, (long)i);
never executed: i = (int)cb(b, 0x04|0x80, in, 0, 0L, (long)i);
0
343 return (i);
executed 9012 times by 5 tests: return (i);
Executed by:
  • bntest
  • dhtest
  • dsatest
  • ecdhtest
  • libcrypto.so.44.0.1
9012
344}-
345-
346int-
347BIO_gets(BIO *b, char *in, int inl)-
348{-
349 int i;-
350 long (*cb)(BIO *, int, const char *, int, long, long);-
351-
352 if ((b == NULL) || (b->method == NULL) || (b->method->bgets == NULL)) {
(b == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 6425 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
(b->method == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 6425 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
(b->method->bg... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 6425 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-6425
353 BIOerror(BIO_R_UNSUPPORTED_METHOD);-
354 return (-2);
never executed: return (-2);
0
355 }-
356-
357 cb = b->callback;-
358-
359 if ((cb != NULL) &&
(cb != ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 6425 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-6425
360 ((i = (int)cb(b, BIO_CB_GETS, in, inl, 0L, 1L)) <= 0))
((i = (int)cb(...0L, 1L)) <= 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
361 return (i);
never executed: return (i);
0
362-
363 if (!b->init) {
!b->initDescription
TRUEnever evaluated
FALSEevaluated 6425 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-6425
364 BIOerror(BIO_R_UNINITIALIZED);-
365 return (-2);
never executed: return (-2);
0
366 }-
367-
368 i = b->method->bgets(b, in, inl);-
369-
370 if (cb != NULL)
cb != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6425 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-6425
371 i = (int)cb(b, BIO_CB_GETS|BIO_CB_RETURN, in, inl, 0L, (long)i);
never executed: i = (int)cb(b, 0x05|0x80, in, inl, 0L, (long)i);
0
372 return (i);
executed 6425 times by 7 tests: return (i);
Executed by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
6425
373}-
374-
375int-
376BIO_indent(BIO *b, int indent, int max)-
377{-
378 if (indent < 0)
indent < 0Description
TRUEnever evaluated
FALSEevaluated 114 times by 2 tests
Evaluated by:
  • dsatest
  • libcrypto.so.44.0.1
0-114
379 indent = 0;
never executed: indent = 0;
0
380 if (indent > max)
indent > maxDescription
TRUEnever evaluated
FALSEevaluated 114 times by 2 tests
Evaluated by:
  • dsatest
  • libcrypto.so.44.0.1
0-114
381 indent = max;
never executed: indent = max;
0
382 while (indent--)
indent--Description
TRUEevaluated 1608 times by 2 tests
Evaluated by:
  • dsatest
  • libcrypto.so.44.0.1
FALSEevaluated 114 times by 2 tests
Evaluated by:
  • dsatest
  • libcrypto.so.44.0.1
114-1608
383 if (BIO_puts(b, " ") != 1)
BIO_puts(b, " ") != 1Description
TRUEnever evaluated
FALSEevaluated 1608 times by 2 tests
Evaluated by:
  • dsatest
  • libcrypto.so.44.0.1
0-1608
384 return 0;
never executed: return 0;
0
385 return 1;
executed 114 times by 2 tests: return 1;
Executed by:
  • dsatest
  • libcrypto.so.44.0.1
114
386}-
387-
388long-
389BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg)-
390{-
391 int i;-
392-
393 i = iarg;-
394 return (BIO_ctrl(b, cmd, larg, (char *)&i));
executed 145 times by 4 tests: return (BIO_ctrl(b, cmd, larg, (char *)&i));
Executed by:
  • clienttest
  • servertest
  • ssltest
  • tlstest
145
395}-
396-
397char *-
398BIO_ptr_ctrl(BIO *b, int cmd, long larg)-
399{-
400 char *p = NULL;-
401-
402 if (BIO_ctrl(b, cmd, larg, (char *)&p) <= 0)
BIO_ctrl(b, cm...har *)&p) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
403 return (NULL);
never executed: return ( ((void *)0) );
0
404 else-
405 return (p);
never executed: return (p);
0
406}-
407-
408long-
409BIO_ctrl(BIO *b, int cmd, long larg, void *parg)-
410{-
411 long ret;-
412 long (*cb)(BIO *, int, const char *, int, long, long);-
413-
414 if (b == NULL)
b == ((void *)0)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tlstest
FALSEevaluated 13226 times by 17 tests
Evaluated by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
8-13226
415 return (0);
executed 8 times by 1 test: return (0);
Executed by:
  • tlstest
8
416-
417 if ((b->method == NULL) || (b->method->ctrl == NULL)) {
(b->method == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 13226 times by 17 tests
Evaluated by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
(b->method->ct... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 13226 times by 17 tests
Evaluated by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-13226
418 BIOerror(BIO_R_UNSUPPORTED_METHOD);-
419 return (-2);
never executed: return (-2);
0
420 }-
421-
422 cb = b->callback;-
423-
424 if ((cb != NULL) &&
(cb != ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 13226 times by 17 tests
Evaluated by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-13226
425 ((ret = cb(b, BIO_CB_CTRL, parg, cmd, larg, 1L)) <= 0))
((ret = cb(b, ...rg, 1L)) <= 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
426 return (ret);
never executed: return (ret);
0
427-
428 ret = b->method->ctrl(b, cmd, larg, parg);-
429-
430 if (cb != NULL)
cb != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13226 times by 17 tests
Evaluated by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-13226
431 ret = cb(b, BIO_CB_CTRL|BIO_CB_RETURN, parg, cmd, larg, ret);
never executed: ret = cb(b, 0x06|0x80, parg, cmd, larg, ret);
0
432 return (ret);
executed 13226 times by 17 tests: return (ret);
Executed by:
  • asn1test
  • base64test
  • bnaddsub
  • bntest
  • clienttest
  • dhtest
  • dsatest
  • ecdhtest
  • ecdsatest
  • ectest
  • exptest
  • gost2814789t
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
13226
433}-
434-
435long-
436BIO_callback_ctrl(BIO *b, int cmd,-
437 void (*fp)(struct bio_st *, int, const char *, int, long, long))-
438{-
439 long ret;-
440 long (*cb)(BIO *, int, const char *, int, long, long);-
441-
442 if (b == NULL)
b == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
443 return (0);
never executed: return (0);
0
444-
445 if ((b->method == NULL) || (b->method->callback_ctrl == NULL)) {
(b->method == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
(b->method->ca... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
446 BIOerror(BIO_R_UNSUPPORTED_METHOD);-
447 return (-2);
never executed: return (-2);
0
448 }-
449-
450 cb = b->callback;-
451-
452 if ((cb != NULL) &&
(cb != ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
453 ((ret = cb(b, BIO_CB_CTRL, (void *)&fp, cmd, 0, 1L)) <= 0))
((ret = cb(b, ... 0, 1L)) <= 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
454 return (ret);
never executed: return (ret);
0
455-
456 ret = b->method->callback_ctrl(b, cmd, fp);-
457-
458 if (cb != NULL)
cb != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
459 ret = cb(b, BIO_CB_CTRL|BIO_CB_RETURN, (void *)&fp, cmd, 0, ret);
never executed: ret = cb(b, 0x06|0x80, (void *)&fp, cmd, 0, ret);
0
460 return (ret);
never executed: return (ret);
0
461}-
462-
463/* It is unfortunate to duplicate in functions what the BIO_(w)pending macros-
464 * do; but those macros have inappropriate return type, and for interfacing-
465 * from other programming languages, C macros aren't much of a help anyway. */-
466size_t-
467BIO_ctrl_pending(BIO *bio)-
468{-
469 return BIO_ctrl(bio, BIO_CTRL_PENDING, 0, NULL);
executed 1818 times by 1 test: return BIO_ctrl(bio, 10, 0, ((void *)0) );
Executed by:
  • ssltest
1818
470}-
471-
472size_t-
473BIO_ctrl_wpending(BIO *bio)-
474{-
475 return BIO_ctrl(bio, BIO_CTRL_WPENDING, 0, NULL);
never executed: return BIO_ctrl(bio, 13, 0, ((void *)0) );
0
476}-
477-
478-
479/* put the 'bio' on the end of b's list of operators */-
480BIO *-
481BIO_push(BIO *b, BIO *bio)-
482{-
483 BIO *lb;-
484-
485 if (b == NULL)
b == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 597 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-597
486 return (bio);
never executed: return (bio);
0
487 lb = b;-
488 while (lb->next_bio != NULL)
lb->next_bio != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 597 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-597
489 lb = lb->next_bio;
never executed: lb = lb->next_bio;
0
490 lb->next_bio = bio;-
491 if (bio != NULL)
bio != ((void *)0)Description
TRUEevaluated 597 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEnever evaluated
0-597
492 bio->prev_bio = lb;
executed 597 times by 7 tests: bio->prev_bio = lb;
Executed by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
597
493 /* called to do internal processing */-
494 BIO_ctrl(b, BIO_CTRL_PUSH, 0, lb);-
495 return (b);
executed 597 times by 7 tests: return (b);
Executed by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
597
496}-
497-
498/* Remove the first and return the rest */-
499BIO *-
500BIO_pop(BIO *b)-
501{-
502 BIO *ret;-
503-
504 if (b == NULL)
b == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 142 times by 5 tests
Evaluated by:
  • clienttest
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-142
505 return (NULL);
never executed: return ( ((void *)0) );
0
506 ret = b->next_bio;-
507-
508 BIO_ctrl(b, BIO_CTRL_POP, 0, b);-
509-
510 if (b->prev_bio != NULL)
b->prev_bio != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 142 times by 5 tests
Evaluated by:
  • clienttest
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
0-142
511 b->prev_bio->next_bio = b->next_bio;
never executed: b->prev_bio->next_bio = b->next_bio;
0
512 if (b->next_bio != NULL)
b->next_bio != ((void *)0)Description
TRUEevaluated 142 times by 5 tests
Evaluated by:
  • clienttest
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEnever evaluated
0-142
513 b->next_bio->prev_bio = b->prev_bio;
executed 142 times by 5 tests: b->next_bio->prev_bio = b->prev_bio;
Executed by:
  • clienttest
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
142
514-
515 b->next_bio = NULL;-
516 b->prev_bio = NULL;-
517 return (ret);
executed 142 times by 5 tests: return (ret);
Executed by:
  • clienttest
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
142
518}-
519-
520BIO *-
521BIO_get_retry_BIO(BIO *bio, int *reason)-
522{-
523 BIO *b, *last;-
524-
525 b = last = bio;-
526 for (;;) {-
527 if (!BIO_should_retry(b))
!BIO_test_flags(b, 0x08)Description
TRUEnever evaluated
FALSEnever evaluated
0
528 break;
never executed: break;
0
529 last = b;-
530 b = b->next_bio;-
531 if (b == NULL)
b == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
532 break;
never executed: break;
0
533 }
never executed: end of block
0
534 if (reason != NULL)
reason != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
535 *reason = last->retry_reason;
never executed: *reason = last->retry_reason;
0
536 return (last);
never executed: return (last);
0
537}-
538-
539int-
540BIO_get_retry_reason(BIO *bio)-
541{-
542 return (bio->retry_reason);
never executed: return (bio->retry_reason);
0
543}-
544-
545BIO *-
546BIO_find_type(BIO *bio, int type)-
547{-
548 int mt, mask;-
549-
550 if (!bio)
!bioDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • pkcs7test
0-6
551 return NULL;
never executed: return ((void *)0) ;
0
552 mask = type & 0xff;-
553 do {-
554 if (bio->method != NULL) {
bio->method != ((void *)0)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • pkcs7test
FALSEnever evaluated
0-8
555 mt = bio->method->type;-
556 if (!mask) {
!maskDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • pkcs7test
0-8
557 if (mt & type)
mt & typeDescription
TRUEnever evaluated
FALSEnever evaluated
0
558 return (bio);
never executed: return (bio);
0
559 } else if (mt == type)
never executed: end of block
mt == typeDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • pkcs7test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
0-6
560 return (bio);
executed 6 times by 1 test: return (bio);
Executed by:
  • pkcs7test
6
561 }
executed 2 times by 1 test: end of block
Executed by:
  • pkcs7test
2
562 bio = bio->next_bio;-
563 } while (bio != NULL);
executed 2 times by 1 test: end of block
Executed by:
  • pkcs7test
bio != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
FALSEnever evaluated
0-2
564 return (NULL);
never executed: return ( ((void *)0) );
0
565}-
566-
567BIO *-
568BIO_next(BIO *b)-
569{-
570 if (!b)
!bDescription
TRUEnever evaluated
FALSEnever evaluated
0
571 return NULL;
never executed: return ((void *)0) ;
0
572 return b->next_bio;
never executed: return b->next_bio;
0
573}-
574-
575void-
576BIO_free_all(BIO *bio)-
577{-
578 BIO *b;-
579 int ref;-
580-
581 while (bio != NULL) {
bio != ((void *)0)Description
TRUEevaluated 753 times by 7 tests
Evaluated by:
  • base64test
  • clienttest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 764 times by 14 tests
Evaluated by:
  • base64test
  • cipher_list
  • cipherstest
  • clienttest
  • freenull
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssl_versions
  • ssltest
  • tls_ext_alpn
  • tls_prf
  • tlsexttest
  • tlstest
753-764
582 b = bio;-
583 ref = b->references;-
584 bio = bio->next_bio;-
585 BIO_free(b);-
586 /* Since ref count > 1, don't free anyone else. */-
587 if (ref > 1)
ref > 1Description
TRUEevaluated 26 times by 2 tests
Evaluated by:
  • clienttest
  • servertest
FALSEevaluated 727 times by 5 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • ssltest
  • tlstest
26-727
588 break;
executed 26 times by 2 tests: break;
Executed by:
  • clienttest
  • servertest
26
589 }
executed 727 times by 5 tests: end of block
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • ssltest
  • tlstest
727
590}
executed 790 times by 14 tests: end of block
Executed by:
  • base64test
  • cipher_list
  • cipherstest
  • clienttest
  • freenull
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssl_versions
  • ssltest
  • tls_ext_alpn
  • tls_prf
  • tlsexttest
  • tlstest
790
591-
592BIO *-
593BIO_dup_chain(BIO *in)-
594{-
595 BIO *ret = NULL, *eoc = NULL, *bio, *new_bio;-
596-
597 for (bio = in; bio != NULL; bio = bio->next_bio) {
bio != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
598 if ((new_bio = BIO_new(bio->method)) == NULL)
(new_bio = BIO...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
599 goto err;
never executed: goto err;
0
600 new_bio->callback = bio->callback;-
601 new_bio->cb_arg = bio->cb_arg;-
602 new_bio->init = bio->init;-
603 new_bio->shutdown = bio->shutdown;-
604 new_bio->flags = bio->flags;-
605-
606 /* This will let SSL_s_sock() work with stdin/stdout */-
607 new_bio->num = bio->num;-
608-
609 if (!BIO_dup_state(bio, (char *)new_bio)) {
!BIO_ctrl(bio,...ar *)new_bio))Description
TRUEnever evaluated
FALSEnever evaluated
0
610 BIO_free(new_bio);-
611 goto err;
never executed: goto err;
0
612 }-
613-
614 /* copy app data */-
615 if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO,
!CRYPTO_dup_ex...&bio->ex_data)Description
TRUEnever evaluated
FALSEnever evaluated
0
616 &new_bio->ex_data, &bio->ex_data))
!CRYPTO_dup_ex...&bio->ex_data)Description
TRUEnever evaluated
FALSEnever evaluated
0
617 goto err;
never executed: goto err;
0
618-
619 if (ret == NULL) {
ret == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
620 eoc = new_bio;-
621 ret = eoc;-
622 } else {
never executed: end of block
0
623 BIO_push(eoc, new_bio);-
624 eoc = new_bio;-
625 }
never executed: end of block
0
626 }-
627 return (ret);
never executed: return (ret);
0
628err:-
629 BIO_free(ret);-
630 return (NULL);
never executed: return ( ((void *)0) );
0
631-
632}-
633-
634void-
635BIO_copy_next_retry(BIO *b)-
636{-
637 BIO_set_flags(b, BIO_get_retry_flags(b->next_bio));-
638 b->retry_reason = b->next_bio->retry_reason;-
639}
executed 1274 times by 6 tests: end of block
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
1274
640-
641int-
642BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,-
643 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)-
644{-
645 return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, argl, argp,
never executed: return CRYPTO_get_ex_new_index(0, argl, argp, new_func, dup_func, free_func);
0
646 new_func, dup_func, free_func);
never executed: return CRYPTO_get_ex_new_index(0, argl, argp, new_func, dup_func, free_func);
0
647}-
648-
649int-
650BIO_set_ex_data(BIO *bio, int idx, void *data)-
651{-
652 return (CRYPTO_set_ex_data(&(bio->ex_data), idx, data));
never executed: return (CRYPTO_set_ex_data(&(bio->ex_data), idx, data));
0
653}-
654-
655void *-
656BIO_get_ex_data(BIO *bio, int idx)-
657{-
658 return (CRYPTO_get_ex_data(&(bio->ex_data), idx));
never executed: return (CRYPTO_get_ex_data(&(bio->ex_data), idx));
0
659}-
660-
661unsigned long-
662BIO_number_read(BIO *bio)-
663{-
664 if (bio)
bioDescription
TRUEnever evaluated
FALSEnever evaluated
0
665 return bio->num_read;
never executed: return bio->num_read;
0
666 return 0;
never executed: return 0;
0
667}-
668-
669unsigned long-
670BIO_number_written(BIO *bio)-
671{-
672 if (bio)
bioDescription
TRUEnever evaluated
FALSEnever evaluated
0
673 return bio->num_write;
never executed: return bio->num_write;
0
674 return 0;
never executed: return 0;
0
675}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.2