| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/bio/bio_lib.c |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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 | - | |||||||||||||||||||
| 67 | int | - | ||||||||||||||||||
| 68 | BIO_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)
| 0 | ||||||||||||||||||
| 76 | return -1; never executed: return -1; | 0 | ||||||||||||||||||
| 77 | - | |||||||||||||||||||
| 78 | return index; never executed: return index; | 0 | ||||||||||||||||||
| 79 | } | - | ||||||||||||||||||
| 80 | - | |||||||||||||||||||
| 81 | BIO * | - | ||||||||||||||||||
| 82 | BIO_new(const BIO_METHOD *method) | - | ||||||||||||||||||
| 83 | { | - | ||||||||||||||||||
| 84 | BIO *ret = NULL; | - | ||||||||||||||||||
| 85 | - | |||||||||||||||||||
| 86 | ret = malloc(sizeof(BIO)); | - | ||||||||||||||||||
| 87 | if (ret == NULL) {
| 0-2194 | ||||||||||||||||||
| 88 | BIOerror(ERR_R_MALLOC_FAILURE); | - | ||||||||||||||||||
| 89 | return (NULL); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||
| 90 | } | - | ||||||||||||||||||
| 91 | if (!BIO_set(ret, method)) {
| 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:
| 2194 | ||||||||||||||||||
| 96 | } | - | ||||||||||||||||||
| 97 | - | |||||||||||||||||||
| 98 | int | - | ||||||||||||||||||
| 99 | BIO_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)
| 4-2190 | ||||||||||||||||||
| 117 | if (!method->create(bio)) {
| 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:
| 2194 | ||||||||||||||||||
| 123 | } | - | ||||||||||||||||||
| 124 | - | |||||||||||||||||||
| 125 | int | - | ||||||||||||||||||
| 126 | BIO_free(BIO *a) | - | ||||||||||||||||||
| 127 | { | - | ||||||||||||||||||
| 128 | int i; | - | ||||||||||||||||||
| 129 | - | |||||||||||||||||||
| 130 | if (a == NULL)
| 1177-2331 | ||||||||||||||||||
| 131 | return (0); executed 1177 times by 12 tests: return (0);Executed by:
| 1177 | ||||||||||||||||||
| 132 | - | |||||||||||||||||||
| 133 | i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO); | - | ||||||||||||||||||
| 134 | if (i > 0)
| 144-2187 | ||||||||||||||||||
| 135 | return (1); executed 144 times by 3 tests: return (1);Executed by:
| 144 | ||||||||||||||||||
| 136 | if ((a->callback != NULL) &&
| 0-2187 | ||||||||||||||||||
| 137 | ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
| 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)
| 0-2187 | ||||||||||||||||||
| 143 | a->method->destroy(a); executed 2183 times by 17 tests: a->method->destroy(a);Executed by:
| 2183 | ||||||||||||||||||
| 144 | free(a); | - | ||||||||||||||||||
| 145 | return (1); executed 2187 times by 17 tests: return (1);Executed by:
| 2187 | ||||||||||||||||||
| 146 | } | - | ||||||||||||||||||
| 147 | - | |||||||||||||||||||
| 148 | void | - | ||||||||||||||||||
| 149 | BIO_vfree(BIO *a) | - | ||||||||||||||||||
| 150 | { | - | ||||||||||||||||||
| 151 | BIO_free(a); | - | ||||||||||||||||||
| 152 | } never executed: end of block | 0 | ||||||||||||||||||
| 153 | - | |||||||||||||||||||
| 154 | int | - | ||||||||||||||||||
| 155 | BIO_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;
| 0 | ||||||||||||||||||
| 159 | } | - | ||||||||||||||||||
| 160 | - | |||||||||||||||||||
| 161 | void * | - | ||||||||||||||||||
| 162 | BIO_get_data(BIO *a) | - | ||||||||||||||||||
| 163 | { | - | ||||||||||||||||||
| 164 | return (a->ptr); never executed: return (a->ptr); | 0 | ||||||||||||||||||
| 165 | } | - | ||||||||||||||||||
| 166 | - | |||||||||||||||||||
| 167 | void | - | ||||||||||||||||||
| 168 | BIO_set_data(BIO *a, void *ptr) | - | ||||||||||||||||||
| 169 | { | - | ||||||||||||||||||
| 170 | a->ptr = ptr; | - | ||||||||||||||||||
| 171 | } never executed: end of block | 0 | ||||||||||||||||||
| 172 | - | |||||||||||||||||||
| 173 | void | - | ||||||||||||||||||
| 174 | BIO_set_init(BIO *a, int init) | - | ||||||||||||||||||
| 175 | { | - | ||||||||||||||||||
| 176 | a->init = init; | - | ||||||||||||||||||
| 177 | } never executed: end of block | 0 | ||||||||||||||||||
| 178 | - | |||||||||||||||||||
| 179 | int | - | ||||||||||||||||||
| 180 | BIO_get_shutdown(BIO *a) | - | ||||||||||||||||||
| 181 | { | - | ||||||||||||||||||
| 182 | return (a->shutdown); never executed: return (a->shutdown); | 0 | ||||||||||||||||||
| 183 | } | - | ||||||||||||||||||
| 184 | - | |||||||||||||||||||
| 185 | void | - | ||||||||||||||||||
| 186 | BIO_set_shutdown(BIO *a, int shut) | - | ||||||||||||||||||
| 187 | { | - | ||||||||||||||||||
| 188 | a->shutdown = shut; | - | ||||||||||||||||||
| 189 | } never executed: end of block | 0 | ||||||||||||||||||
| 190 | - | |||||||||||||||||||
| 191 | void | - | ||||||||||||||||||
| 192 | BIO_clear_flags(BIO *b, int flags) | - | ||||||||||||||||||
| 193 | { | - | ||||||||||||||||||
| 194 | b->flags &= ~flags; | - | ||||||||||||||||||
| 195 | } executed 16325 times by 9 tests: end of blockExecuted by:
| 16325 | ||||||||||||||||||
| 196 | - | |||||||||||||||||||
| 197 | int | - | ||||||||||||||||||
| 198 | BIO_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:
| 8275 | ||||||||||||||||||
| 201 | } | - | ||||||||||||||||||
| 202 | - | |||||||||||||||||||
| 203 | void | - | ||||||||||||||||||
| 204 | BIO_set_flags(BIO *b, int flags) | - | ||||||||||||||||||
| 205 | { | - | ||||||||||||||||||
| 206 | b->flags |= flags; | - | ||||||||||||||||||
| 207 | } executed 7145 times by 6 tests: end of blockExecuted by:
| 7145 | ||||||||||||||||||
| 208 | - | |||||||||||||||||||
| 209 | long | - | ||||||||||||||||||
| 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 | - | |||||||||||||||||||
| 216 | void | - | ||||||||||||||||||
| 217 | BIO_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 | - | |||||||||||||||||||
| 223 | void | - | ||||||||||||||||||
| 224 | BIO_set_callback_arg(BIO *b, char *arg) | - | ||||||||||||||||||
| 225 | { | - | ||||||||||||||||||
| 226 | b->cb_arg = arg; | - | ||||||||||||||||||
| 227 | } never executed: end of block | 0 | ||||||||||||||||||
| 228 | - | |||||||||||||||||||
| 229 | char * | - | ||||||||||||||||||
| 230 | BIO_get_callback_arg(const BIO *b) | - | ||||||||||||||||||
| 231 | { | - | ||||||||||||||||||
| 232 | return b->cb_arg; never executed: return b->cb_arg; | 0 | ||||||||||||||||||
| 233 | } | - | ||||||||||||||||||
| 234 | - | |||||||||||||||||||
| 235 | const char * | - | ||||||||||||||||||
| 236 | BIO_method_name(const BIO *b) | - | ||||||||||||||||||
| 237 | { | - | ||||||||||||||||||
| 238 | return b->method->name; never executed: return b->method->name; | 0 | ||||||||||||||||||
| 239 | } | - | ||||||||||||||||||
| 240 | - | |||||||||||||||||||
| 241 | int | - | ||||||||||||||||||
| 242 | BIO_method_type(const BIO *b) | - | ||||||||||||||||||
| 243 | { | - | ||||||||||||||||||
| 244 | return b->method->type; executed 6 times by 2 tests: return b->method->type;Executed by:
| 6 | ||||||||||||||||||
| 245 | } | - | ||||||||||||||||||
| 246 | - | |||||||||||||||||||
| 247 | int | - | ||||||||||||||||||
| 248 | BIO_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)) {
| 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) &&
| 0-7824 | ||||||||||||||||||
| 260 | ((i = (int)cb(b, BIO_CB_READ, out, outl, 0L, 1L)) <= 0))
| 0 | ||||||||||||||||||
| 261 | return (i); never executed: return (i); | 0 | ||||||||||||||||||
| 262 | - | |||||||||||||||||||
| 263 | if (!b->init) {
| 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)
| 3606-4218 | ||||||||||||||||||
| 271 | b->num_read += (unsigned long)i; executed 3606 times by 7 tests: b->num_read += (unsigned long)i;Executed by:
| 3606 | ||||||||||||||||||
| 272 | - | |||||||||||||||||||
| 273 | if (cb != NULL)
| 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:
| 7824 | ||||||||||||||||||
| 277 | } | - | ||||||||||||||||||
| 278 | - | |||||||||||||||||||
| 279 | int | - | ||||||||||||||||||
| 280 | BIO_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)
| 0-800946 | ||||||||||||||||||
| 286 | return (0); never executed: return (0); | 0 | ||||||||||||||||||
| 287 | - | |||||||||||||||||||
| 288 | cb = b->callback; | - | ||||||||||||||||||
| 289 | if ((b->method == NULL) || (b->method->bwrite == NULL)) {
| 0-800946 | ||||||||||||||||||
| 290 | BIOerror(BIO_R_UNSUPPORTED_METHOD); | - | ||||||||||||||||||
| 291 | return (-2); never executed: return (-2); | 0 | ||||||||||||||||||
| 292 | } | - | ||||||||||||||||||
| 293 | - | |||||||||||||||||||
| 294 | if ((cb != NULL) &&
| 0-800946 | ||||||||||||||||||
| 295 | ((i = (int)cb(b, BIO_CB_WRITE, in, inl, 0L, 1L)) <= 0))
| 0 | ||||||||||||||||||
| 296 | return (i); never executed: return (i); | 0 | ||||||||||||||||||
| 297 | - | |||||||||||||||||||
| 298 | if (!b->init) {
| 48-800898 | ||||||||||||||||||
| 299 | BIOerror(BIO_R_UNINITIALIZED); | - | ||||||||||||||||||
| 300 | return (-2); executed 48 times by 1 test: return (-2);Executed by:
| 48 | ||||||||||||||||||
| 301 | } | - | ||||||||||||||||||
| 302 | - | |||||||||||||||||||
| 303 | i = b->method->bwrite(b, in, inl); | - | ||||||||||||||||||
| 304 | - | |||||||||||||||||||
| 305 | if (i > 0)
| 1972-798926 | ||||||||||||||||||
| 306 | b->num_write += (unsigned long)i; executed 798926 times by 13 tests: b->num_write += (unsigned long)i;Executed by:
| 798926 | ||||||||||||||||||
| 307 | - | |||||||||||||||||||
| 308 | if (cb != NULL)
| 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:
| 800898 | ||||||||||||||||||
| 312 | } | - | ||||||||||||||||||
| 313 | - | |||||||||||||||||||
| 314 | int | - | ||||||||||||||||||
| 315 | BIO_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)) {
| 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) &&
| 0-9012 | ||||||||||||||||||
| 328 | ((i = (int)cb(b, BIO_CB_PUTS, in, 0, 0L, 1L)) <= 0))
| 0 | ||||||||||||||||||
| 329 | return (i); never executed: return (i); | 0 | ||||||||||||||||||
| 330 | - | |||||||||||||||||||
| 331 | if (!b->init) {
| 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)
| 0-9012 | ||||||||||||||||||
| 339 | b->num_write += (unsigned long)i; executed 9012 times by 5 tests: b->num_write += (unsigned long)i;Executed by:
| 9012 | ||||||||||||||||||
| 340 | - | |||||||||||||||||||
| 341 | if (cb != NULL)
| 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:
| 9012 | ||||||||||||||||||
| 344 | } | - | ||||||||||||||||||
| 345 | - | |||||||||||||||||||
| 346 | int | - | ||||||||||||||||||
| 347 | BIO_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)) {
| 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) &&
| 0-6425 | ||||||||||||||||||
| 360 | ((i = (int)cb(b, BIO_CB_GETS, in, inl, 0L, 1L)) <= 0))
| 0 | ||||||||||||||||||
| 361 | return (i); never executed: return (i); | 0 | ||||||||||||||||||
| 362 | - | |||||||||||||||||||
| 363 | if (!b->init) {
| 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)
| 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:
| 6425 | ||||||||||||||||||
| 373 | } | - | ||||||||||||||||||
| 374 | - | |||||||||||||||||||
| 375 | int | - | ||||||||||||||||||
| 376 | BIO_indent(BIO *b, int indent, int max) | - | ||||||||||||||||||
| 377 | { | - | ||||||||||||||||||
| 378 | if (indent < 0)
| 0-114 | ||||||||||||||||||
| 379 | indent = 0; never executed: indent = 0; | 0 | ||||||||||||||||||
| 380 | if (indent > max)
| 0-114 | ||||||||||||||||||
| 381 | indent = max; never executed: indent = max; | 0 | ||||||||||||||||||
| 382 | while (indent--)
| 114-1608 | ||||||||||||||||||
| 383 | if (BIO_puts(b, " ") != 1)
| 0-1608 | ||||||||||||||||||
| 384 | return 0; never executed: return 0; | 0 | ||||||||||||||||||
| 385 | return 1; executed 114 times by 2 tests: return 1;Executed by:
| 114 | ||||||||||||||||||
| 386 | } | - | ||||||||||||||||||
| 387 | - | |||||||||||||||||||
| 388 | long | - | ||||||||||||||||||
| 389 | BIO_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:
| 145 | ||||||||||||||||||
| 395 | } | - | ||||||||||||||||||
| 396 | - | |||||||||||||||||||
| 397 | char * | - | ||||||||||||||||||
| 398 | BIO_ptr_ctrl(BIO *b, int cmd, long larg) | - | ||||||||||||||||||
| 399 | { | - | ||||||||||||||||||
| 400 | char *p = NULL; | - | ||||||||||||||||||
| 401 | - | |||||||||||||||||||
| 402 | if (BIO_ctrl(b, cmd, larg, (char *)&p) <= 0)
| 0 | ||||||||||||||||||
| 403 | return (NULL); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||
| 404 | else | - | ||||||||||||||||||
| 405 | return (p); never executed: return (p); | 0 | ||||||||||||||||||
| 406 | } | - | ||||||||||||||||||
| 407 | - | |||||||||||||||||||
| 408 | long | - | ||||||||||||||||||
| 409 | BIO_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)
| 8-13226 | ||||||||||||||||||
| 415 | return (0); executed 8 times by 1 test: return (0);Executed by:
| 8 | ||||||||||||||||||
| 416 | - | |||||||||||||||||||
| 417 | if ((b->method == NULL) || (b->method->ctrl == NULL)) {
| 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) &&
| 0-13226 | ||||||||||||||||||
| 425 | ((ret = cb(b, BIO_CB_CTRL, parg, cmd, larg, 1L)) <= 0))
| 0 | ||||||||||||||||||
| 426 | return (ret); never executed: return (ret); | 0 | ||||||||||||||||||
| 427 | - | |||||||||||||||||||
| 428 | ret = b->method->ctrl(b, cmd, larg, parg); | - | ||||||||||||||||||
| 429 | - | |||||||||||||||||||
| 430 | if (cb != NULL)
| 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:
| 13226 | ||||||||||||||||||
| 433 | } | - | ||||||||||||||||||
| 434 | - | |||||||||||||||||||
| 435 | long | - | ||||||||||||||||||
| 436 | BIO_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)
| 0 | ||||||||||||||||||
| 443 | return (0); never executed: return (0); | 0 | ||||||||||||||||||
| 444 | - | |||||||||||||||||||
| 445 | if ((b->method == NULL) || (b->method->callback_ctrl == NULL)) {
| 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) &&
| 0 | ||||||||||||||||||
| 453 | ((ret = cb(b, BIO_CB_CTRL, (void *)&fp, cmd, 0, 1L)) <= 0))
| 0 | ||||||||||||||||||
| 454 | return (ret); never executed: return (ret); | 0 | ||||||||||||||||||
| 455 | - | |||||||||||||||||||
| 456 | ret = b->method->callback_ctrl(b, cmd, fp); | - | ||||||||||||||||||
| 457 | - | |||||||||||||||||||
| 458 | if (cb != NULL)
| 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. */ | - | ||||||||||||||||||
| 466 | size_t | - | ||||||||||||||||||
| 467 | BIO_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:
| 1818 | ||||||||||||||||||
| 470 | } | - | ||||||||||||||||||
| 471 | - | |||||||||||||||||||
| 472 | size_t | - | ||||||||||||||||||
| 473 | BIO_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 */ | - | ||||||||||||||||||
| 480 | BIO * | - | ||||||||||||||||||
| 481 | BIO_push(BIO *b, BIO *bio) | - | ||||||||||||||||||
| 482 | { | - | ||||||||||||||||||
| 483 | BIO *lb; | - | ||||||||||||||||||
| 484 | - | |||||||||||||||||||
| 485 | if (b == NULL)
| 0-597 | ||||||||||||||||||
| 486 | return (bio); never executed: return (bio); | 0 | ||||||||||||||||||
| 487 | lb = b; | - | ||||||||||||||||||
| 488 | while (lb->next_bio != NULL)
| 0-597 | ||||||||||||||||||
| 489 | lb = lb->next_bio; never executed: lb = lb->next_bio; | 0 | ||||||||||||||||||
| 490 | lb->next_bio = bio; | - | ||||||||||||||||||
| 491 | if (bio != NULL)
| 0-597 | ||||||||||||||||||
| 492 | bio->prev_bio = lb; executed 597 times by 7 tests: bio->prev_bio = lb;Executed by:
| 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:
| 597 | ||||||||||||||||||
| 496 | } | - | ||||||||||||||||||
| 497 | - | |||||||||||||||||||
| 498 | /* Remove the first and return the rest */ | - | ||||||||||||||||||
| 499 | BIO * | - | ||||||||||||||||||
| 500 | BIO_pop(BIO *b) | - | ||||||||||||||||||
| 501 | { | - | ||||||||||||||||||
| 502 | BIO *ret; | - | ||||||||||||||||||
| 503 | - | |||||||||||||||||||
| 504 | if (b == NULL)
| 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)
| 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)
| 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:
| 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:
| 142 | ||||||||||||||||||
| 518 | } | - | ||||||||||||||||||
| 519 | - | |||||||||||||||||||
| 520 | BIO * | - | ||||||||||||||||||
| 521 | BIO_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))
| 0 | ||||||||||||||||||
| 528 | break; never executed: break; | 0 | ||||||||||||||||||
| 529 | last = b; | - | ||||||||||||||||||
| 530 | b = b->next_bio; | - | ||||||||||||||||||
| 531 | if (b == NULL)
| 0 | ||||||||||||||||||
| 532 | break; never executed: break; | 0 | ||||||||||||||||||
| 533 | } never executed: end of block | 0 | ||||||||||||||||||
| 534 | if (reason != NULL)
| 0 | ||||||||||||||||||
| 535 | *reason = last->retry_reason; never executed: *reason = last->retry_reason; | 0 | ||||||||||||||||||
| 536 | return (last); never executed: return (last); | 0 | ||||||||||||||||||
| 537 | } | - | ||||||||||||||||||
| 538 | - | |||||||||||||||||||
| 539 | int | - | ||||||||||||||||||
| 540 | BIO_get_retry_reason(BIO *bio) | - | ||||||||||||||||||
| 541 | { | - | ||||||||||||||||||
| 542 | return (bio->retry_reason); never executed: return (bio->retry_reason); | 0 | ||||||||||||||||||
| 543 | } | - | ||||||||||||||||||
| 544 | - | |||||||||||||||||||
| 545 | BIO * | - | ||||||||||||||||||
| 546 | BIO_find_type(BIO *bio, int type) | - | ||||||||||||||||||
| 547 | { | - | ||||||||||||||||||
| 548 | int mt, mask; | - | ||||||||||||||||||
| 549 | - | |||||||||||||||||||
| 550 | if (!bio)
| 0-6 | ||||||||||||||||||
| 551 | return NULL; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 552 | mask = type & 0xff; | - | ||||||||||||||||||
| 553 | do { | - | ||||||||||||||||||
| 554 | if (bio->method != NULL) {
| 0-8 | ||||||||||||||||||
| 555 | mt = bio->method->type; | - | ||||||||||||||||||
| 556 | if (!mask) {
| 0-8 | ||||||||||||||||||
| 557 | if (mt & type)
| 0 | ||||||||||||||||||
| 558 | return (bio); never executed: return (bio); | 0 | ||||||||||||||||||
| 559 | } else if (mt == type) never executed: end of block
| 0-6 | ||||||||||||||||||
| 560 | return (bio); executed 6 times by 1 test: return (bio);Executed by:
| 6 | ||||||||||||||||||
| 561 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||
| 562 | bio = bio->next_bio; | - | ||||||||||||||||||
| 563 | } while (bio != NULL); executed 2 times by 1 test: end of blockExecuted by:
| 0-2 | ||||||||||||||||||
| 564 | return (NULL); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||
| 565 | } | - | ||||||||||||||||||
| 566 | - | |||||||||||||||||||
| 567 | BIO * | - | ||||||||||||||||||
| 568 | BIO_next(BIO *b) | - | ||||||||||||||||||
| 569 | { | - | ||||||||||||||||||
| 570 | if (!b)
| 0 | ||||||||||||||||||
| 571 | return NULL; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 572 | return b->next_bio; never executed: return b->next_bio; | 0 | ||||||||||||||||||
| 573 | } | - | ||||||||||||||||||
| 574 | - | |||||||||||||||||||
| 575 | void | - | ||||||||||||||||||
| 576 | BIO_free_all(BIO *bio) | - | ||||||||||||||||||
| 577 | { | - | ||||||||||||||||||
| 578 | BIO *b; | - | ||||||||||||||||||
| 579 | int ref; | - | ||||||||||||||||||
| 580 | - | |||||||||||||||||||
| 581 | while (bio != NULL) {
| 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)
| 26-727 | ||||||||||||||||||
| 588 | break; executed 26 times by 2 tests: break;Executed by:
| 26 | ||||||||||||||||||
| 589 | } executed 727 times by 5 tests: end of blockExecuted by:
| 727 | ||||||||||||||||||
| 590 | } executed 790 times by 14 tests: end of blockExecuted by:
| 790 | ||||||||||||||||||
| 591 | - | |||||||||||||||||||
| 592 | BIO * | - | ||||||||||||||||||
| 593 | BIO_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) {
| 0 | ||||||||||||||||||
| 598 | if ((new_bio = BIO_new(bio->method)) == NULL)
| 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)) {
| 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,
| 0 | ||||||||||||||||||
| 616 | &new_bio->ex_data, &bio->ex_data))
| 0 | ||||||||||||||||||
| 617 | goto err; never executed: goto err; | 0 | ||||||||||||||||||
| 618 | - | |||||||||||||||||||
| 619 | if (ret == NULL) {
| 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 | ||||||||||||||||||
| 628 | err: | - | ||||||||||||||||||
| 629 | BIO_free(ret); | - | ||||||||||||||||||
| 630 | return (NULL); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||
| 631 | - | |||||||||||||||||||
| 632 | } | - | ||||||||||||||||||
| 633 | - | |||||||||||||||||||
| 634 | void | - | ||||||||||||||||||
| 635 | BIO_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 blockExecuted by:
| 1274 | ||||||||||||||||||
| 640 | - | |||||||||||||||||||
| 641 | int | - | ||||||||||||||||||
| 642 | BIO_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 | - | |||||||||||||||||||
| 649 | int | - | ||||||||||||||||||
| 650 | BIO_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 | - | |||||||||||||||||||
| 655 | void * | - | ||||||||||||||||||
| 656 | BIO_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 | - | |||||||||||||||||||
| 661 | unsigned long | - | ||||||||||||||||||
| 662 | BIO_number_read(BIO *bio) | - | ||||||||||||||||||
| 663 | { | - | ||||||||||||||||||
| 664 | if (bio)
| 0 | ||||||||||||||||||
| 665 | return bio->num_read; never executed: return bio->num_read; | 0 | ||||||||||||||||||
| 666 | return 0; never executed: return 0; | 0 | ||||||||||||||||||
| 667 | } | - | ||||||||||||||||||
| 668 | - | |||||||||||||||||||
| 669 | unsigned long | - | ||||||||||||||||||
| 670 | BIO_number_written(BIO *bio) | - | ||||||||||||||||||
| 671 | { | - | ||||||||||||||||||
| 672 | if (bio)
| 0 | ||||||||||||||||||
| 673 | return bio->num_write; never executed: return bio->num_write; | 0 | ||||||||||||||||||
| 674 | return 0; never executed: return 0; | 0 | ||||||||||||||||||
| 675 | } | - | ||||||||||||||||||
| Source code | Switch to Preprocessed file |