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