| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/x509/by_mem.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | static int by_mem_ctrl(X509_LOOKUP *, int, const char *, long, char **); | - | ||||||||||||
| 6 | - | |||||||||||||
| 7 | static X509_LOOKUP_METHOD x509_mem_lookup = { | - | ||||||||||||
| 8 | .name = "Load cert from memory", | - | ||||||||||||
| 9 | .new_item = | - | ||||||||||||
| 10 | ((void *)0) | - | ||||||||||||
| 11 | , | - | ||||||||||||
| 12 | .free = | - | ||||||||||||
| 13 | ((void *)0) | - | ||||||||||||
| 14 | , | - | ||||||||||||
| 15 | .init = | - | ||||||||||||
| 16 | ((void *)0) | - | ||||||||||||
| 17 | , | - | ||||||||||||
| 18 | .shutdown = | - | ||||||||||||
| 19 | ((void *)0) | - | ||||||||||||
| 20 | , | - | ||||||||||||
| 21 | .ctrl = by_mem_ctrl, | - | ||||||||||||
| 22 | .get_by_subject = | - | ||||||||||||
| 23 | ((void *)0) | - | ||||||||||||
| 24 | , | - | ||||||||||||
| 25 | .get_by_issuer_serial = | - | ||||||||||||
| 26 | ((void *)0) | - | ||||||||||||
| 27 | , | - | ||||||||||||
| 28 | .get_by_fingerprint = | - | ||||||||||||
| 29 | ((void *)0) | - | ||||||||||||
| 30 | , | - | ||||||||||||
| 31 | .get_by_alias = | - | ||||||||||||
| 32 | ((void *)0) | - | ||||||||||||
| 33 | , | - | ||||||||||||
| 34 | }; | - | ||||||||||||
| 35 | - | |||||||||||||
| 36 | X509_LOOKUP_METHOD * | - | ||||||||||||
| 37 | X509_LOOKUP_mem(void) | - | ||||||||||||
| 38 | { | - | ||||||||||||
| 39 | return executed 4 times by 1 test: (&x509_mem_lookup);return (&x509_mem_lookup);Executed by:
executed 4 times by 1 test: return (&x509_mem_lookup);Executed by:
| 4 | ||||||||||||
| 40 | } | - | ||||||||||||
| 41 | - | |||||||||||||
| 42 | static int | - | ||||||||||||
| 43 | by_mem_ctrl(X509_LOOKUP *lu, int cmd, const char *buf, | - | ||||||||||||
| 44 | long type, char **ret) | - | ||||||||||||
| 45 | { | - | ||||||||||||
| 46 | struct stack_st_X509_INFO *inf = | - | ||||||||||||
| 47 | ((void *)0) | - | ||||||||||||
| 48 | ; | - | ||||||||||||
| 49 | const struct iovec *iov; | - | ||||||||||||
| 50 | X509_INFO *itmp; | - | ||||||||||||
| 51 | BIO *in = | - | ||||||||||||
| 52 | ((void *)0) | - | ||||||||||||
| 53 | ; | - | ||||||||||||
| 54 | int i, count = 0, ok = 0; | - | ||||||||||||
| 55 | - | |||||||||||||
| 56 | iov = (const struct iovec *)buf; | - | ||||||||||||
| 57 | - | |||||||||||||
| 58 | if (!(cmd == 3
| 0-4 | ||||||||||||
| 59 | goto never executed: done;goto done;never executed: goto done; | 0 | ||||||||||||
| 60 | - | |||||||||||||
| 61 | if ((
| 0-4 | ||||||||||||
| 62 | ((void *)0)
| 0-4 | ||||||||||||
| 63 | ) | - | ||||||||||||
| 64 | goto never executed: done;goto done;never executed: goto done; | 0 | ||||||||||||
| 65 | - | |||||||||||||
| 66 | if ((
| 0-4 | ||||||||||||
| 67 | ((void *)0)
| 0-4 | ||||||||||||
| 68 | ,
| 0-4 | ||||||||||||
| 69 | ((void *)0)
| 0-4 | ||||||||||||
| 70 | ,
| 0-4 | ||||||||||||
| 71 | ((void *)0)
| 0-4 | ||||||||||||
| 72 | )) ==
| 0-4 | ||||||||||||
| 73 | ((void *)0)
| 0-4 | ||||||||||||
| 74 | ) | - | ||||||||||||
| 75 | goto never executed: done;goto done;never executed: goto done; | 0 | ||||||||||||
| 76 | - | |||||||||||||
| 77 | for (i = 0; i < sk_num(((_STACK*) (1 ? (inf) : (struct stack_st_X509_INFO*)0)))
| 4-8 | ||||||||||||
| 78 | itmp = ((X509_INFO *)sk_value(((_STACK*) (1 ? (inf) : (struct stack_st_X509_INFO*)0)), (i))); | - | ||||||||||||
| 79 | if (itmp->x509
| 0-8 | ||||||||||||
| 80 | ok = X509_STORE_add_cert(lu->store_ctx, itmp->x509); | - | ||||||||||||
| 81 | if (!ok
| 0-8 | ||||||||||||
| 82 | goto never executed: done;goto done;never executed: goto done; | 0 | ||||||||||||
| 83 | count++; | - | ||||||||||||
| 84 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||
| 85 | if (itmp->crl
| 0-8 | ||||||||||||
| 86 | ok = X509_STORE_add_crl(lu->store_ctx, itmp->crl); | - | ||||||||||||
| 87 | if (!ok
| 0 | ||||||||||||
| 88 | goto never executed: done;goto done;never executed: goto done; | 0 | ||||||||||||
| 89 | count++; | - | ||||||||||||
| 90 | } never executed: end of block | 0 | ||||||||||||
| 91 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||
| 92 | - | |||||||||||||
| 93 | ok = count != 0; | - | ||||||||||||
| 94 | done: code before this statement executed 4 times by 1 test: done:Executed by:
| 4 | ||||||||||||
| 95 | if (count == 0
| 0-4 | ||||||||||||
| 96 | ERR_put_error(11,(0xfff),(9),__FILE__,132); never executed: ERR_put_error(11,(0xfff),(9),__FILE__,132); | 0 | ||||||||||||
| 97 | if (inf !=
| 0-4 | ||||||||||||
| 98 | ((void *)0)
| 0-4 | ||||||||||||
| 99 | ) | - | ||||||||||||
| 100 | sk_pop_free(((_STACK*) (1 ? (inf) : (struct stack_st_X509_INFO*)0)), ((void (*)(void *)) ((1 ? (X509_INFO_free) : (void (*)(X509_INFO *))0)))); executed 4 times by 1 test: sk_pop_free(((_STACK*) (1 ? (inf) : (struct stack_st_X509_INFO*)0)), ((void (*)(void *)) ((1 ? (X509_INFO_free) : (void (*)(X509_INFO *))0))));Executed by:
| 4 | ||||||||||||
| 101 | if (in !=
| 0-4 | ||||||||||||
| 102 | ((void *)0)
| 0-4 | ||||||||||||
| 103 | ) | - | ||||||||||||
| 104 | BIO_free(in); executed 4 times by 1 test: BIO_free(in);Executed by:
| 4 | ||||||||||||
| 105 | return executed 4 times by 1 test: (ok);return (ok);Executed by:
executed 4 times by 1 test: return (ok);Executed by:
| 4 | ||||||||||||
| 106 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |