| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/d2i_pr.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, | - | ||||||||||||||||||
| 6 | long length) | - | ||||||||||||||||||
| 7 | { | - | ||||||||||||||||||
| 8 | EVP_PKEY *ret; | - | ||||||||||||||||||
| 9 | const unsigned char *p = *pp; | - | ||||||||||||||||||
| 10 | - | |||||||||||||||||||
| 11 | if ((
| 0-7073 | ||||||||||||||||||
| 12 | ((void *)0)
| 0-7073 | ||||||||||||||||||
| 13 | )
| 0-7073 | ||||||||||||||||||
| 14 | ((void *)0)
| 0 | ||||||||||||||||||
| 15 | )
| 0 | ||||||||||||||||||
| 16 | if ((
| 0-7073 | ||||||||||||||||||
| 17 | ((void *)0)
| 0-7073 | ||||||||||||||||||
| 18 | ) { | - | ||||||||||||||||||
| 19 | ERR_put_error(13,(154),(6),__FILE__,29); | - | ||||||||||||||||||
| 20 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 21 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 22 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 23 | } | - | ||||||||||||||||||
| 24 | } executed 7073 times by 1 test: else {end of blockExecuted by:
| 7073 | ||||||||||||||||||
| 25 | ret = *a; | - | ||||||||||||||||||
| 26 | - | |||||||||||||||||||
| 27 | ENGINE_finish(ret->engine); | - | ||||||||||||||||||
| 28 | ret->engine = | - | ||||||||||||||||||
| 29 | ((void *)0) | - | ||||||||||||||||||
| 30 | ; | - | ||||||||||||||||||
| 31 | - | |||||||||||||||||||
| 32 | } never executed: end of block | 0 | ||||||||||||||||||
| 33 | - | |||||||||||||||||||
| 34 | if (!EVP_PKEY_set_type(ret, type)
| 0-7073 | ||||||||||||||||||
| 35 | ERR_put_error(13,(154),(163),__FILE__,41); | - | ||||||||||||||||||
| 36 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 37 | } | - | ||||||||||||||||||
| 38 | - | |||||||||||||||||||
| 39 | if (!ret->ameth->old_priv_decode
| 0-7073 | ||||||||||||||||||
| 40 | !ret->ameth->old_priv_decode(ret, &p, length)
| 2608-4465 | ||||||||||||||||||
| 41 | if (ret->ameth->priv_decode
| 0-2608 | ||||||||||||||||||
| 42 | EVP_PKEY *tmp; | - | ||||||||||||||||||
| 43 | PKCS8_PRIV_KEY_INFO *p8 = | - | ||||||||||||||||||
| 44 | ((void *)0) | - | ||||||||||||||||||
| 45 | ; | - | ||||||||||||||||||
| 46 | p8 = d2i_PKCS8_PRIV_KEY_INFO( | - | ||||||||||||||||||
| 47 | ((void *)0) | - | ||||||||||||||||||
| 48 | , &p, length); | - | ||||||||||||||||||
| 49 | if (!p8
| 2-2606 | ||||||||||||||||||
| 50 | goto executed 2606 times by 1 test: err;goto err;Executed by:
executed 2606 times by 1 test: goto err;Executed by:
| 2606 | ||||||||||||||||||
| 51 | tmp = EVP_PKCS82PKEY(p8); | - | ||||||||||||||||||
| 52 | PKCS8_PRIV_KEY_INFO_free(p8); | - | ||||||||||||||||||
| 53 | if (tmp ==
| 1 | ||||||||||||||||||
| 54 | ((void *)0)
| 1 | ||||||||||||||||||
| 55 | ) | - | ||||||||||||||||||
| 56 | goto executed 1 time by 1 test: err;goto err;Executed by:
executed 1 time by 1 test: goto err;Executed by:
| 1 | ||||||||||||||||||
| 57 | EVP_PKEY_free(ret); | - | ||||||||||||||||||
| 58 | ret = tmp; | - | ||||||||||||||||||
| 59 | } executed 1 time by 1 test: else {end of blockExecuted by:
| 1 | ||||||||||||||||||
| 60 | ERR_put_error(13,(154),(13),__FILE__,60); | - | ||||||||||||||||||
| 61 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 62 | } | - | ||||||||||||||||||
| 63 | } | - | ||||||||||||||||||
| 64 | *pp = p; | - | ||||||||||||||||||
| 65 | if (a !=
| 0-4466 | ||||||||||||||||||
| 66 | ((void *)0)
| 0-4466 | ||||||||||||||||||
| 67 | ) | - | ||||||||||||||||||
| 68 | (* never executed: a) = ret;(*a) = ret;never executed: (*a) = ret; | 0 | ||||||||||||||||||
| 69 | return executed 4466 times by 1 test: ret;return ret;Executed by:
executed 4466 times by 1 test: return ret;Executed by:
| 4466 | ||||||||||||||||||
| 70 | err: | - | ||||||||||||||||||
| 71 | if (a ==
| 0-2607 | ||||||||||||||||||
| 72 | ((void *)0)
| 0-2607 | ||||||||||||||||||
| 73 | || *
| 0 | ||||||||||||||||||
| 74 | EVP_PKEY_free(ret); executed 2607 times by 1 test: EVP_PKEY_free(ret);Executed by:
| 2607 | ||||||||||||||||||
| 75 | return executed 2607 times by 1 test: return ((void *)0) ;Executed by:
executed 2607 times by 1 test: return ((void *)0) ;Executed by:
| 2607 | ||||||||||||||||||
| 76 | ((void *)0) executed 2607 times by 1 test: return ((void *)0) ;Executed by:
| 2607 | ||||||||||||||||||
| 77 | ; executed 2607 times by 1 test: return ((void *)0) ;Executed by:
| 2607 | ||||||||||||||||||
| 78 | } | - | ||||||||||||||||||
| 79 | - | |||||||||||||||||||
| 80 | - | |||||||||||||||||||
| 81 | - | |||||||||||||||||||
| 82 | - | |||||||||||||||||||
| 83 | - | |||||||||||||||||||
| 84 | - | |||||||||||||||||||
| 85 | EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, | - | ||||||||||||||||||
| 86 | long length) | - | ||||||||||||||||||
| 87 | { | - | ||||||||||||||||||
| 88 | struct stack_st_ASN1_TYPE *inkey; | - | ||||||||||||||||||
| 89 | const unsigned char *p; | - | ||||||||||||||||||
| 90 | int keytype; | - | ||||||||||||||||||
| 91 | p = *pp; | - | ||||||||||||||||||
| 92 | - | |||||||||||||||||||
| 93 | - | |||||||||||||||||||
| 94 | - | |||||||||||||||||||
| 95 | - | |||||||||||||||||||
| 96 | - | |||||||||||||||||||
| 97 | inkey = d2i_ASN1_SEQUENCE_ANY( | - | ||||||||||||||||||
| 98 | ((void *)0) | - | ||||||||||||||||||
| 99 | , &p, length); | - | ||||||||||||||||||
| 100 | p = *pp; | - | ||||||||||||||||||
| 101 | - | |||||||||||||||||||
| 102 | - | |||||||||||||||||||
| 103 | - | |||||||||||||||||||
| 104 | - | |||||||||||||||||||
| 105 | if (sk_ASN1_TYPE_num(inkey) == 6
| 34-3305 | ||||||||||||||||||
| 106 | keytype = 116; executed 34 times by 1 test: keytype = 116;Executed by:
| 34 | ||||||||||||||||||
| 107 | else if (sk_ASN1_TYPE_num(inkey) == 4
| 249-3056 | ||||||||||||||||||
| 108 | keytype = 408; executed 249 times by 1 test: keytype = 408;Executed by:
| 249 | ||||||||||||||||||
| 109 | else if (sk_ASN1_TYPE_num(inkey) == 3
| 626-2430 | ||||||||||||||||||
| 110 | - | |||||||||||||||||||
| 111 | PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO( | - | ||||||||||||||||||
| 112 | ((void *)0) | - | ||||||||||||||||||
| 113 | , &p, length); | - | ||||||||||||||||||
| 114 | EVP_PKEY *ret; | - | ||||||||||||||||||
| 115 | - | |||||||||||||||||||
| 116 | sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free); | - | ||||||||||||||||||
| 117 | if (!p8
| 15-611 | ||||||||||||||||||
| 118 | ERR_put_error(13,(207),(167),__FILE__,109) | - | ||||||||||||||||||
| 119 | ; | - | ||||||||||||||||||
| 120 | return executed 611 times by 1 test: return ((void *)0) ;Executed by:
executed 611 times by 1 test: return ((void *)0) ;Executed by:
| 611 | ||||||||||||||||||
| 121 | ((void *)0) executed 611 times by 1 test: return ((void *)0) ;Executed by:
| 611 | ||||||||||||||||||
| 122 | ; executed 611 times by 1 test: return ((void *)0) ;Executed by:
| 611 | ||||||||||||||||||
| 123 | } | - | ||||||||||||||||||
| 124 | ret = EVP_PKCS82PKEY(p8); | - | ||||||||||||||||||
| 125 | PKCS8_PRIV_KEY_INFO_free(p8); | - | ||||||||||||||||||
| 126 | if (ret ==
| 4-11 | ||||||||||||||||||
| 127 | ((void *)0)
| 4-11 | ||||||||||||||||||
| 128 | ) | - | ||||||||||||||||||
| 129 | return executed 11 times by 1 test: return ((void *)0) ;Executed by:
executed 11 times by 1 test: return ((void *)0) ;Executed by:
| 11 | ||||||||||||||||||
| 130 | ((void *)0) executed 11 times by 1 test: return ((void *)0) ;Executed by:
| 11 | ||||||||||||||||||
| 131 | ; executed 11 times by 1 test: return ((void *)0) ;Executed by:
| 11 | ||||||||||||||||||
| 132 | *pp = p; | - | ||||||||||||||||||
| 133 | if (a
| 0-4 | ||||||||||||||||||
| 134 | *a = ret; | - | ||||||||||||||||||
| 135 | } never executed: end of block | 0 | ||||||||||||||||||
| 136 | return executed 4 times by 1 test: ret;return ret;Executed by:
executed 4 times by 1 test: return ret;Executed by:
| 4 | ||||||||||||||||||
| 137 | } else | - | ||||||||||||||||||
| 138 | keytype = 6; executed 2430 times by 1 test: keytype = 6;Executed by:
| 2430 | ||||||||||||||||||
| 139 | sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free); | - | ||||||||||||||||||
| 140 | return executed 2713 times by 1 test: d2i_PrivateKey(keytype, a, pp, length);return d2i_PrivateKey(keytype, a, pp, length);Executed by:
executed 2713 times by 1 test: return d2i_PrivateKey(keytype, a, pp, length);Executed by:
| 2713 | ||||||||||||||||||
| 141 | } | - | ||||||||||||||||||
| Switch to Source code | Preprocessed file |