| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/evp/pmeth_lib.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | typedef int sk_cmp_fn_type(const char * const *a, const char * const *b); | - | ||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | struct stack_st_EVP_PKEY_METHOD { _STACK stack; }; | - | ||||||||||||||||||||||||
| 12 | struct stack_st_EVP_PKEY_METHOD *app_pkey_methods = | - | ||||||||||||||||||||||||
| 13 | ((void *)0) | - | ||||||||||||||||||||||||
| 14 | ; | - | ||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | extern const EVP_PKEY_METHOD rsa_pkey_meth, dh_pkey_meth, dsa_pkey_meth; | - | ||||||||||||||||||||||||
| 17 | extern const EVP_PKEY_METHOD ec_pkey_meth, hmac_pkey_meth, cmac_pkey_meth; | - | ||||||||||||||||||||||||
| 18 | extern const EVP_PKEY_METHOD gostimit_pkey_meth, gostr01_pkey_meth; | - | ||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||
| 20 | static const EVP_PKEY_METHOD *standard_methods[] = { | - | ||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||
| 22 | &rsa_pkey_meth, | - | ||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||
| 24 | - | |||||||||||||||||||||||||
| 25 | &dh_pkey_meth, | - | ||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | &dsa_pkey_meth, | - | ||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||
| 30 | - | |||||||||||||||||||||||||
| 31 | &ec_pkey_meth, | - | ||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||
| 33 | - | |||||||||||||||||||||||||
| 34 | &gostr01_pkey_meth, | - | ||||||||||||||||||||||||
| 35 | &gostimit_pkey_meth, | - | ||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | &hmac_pkey_meth, | - | ||||||||||||||||||||||||
| 38 | &cmac_pkey_meth, | - | ||||||||||||||||||||||||
| 39 | }; | - | ||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||
| 41 | static int pmeth_cmp_BSEARCH_CMP_FN(const void *, const void *); | - | ||||||||||||||||||||||||
| 42 | static int pmeth_cmp(const EVP_PKEY_METHOD * const *, const EVP_PKEY_METHOD * const *); | - | ||||||||||||||||||||||||
| 43 | static const EVP_PKEY_METHOD * *OBJ_bsearch_pmeth(const EVP_PKEY_METHOD * *key, const EVP_PKEY_METHOD * const *base, int num); | - | ||||||||||||||||||||||||
| 44 | - | |||||||||||||||||||||||||
| 45 | static int | - | ||||||||||||||||||||||||
| 46 | pmeth_cmp(const EVP_PKEY_METHOD * const *a, const EVP_PKEY_METHOD * const *b) | - | ||||||||||||||||||||||||
| 47 | { | - | ||||||||||||||||||||||||
| 48 | return executed 8162 times by 15 tests: ((*a)->pkey_id - (*b)->pkey_id);return ((*a)->pkey_id - (*b)->pkey_id);Executed by:
executed 8162 times by 15 tests: return ((*a)->pkey_id - (*b)->pkey_id);Executed by:
| 8162 | ||||||||||||||||||||||||
| 49 | } | - | ||||||||||||||||||||||||
| 50 | - | |||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||
| 52 | static int | - | ||||||||||||||||||||||||
| 53 | pmeth_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) | - | ||||||||||||||||||||||||
| 54 | { | - | ||||||||||||||||||||||||
| 55 | const EVP_PKEY_METHOD * const *a = a_; | - | ||||||||||||||||||||||||
| 56 | const EVP_PKEY_METHOD * const *b = b_; | - | ||||||||||||||||||||||||
| 57 | return executed 8162 times by 15 tests: pmeth_cmp(a, b);return pmeth_cmp(a, b);Executed by:
executed 8162 times by 15 tests: return pmeth_cmp(a, b);Executed by:
| 8162 | ||||||||||||||||||||||||
| 58 | } | - | ||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||
| 60 | static const EVP_PKEY_METHOD * * | - | ||||||||||||||||||||||||
| 61 | OBJ_bsearch_pmeth(const EVP_PKEY_METHOD * *key, const EVP_PKEY_METHOD * const *base, int num) | - | ||||||||||||||||||||||||
| 62 | { | - | ||||||||||||||||||||||||
| 63 | return executed 4067 times by 15 tests: (const EVP_PKEY_METHOD * *)OBJ_bsearch_(key, base, num, sizeof(const EVP_PKEY_METHOD *),return (const EVP_PKEY_METHOD * *)OBJ_bsearch_(key, base, num, sizeof(const EVP_PKEY_METHOD *), pmeth_cmp_BSEARCH_CMP_FN);Executed by:
executed 4067 times by 15 tests: return (const EVP_PKEY_METHOD * *)OBJ_bsearch_(key, base, num, sizeof(const EVP_PKEY_METHOD *), pmeth_cmp_BSEARCH_CMP_FN);Executed by:
| 4067 | ||||||||||||||||||||||||
| 64 | pmeth_cmp_BSEARCH_CMP_FN); executed 4067 times by 15 tests: return (const EVP_PKEY_METHOD * *)OBJ_bsearch_(key, base, num, sizeof(const EVP_PKEY_METHOD *), pmeth_cmp_BSEARCH_CMP_FN);Executed by:
| 4067 | ||||||||||||||||||||||||
| 65 | } | - | ||||||||||||||||||||||||
| 66 | - | |||||||||||||||||||||||||
| 67 | const EVP_PKEY_METHOD * | - | ||||||||||||||||||||||||
| 68 | EVP_PKEY_meth_find(int type) | - | ||||||||||||||||||||||||
| 69 | { | - | ||||||||||||||||||||||||
| 70 | EVP_PKEY_METHOD tmp; | - | ||||||||||||||||||||||||
| 71 | const EVP_PKEY_METHOD *t = &tmp, **ret; | - | ||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||
| 73 | tmp.pkey_id = type; | - | ||||||||||||||||||||||||
| 74 | if (app_pkey_methods
| 0-4067 | ||||||||||||||||||||||||
| 75 | int idx; | - | ||||||||||||||||||||||||
| 76 | idx = sk_find(((_STACK*) (1 ? (app_pkey_methods) : (struct stack_st_EVP_PKEY_METHOD*)0)), ((void*) (1 ? (&tmp) : (EVP_PKEY_METHOD*)0))); | - | ||||||||||||||||||||||||
| 77 | if (idx >= 0
| 0 | ||||||||||||||||||||||||
| 78 | return never executed: ((EVP_PKEY_METHOD *)sk_value(((_STACK*) (1 ? (app_pkey_methods) : (struct stack_st_EVP_PKEY_METHOD*)0)), (idx)));return ((EVP_PKEY_METHOD *)sk_value(((_STACK*) (1 ? (app_pkey_methods) : (struct stack_st_EVP_PKEY_METHOD*)0)), (idx)));never executed: return ((EVP_PKEY_METHOD *)sk_value(((_STACK*) (1 ? (app_pkey_methods) : (struct stack_st_EVP_PKEY_METHOD*)0)), (idx))); | 0 | ||||||||||||||||||||||||
| 79 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 80 | ret = OBJ_bsearch_pmeth(&t, standard_methods, | - | ||||||||||||||||||||||||
| 81 | sizeof(standard_methods)/sizeof(EVP_PKEY_METHOD *)); | - | ||||||||||||||||||||||||
| 82 | if (!ret
| 0-4067 | ||||||||||||||||||||||||
| 83 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 84 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 85 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 86 | return executed 4067 times by 15 tests: *ret;return *ret;Executed by:
executed 4067 times by 15 tests: return *ret;Executed by:
| 4067 | ||||||||||||||||||||||||
| 87 | } | - | ||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||
| 89 | static EVP_PKEY_CTX * | - | ||||||||||||||||||||||||
| 90 | int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id) | - | ||||||||||||||||||||||||
| 91 | { | - | ||||||||||||||||||||||||
| 92 | EVP_PKEY_CTX *ret; | - | ||||||||||||||||||||||||
| 93 | const EVP_PKEY_METHOD *pmeth; | - | ||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||
| 95 | if (id == -1
| 1812-1965 | ||||||||||||||||||||||||
| 96 | if (!pkey
| 0-1965 | ||||||||||||||||||||||||
| 97 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 98 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 99 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 100 | id = pkey->ameth->pkey_id; | - | ||||||||||||||||||||||||
| 101 | } executed 1965 times by 7 tests: end of blockExecuted by:
| 1965 | ||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||
| 103 | if (pkey
| 0-1965 | ||||||||||||||||||||||||
| 104 | e = pkey->engine; never executed: e = pkey->engine; | 0 | ||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||
| 106 | if (e
| 0-3777 | ||||||||||||||||||||||||
| 107 | if (!ENGINE_init(e)
| 0 | ||||||||||||||||||||||||
| 108 | ERR_put_error(6,(0xfff),(38),__FILE__,169); | - | ||||||||||||||||||||||||
| 109 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 110 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 111 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 112 | } | - | ||||||||||||||||||||||||
| 113 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
| 114 | e = ENGINE_get_pkey_meth_engine(id); executed 3777 times by 7 tests: e = ENGINE_get_pkey_meth_engine(id);Executed by:
| 3777 | ||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||
| 116 | - | |||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||
| 118 | - | |||||||||||||||||||||||||
| 119 | - | |||||||||||||||||||||||||
| 120 | if (e
| 0-3777 | ||||||||||||||||||||||||
| 121 | pmeth = ENGINE_get_pkey_meth(e, id); never executed: pmeth = ENGINE_get_pkey_meth(e, id); | 0 | ||||||||||||||||||||||||
| 122 | else | - | ||||||||||||||||||||||||
| 123 | - | |||||||||||||||||||||||||
| 124 | pmeth = EVP_PKEY_meth_find(id); executed 3777 times by 7 tests: pmeth = EVP_PKEY_meth_find(id);Executed by:
| 3777 | ||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||
| 126 | if (pmeth ==
| 0-3777 | ||||||||||||||||||||||||
| 127 | ((void *)0)
| 0-3777 | ||||||||||||||||||||||||
| 128 | ) { | - | ||||||||||||||||||||||||
| 129 | ERR_put_error(6,(0xfff),(156),__FILE__,186); | - | ||||||||||||||||||||||||
| 130 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 131 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 132 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 133 | } | - | ||||||||||||||||||||||||
| 134 | - | |||||||||||||||||||||||||
| 135 | ret = malloc(sizeof(EVP_PKEY_CTX)); | - | ||||||||||||||||||||||||
| 136 | if (ret ==
| 0-3777 | ||||||||||||||||||||||||
| 137 | ((void *)0)
| 0-3777 | ||||||||||||||||||||||||
| 138 | ) { | - | ||||||||||||||||||||||||
| 139 | - | |||||||||||||||||||||||||
| 140 | ENGINE_finish(e); | - | ||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||
| 142 | ERR_put_error(6,(0xfff),((1|64)),__FILE__,195); | - | ||||||||||||||||||||||||
| 143 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 144 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 145 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 146 | } | - | ||||||||||||||||||||||||
| 147 | ret->engine = e; | - | ||||||||||||||||||||||||
| 148 | ret->pmeth = pmeth; | - | ||||||||||||||||||||||||
| 149 | ret->operation = 0; | - | ||||||||||||||||||||||||
| 150 | ret->pkey = pkey; | - | ||||||||||||||||||||||||
| 151 | ret->peerkey = | - | ||||||||||||||||||||||||
| 152 | ((void *)0) | - | ||||||||||||||||||||||||
| 153 | ; | - | ||||||||||||||||||||||||
| 154 | ret->pkey_gencb = 0; | - | ||||||||||||||||||||||||
| 155 | if (pkey
| 1812-1965 | ||||||||||||||||||||||||
| 156 | CRYPTO_add_lock(&pkey->references,1,10,__FILE__,205); executed 1965 times by 7 tests: CRYPTO_add_lock(&pkey->references,1,10,__FILE__,205);Executed by:
| 1965 | ||||||||||||||||||||||||
| 157 | ret->data = | - | ||||||||||||||||||||||||
| 158 | ((void *)0) | - | ||||||||||||||||||||||||
| 159 | ; | - | ||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||
| 161 | if (pmeth->init
| 0-3777 | ||||||||||||||||||||||||
| 162 | if (pmeth->init(ret) <= 0
| 0-3777 | ||||||||||||||||||||||||
| 163 | EVP_PKEY_CTX_free(ret); | - | ||||||||||||||||||||||||
| 164 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 165 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 166 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 167 | } | - | ||||||||||||||||||||||||
| 168 | } executed 3777 times by 7 tests: end of blockExecuted by:
| 3777 | ||||||||||||||||||||||||
| 169 | - | |||||||||||||||||||||||||
| 170 | return executed 3777 times by 7 tests: ret;return ret;Executed by:
executed 3777 times by 7 tests: return ret;Executed by:
| 3777 | ||||||||||||||||||||||||
| 171 | } | - | ||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||
| 173 | EVP_PKEY_METHOD* | - | ||||||||||||||||||||||||
| 174 | EVP_PKEY_meth_new(int id, int flags) | - | ||||||||||||||||||||||||
| 175 | { | - | ||||||||||||||||||||||||
| 176 | EVP_PKEY_METHOD *pmeth; | - | ||||||||||||||||||||||||
| 177 | - | |||||||||||||||||||||||||
| 178 | pmeth = calloc(1, sizeof(EVP_PKEY_METHOD)); | - | ||||||||||||||||||||||||
| 179 | if (!pmeth
| 0 | ||||||||||||||||||||||||
| 180 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 181 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 182 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 183 | - | |||||||||||||||||||||||||
| 184 | pmeth->pkey_id = id; | - | ||||||||||||||||||||||||
| 185 | pmeth->flags = flags | 1; | - | ||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||
| 187 | pmeth->init = 0; | - | ||||||||||||||||||||||||
| 188 | pmeth->copy = 0; | - | ||||||||||||||||||||||||
| 189 | pmeth->cleanup = 0; | - | ||||||||||||||||||||||||
| 190 | pmeth->paramgen_init = 0; | - | ||||||||||||||||||||||||
| 191 | pmeth->paramgen = 0; | - | ||||||||||||||||||||||||
| 192 | pmeth->keygen_init = 0; | - | ||||||||||||||||||||||||
| 193 | pmeth->keygen = 0; | - | ||||||||||||||||||||||||
| 194 | pmeth->sign_init = 0; | - | ||||||||||||||||||||||||
| 195 | pmeth->sign = 0; | - | ||||||||||||||||||||||||
| 196 | pmeth->verify_init = 0; | - | ||||||||||||||||||||||||
| 197 | pmeth->verify = 0; | - | ||||||||||||||||||||||||
| 198 | pmeth->verify_recover_init = 0; | - | ||||||||||||||||||||||||
| 199 | pmeth->verify_recover = 0; | - | ||||||||||||||||||||||||
| 200 | pmeth->signctx_init = 0; | - | ||||||||||||||||||||||||
| 201 | pmeth->signctx = 0; | - | ||||||||||||||||||||||||
| 202 | pmeth->verifyctx_init = 0; | - | ||||||||||||||||||||||||
| 203 | pmeth->verifyctx = 0; | - | ||||||||||||||||||||||||
| 204 | pmeth->encrypt_init = 0; | - | ||||||||||||||||||||||||
| 205 | pmeth->encrypt = 0; | - | ||||||||||||||||||||||||
| 206 | pmeth->decrypt_init = 0; | - | ||||||||||||||||||||||||
| 207 | pmeth->decrypt = 0; | - | ||||||||||||||||||||||||
| 208 | pmeth->derive_init = 0; | - | ||||||||||||||||||||||||
| 209 | pmeth->derive = 0; | - | ||||||||||||||||||||||||
| 210 | pmeth->ctrl = 0; | - | ||||||||||||||||||||||||
| 211 | pmeth->ctrl_str = 0; | - | ||||||||||||||||||||||||
| 212 | - | |||||||||||||||||||||||||
| 213 | return never executed: pmeth;return pmeth;never executed: return pmeth; | 0 | ||||||||||||||||||||||||
| 214 | } | - | ||||||||||||||||||||||||
| 215 | - | |||||||||||||||||||||||||
| 216 | void | - | ||||||||||||||||||||||||
| 217 | EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags, const EVP_PKEY_METHOD *meth) | - | ||||||||||||||||||||||||
| 218 | { | - | ||||||||||||||||||||||||
| 219 | if (ppkey_id
| 0 | ||||||||||||||||||||||||
| 220 | * never executed: ppkey_id = meth->pkey_id;*ppkey_id = meth->pkey_id;never executed: *ppkey_id = meth->pkey_id; | 0 | ||||||||||||||||||||||||
| 221 | if (pflags
| 0 | ||||||||||||||||||||||||
| 222 | * never executed: pflags = meth->flags;*pflags = meth->flags;never executed: *pflags = meth->flags; | 0 | ||||||||||||||||||||||||
| 223 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||
| 225 | void | - | ||||||||||||||||||||||||
| 226 | EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src) | - | ||||||||||||||||||||||||
| 227 | { | - | ||||||||||||||||||||||||
| 228 | dst->init = src->init; | - | ||||||||||||||||||||||||
| 229 | dst->copy = src->copy; | - | ||||||||||||||||||||||||
| 230 | dst->cleanup = src->cleanup; | - | ||||||||||||||||||||||||
| 231 | - | |||||||||||||||||||||||||
| 232 | dst->paramgen_init = src->paramgen_init; | - | ||||||||||||||||||||||||
| 233 | dst->paramgen = src->paramgen; | - | ||||||||||||||||||||||||
| 234 | - | |||||||||||||||||||||||||
| 235 | dst->keygen_init = src->keygen_init; | - | ||||||||||||||||||||||||
| 236 | dst->keygen = src->keygen; | - | ||||||||||||||||||||||||
| 237 | - | |||||||||||||||||||||||||
| 238 | dst->sign_init = src->sign_init; | - | ||||||||||||||||||||||||
| 239 | dst->sign = src->sign; | - | ||||||||||||||||||||||||
| 240 | - | |||||||||||||||||||||||||
| 241 | dst->verify_init = src->verify_init; | - | ||||||||||||||||||||||||
| 242 | dst->verify = src->verify; | - | ||||||||||||||||||||||||
| 243 | - | |||||||||||||||||||||||||
| 244 | dst->verify_recover_init = src->verify_recover_init; | - | ||||||||||||||||||||||||
| 245 | dst->verify_recover = src->verify_recover; | - | ||||||||||||||||||||||||
| 246 | - | |||||||||||||||||||||||||
| 247 | dst->signctx_init = src->signctx_init; | - | ||||||||||||||||||||||||
| 248 | dst->signctx = src->signctx; | - | ||||||||||||||||||||||||
| 249 | - | |||||||||||||||||||||||||
| 250 | dst->verifyctx_init = src->verifyctx_init; | - | ||||||||||||||||||||||||
| 251 | dst->verifyctx = src->verifyctx; | - | ||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||
| 253 | dst->encrypt_init = src->encrypt_init; | - | ||||||||||||||||||||||||
| 254 | dst->encrypt = src->encrypt; | - | ||||||||||||||||||||||||
| 255 | - | |||||||||||||||||||||||||
| 256 | dst->decrypt_init = src->decrypt_init; | - | ||||||||||||||||||||||||
| 257 | dst->decrypt = src->decrypt; | - | ||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||
| 259 | dst->derive_init = src->derive_init; | - | ||||||||||||||||||||||||
| 260 | dst->derive = src->derive; | - | ||||||||||||||||||||||||
| 261 | - | |||||||||||||||||||||||||
| 262 | dst->ctrl = src->ctrl; | - | ||||||||||||||||||||||||
| 263 | dst->ctrl_str = src->ctrl_str; | - | ||||||||||||||||||||||||
| 264 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||
| 266 | void | - | ||||||||||||||||||||||||
| 267 | EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth) | - | ||||||||||||||||||||||||
| 268 | { | - | ||||||||||||||||||||||||
| 269 | if (pmeth
| 0-1 | ||||||||||||||||||||||||
| 270 | free(pmeth); never executed: free(pmeth); | 0 | ||||||||||||||||||||||||
| 271 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 272 | - | |||||||||||||||||||||||||
| 273 | EVP_PKEY_CTX * | - | ||||||||||||||||||||||||
| 274 | EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e) | - | ||||||||||||||||||||||||
| 275 | { | - | ||||||||||||||||||||||||
| 276 | return executed 1965 times by 7 tests: int_ctx_new(pkey, e, -1);return int_ctx_new(pkey, e, -1);Executed by:
executed 1965 times by 7 tests: return int_ctx_new(pkey, e, -1);Executed by:
| 1965 | ||||||||||||||||||||||||
| 277 | } | - | ||||||||||||||||||||||||
| 278 | - | |||||||||||||||||||||||||
| 279 | EVP_PKEY_CTX * | - | ||||||||||||||||||||||||
| 280 | EVP_PKEY_CTX_new_id(int id, ENGINE *e) | - | ||||||||||||||||||||||||
| 281 | { | - | ||||||||||||||||||||||||
| 282 | return executed 1812 times by 4 tests: int_ctx_new(return int_ctx_new( ((void *)0) , e, id);Executed by:
executed 1812 times by 4 tests: return int_ctx_new( ((void *)0) , e, id);Executed by:
| 1812 | ||||||||||||||||||||||||
| 283 | ((void *)0) executed 1812 times by 4 tests: return int_ctx_new( ((void *)0) , e, id);Executed by:
| 1812 | ||||||||||||||||||||||||
| 284 | , e, id); executed 1812 times by 4 tests: return int_ctx_new( ((void *)0) , e, id);Executed by:
| 1812 | ||||||||||||||||||||||||
| 285 | } | - | ||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||
| 287 | EVP_PKEY_CTX * | - | ||||||||||||||||||||||||
| 288 | EVP_PKEY_CTX_dup(EVP_PKEY_CTX *pctx) | - | ||||||||||||||||||||||||
| 289 | { | - | ||||||||||||||||||||||||
| 290 | EVP_PKEY_CTX *rctx; | - | ||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||
| 292 | if (!pctx->pmeth
| 0-9480 | ||||||||||||||||||||||||
| 293 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 294 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 295 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||
| 298 | if (pctx->engine
| 0-9480 | ||||||||||||||||||||||||
| 299 | ERR_put_error(6,(0xfff),(38),__FILE__,338); | - | ||||||||||||||||||||||||
| 300 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 301 | } | - | ||||||||||||||||||||||||
| 302 | - | |||||||||||||||||||||||||
| 303 | rctx = malloc(sizeof(EVP_PKEY_CTX)); | - | ||||||||||||||||||||||||
| 304 | if (!rctx
| 0-9480 | ||||||||||||||||||||||||
| 305 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 306 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 307 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||
| 309 | rctx->pmeth = pctx->pmeth; | - | ||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||
| 311 | rctx->engine = pctx->engine; | - | ||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||
| 314 | if (pctx->pkey
| 0-9480 | ||||||||||||||||||||||||
| 315 | CRYPTO_add_lock(&pctx->pkey->references,1,10,__FILE__,352); executed 9480 times by 6 tests: CRYPTO_add_lock(&pctx->pkey->references,1,10,__FILE__,352);Executed by:
| 9480 | ||||||||||||||||||||||||
| 316 | - | |||||||||||||||||||||||||
| 317 | rctx->pkey = pctx->pkey; | - | ||||||||||||||||||||||||
| 318 | - | |||||||||||||||||||||||||
| 319 | if (pctx->peerkey
| 0-9480 | ||||||||||||||||||||||||
| 320 | CRYPTO_add_lock(&pctx->peerkey->references,1,10,__FILE__,357); never executed: CRYPTO_add_lock(&pctx->peerkey->references,1,10,__FILE__,357); | 0 | ||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 | rctx->peerkey = pctx->peerkey; | - | ||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||
| 324 | rctx->data = | - | ||||||||||||||||||||||||
| 325 | ((void *)0) | - | ||||||||||||||||||||||||
| 326 | ; | - | ||||||||||||||||||||||||
| 327 | rctx->app_data = | - | ||||||||||||||||||||||||
| 328 | ((void *)0) | - | ||||||||||||||||||||||||
| 329 | ; | - | ||||||||||||||||||||||||
| 330 | rctx->operation = pctx->operation; | - | ||||||||||||||||||||||||
| 331 | - | |||||||||||||||||||||||||
| 332 | if (pctx->pmeth->copy(rctx, pctx) > 0
| 0-9480 | ||||||||||||||||||||||||
| 333 | return executed 9480 times by 6 tests: rctx;return rctx;Executed by:
executed 9480 times by 6 tests: return rctx;Executed by:
| 9480 | ||||||||||||||||||||||||
| 334 | - | |||||||||||||||||||||||||
| 335 | EVP_PKEY_CTX_free(rctx); | - | ||||||||||||||||||||||||
| 336 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 337 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 338 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 339 | } | - | ||||||||||||||||||||||||
| 340 | - | |||||||||||||||||||||||||
| 341 | int | - | ||||||||||||||||||||||||
| 342 | EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth) | - | ||||||||||||||||||||||||
| 343 | { | - | ||||||||||||||||||||||||
| 344 | if (app_pkey_methods ==
| 0 | ||||||||||||||||||||||||
| 345 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 346 | ) { | - | ||||||||||||||||||||||||
| 347 | app_pkey_methods = ((struct stack_st_EVP_PKEY_METHOD *)sk_new(((int (*)(const void *, const void *)) ((1 ? (pmeth_cmp) : (int (*)(const EVP_PKEY_METHOD * const *, const EVP_PKEY_METHOD * const *))0))))); | - | ||||||||||||||||||||||||
| 348 | if (!app_pkey_methods
| 0 | ||||||||||||||||||||||||
| 349 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 350 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 351 | if (!sk_push(((_STACK*) (1 ? (app_pkey_methods) : (struct stack_st_EVP_PKEY_METHOD*)0)), ((void*) (1 ? (pmeth) : (EVP_PKEY_METHOD*)0)))
| 0 | ||||||||||||||||||||||||
| 352 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 353 | sk_sort(((_STACK*) (1 ? (app_pkey_methods) : (struct stack_st_EVP_PKEY_METHOD*)0))); | - | ||||||||||||||||||||||||
| 354 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||
| 355 | } | - | ||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||
| 357 | void | - | ||||||||||||||||||||||||
| 358 | EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
| 359 | { | - | ||||||||||||||||||||||||
| 360 | if (ctx ==
| 13257-415338 | ||||||||||||||||||||||||
| 361 | ((void *)0)
| 13257-415338 | ||||||||||||||||||||||||
| 362 | ) | - | ||||||||||||||||||||||||
| 363 | return; executed 415338 times by 22 tests: return;Executed by:
| 415338 | ||||||||||||||||||||||||
| 364 | if (ctx->pmeth
| 0-13257 | ||||||||||||||||||||||||
| 365 | ctx->pmeth->cleanup(ctx); executed 13257 times by 7 tests: ctx->pmeth->cleanup(ctx);Executed by:
| 13257 | ||||||||||||||||||||||||
| 366 | EVP_PKEY_free(ctx->pkey); | - | ||||||||||||||||||||||||
| 367 | EVP_PKEY_free(ctx->peerkey); | - | ||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||
| 369 | ENGINE_finish(ctx->engine); | - | ||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||
| 371 | free(ctx); | - | ||||||||||||||||||||||||
| 372 | } executed 13257 times by 7 tests: end of blockExecuted by:
| 13257 | ||||||||||||||||||||||||
| 373 | - | |||||||||||||||||||||||||
| 374 | int | - | ||||||||||||||||||||||||
| 375 | EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, | - | ||||||||||||||||||||||||
| 376 | int p1, void *p2) | - | ||||||||||||||||||||||||
| 377 | { | - | ||||||||||||||||||||||||
| 378 | int ret; | - | ||||||||||||||||||||||||
| 379 | - | |||||||||||||||||||||||||
| 380 | if (!ctx
| 0-19653 | ||||||||||||||||||||||||
| 381 | ERR_put_error(6,(0xfff),(147),__FILE__,408); | - | ||||||||||||||||||||||||
| 382 | return never executed: -2;return -2;never executed: return -2; | 0 | ||||||||||||||||||||||||
| 383 | } | - | ||||||||||||||||||||||||
| 384 | if ((
| 0-19652 | ||||||||||||||||||||||||
| 385 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 386 | - | |||||||||||||||||||||||||
| 387 | if (ctx->operation == 0
| 0-19653 | ||||||||||||||||||||||||
| 388 | ERR_put_error(6,(0xfff),(149),__FILE__,415); | - | ||||||||||||||||||||||||
| 389 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 390 | } | - | ||||||||||||||||||||||||
| 391 | - | |||||||||||||||||||||||||
| 392 | if ((
| 0-19652 | ||||||||||||||||||||||||
| 393 | ERR_put_error(6,(0xfff),(148),__FILE__,420); | - | ||||||||||||||||||||||||
| 394 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 395 | } | - | ||||||||||||||||||||||||
| 396 | - | |||||||||||||||||||||||||
| 397 | ret = ctx->pmeth->ctrl(ctx, cmd, p1, p2); | - | ||||||||||||||||||||||||
| 398 | - | |||||||||||||||||||||||||
| 399 | if (ret == -2
| 0-19653 | ||||||||||||||||||||||||
| 400 | ERR_put_error(6,(0xfff),(147),__FILE__,427); never executed: ERR_put_error(6,(0xfff),(147),__FILE__,427); | 0 | ||||||||||||||||||||||||
| 401 | - | |||||||||||||||||||||||||
| 402 | return executed 19653 times by 7 tests: ret;return ret;Executed by:
executed 19653 times by 7 tests: return ret;Executed by:
| 19653 | ||||||||||||||||||||||||
| 403 | - | |||||||||||||||||||||||||
| 404 | } | - | ||||||||||||||||||||||||
| 405 | - | |||||||||||||||||||||||||
| 406 | int | - | ||||||||||||||||||||||||
| 407 | EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *name, const char *value) | - | ||||||||||||||||||||||||
| 408 | { | - | ||||||||||||||||||||||||
| 409 | if (!ctx
| 0 | ||||||||||||||||||||||||
| 410 | ERR_put_error(6,(0xfff),(147),__FILE__,437); | - | ||||||||||||||||||||||||
| 411 | return never executed: -2;return -2;never executed: return -2; | 0 | ||||||||||||||||||||||||
| 412 | } | - | ||||||||||||||||||||||||
| 413 | if (!
| 0 | ||||||||||||||||||||||||
| 414 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||
| 415 | name
| 0 | ||||||||||||||||||||||||
| 416 | ) && __builtin_constant_p (
| 0 | ||||||||||||||||||||||||
| 417 | "digest"
| 0 | ||||||||||||||||||||||||
| 418 | ) && (__s1_len = __builtin_strlen (
| 0 | ||||||||||||||||||||||||
| 419 | name
| 0 | ||||||||||||||||||||||||
| 420 | ), __s2_len = __builtin_strlen (
| 0 | ||||||||||||||||||||||||
| 421 | "digest"
| 0 | ||||||||||||||||||||||||
| 422 | ), (!((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||
| 423 | name
| 0 | ||||||||||||||||||||||||
| 424 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||
| 425 | name
| 0 | ||||||||||||||||||||||||
| 426 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||
| 427 | "digest"
| 0 | ||||||||||||||||||||||||
| 428 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||
| 429 | "digest"
| 0 | ||||||||||||||||||||||||
| 430 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 0 | ||||||||||||||||||||||||
| 431 | name
| 0 | ||||||||||||||||||||||||
| 432 | ,
| 0 | ||||||||||||||||||||||||
| 433 | "digest"
| 0 | ||||||||||||||||||||||||
| 434 | ) : (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||
| 435 | name
| 0 | ||||||||||||||||||||||||
| 436 | ) && ((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||
| 437 | name
| 0 | ||||||||||||||||||||||||
| 438 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||
| 439 | name
| 0 | ||||||||||||||||||||||||
| 440 | ) == 1) && (__s1_len = __builtin_strlen (
| 0 | ||||||||||||||||||||||||
| 441 | name
| 0 | ||||||||||||||||||||||||
| 442 | ), __s1_len < 4) ? (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||
| 443 | "digest"
| 0 | ||||||||||||||||||||||||
| 444 | ) && ((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||
| 445 | "digest"
| 0 | ||||||||||||||||||||||||
| 446 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||
| 447 | "digest"
| 0 | ||||||||||||||||||||||||
| 448 | ) == 1) ? __builtin_strcmp (
| 0 | ||||||||||||||||||||||||
| 449 | name
| 0 | ||||||||||||||||||||||||
| 450 | ,
| 0 | ||||||||||||||||||||||||
| 451 | "digest"
| 0 | ||||||||||||||||||||||||
| 452 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0 | ||||||||||||||||||||||||
| 453 | "digest"
| 0 | ||||||||||||||||||||||||
| 454 | ); int __result = (((const unsigned char *) (const char *) (
| 0 | ||||||||||||||||||||||||
| 455 | name
| 0 | ||||||||||||||||||||||||
| 456 | ))[0] - __s2[0]); if (__s1_len > 0
| 0 | ||||||||||||||||||||||||
| 457 | name
| 0 | ||||||||||||||||||||||||
| 458 | ))[1] - __s2[1]); if (__s1_len > 1
| 0 | ||||||||||||||||||||||||
| 459 | name
| 0 | ||||||||||||||||||||||||
| 460 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||
| 461 | name
never executed: __result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||
| 462 | ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||
| 463 | "digest"
| 0 | ||||||||||||||||||||||||
| 464 | ) && ((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||
| 465 | "digest"
| 0 | ||||||||||||||||||||||||
| 466 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||
| 467 | "digest"
| 0 | ||||||||||||||||||||||||
| 468 | ) == 1) && (__s2_len = __builtin_strlen (
| 0 | ||||||||||||||||||||||||
| 469 | "digest"
| 0 | ||||||||||||||||||||||||
| 470 | ), __s2_len < 4) ? (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||
| 471 | name
| 0 | ||||||||||||||||||||||||
| 472 | ) && ((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||
| 473 | name
| 0 | ||||||||||||||||||||||||
| 474 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||
| 475 | name
| 0 | ||||||||||||||||||||||||
| 476 | ) == 1) ? __builtin_strcmp (
| 0 | ||||||||||||||||||||||||
| 477 | name
| 0 | ||||||||||||||||||||||||
| 478 | ,
| 0 | ||||||||||||||||||||||||
| 479 | "digest"
| 0 | ||||||||||||||||||||||||
| 480 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0 | ||||||||||||||||||||||||
| 481 | name
| 0 | ||||||||||||||||||||||||
| 482 | ); int __result = (((const unsigned char *) (const char *) (
| 0 | ||||||||||||||||||||||||
| 483 | "digest"
| 0 | ||||||||||||||||||||||||
| 484 | ))[0] - __s2[0]); if (__s2_len > 0
| 0 | ||||||||||||||||||||||||
| 485 | "digest"
| 0 | ||||||||||||||||||||||||
| 486 | ))[1] - __s2[1]); if (__s2_len > 1
| 0 | ||||||||||||||||||||||||
| 487 | "digest"
| 0 | ||||||||||||||||||||||||
| 488 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( "digest" ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||
| 489 | "digest"
never executed: __result = (((const unsigned char *) (const char *) ( "digest" ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||
| 490 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (
| 0 | ||||||||||||||||||||||||
| 491 | name
| 0 | ||||||||||||||||||||||||
| 492 | ,
| 0 | ||||||||||||||||||||||||
| 493 | "digest"
| 0 | ||||||||||||||||||||||||
| 494 | )))); })
| 0 | ||||||||||||||||||||||||
| 495 | ) { | - | ||||||||||||||||||||||||
| 496 | const EVP_MD *md; | - | ||||||||||||||||||||||||
| 497 | if (!value
| 0 | ||||||||||||||||||||||||
| 498 | ERR_put_error(6,(0xfff),(152),__FILE__,443); | - | ||||||||||||||||||||||||
| 499 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 500 | } | - | ||||||||||||||||||||||||
| 501 | return never executed: EVP_PKEY_CTX_ctrl(ctx, -1, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)), 1, 0, (void *)md);return EVP_PKEY_CTX_ctrl(ctx, -1, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)), 1, 0, (void *)md);never executed: return EVP_PKEY_CTX_ctrl(ctx, -1, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)), 1, 0, (void *)md); | 0 | ||||||||||||||||||||||||
| 502 | } | - | ||||||||||||||||||||||||
| 503 | return never executed: ctx->pmeth->ctrl_str(ctx, name, value);return ctx->pmeth->ctrl_str(ctx, name, value);never executed: return ctx->pmeth->ctrl_str(ctx, name, value); | 0 | ||||||||||||||||||||||||
| 504 | } | - | ||||||||||||||||||||||||
| 505 | - | |||||||||||||||||||||||||
| 506 | int | - | ||||||||||||||||||||||||
| 507 | EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
| 508 | { | - | ||||||||||||||||||||||||
| 509 | return never executed: ctx->operation;return ctx->operation;never executed: return ctx->operation; | 0 | ||||||||||||||||||||||||
| 510 | } | - | ||||||||||||||||||||||||
| 511 | - | |||||||||||||||||||||||||
| 512 | void | - | ||||||||||||||||||||||||
| 513 | EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen) | - | ||||||||||||||||||||||||
| 514 | { | - | ||||||||||||||||||||||||
| 515 | ctx->keygen_info = dat; | - | ||||||||||||||||||||||||
| 516 | ctx->keygen_info_count = datlen; | - | ||||||||||||||||||||||||
| 517 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 518 | - | |||||||||||||||||||||||||
| 519 | void | - | ||||||||||||||||||||||||
| 520 | EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data) | - | ||||||||||||||||||||||||
| 521 | { | - | ||||||||||||||||||||||||
| 522 | ctx->data = data; | - | ||||||||||||||||||||||||
| 523 | } executed 24 times by 1 test: end of blockExecuted by:
| 24 | ||||||||||||||||||||||||
| 524 | - | |||||||||||||||||||||||||
| 525 | void * | - | ||||||||||||||||||||||||
| 526 | EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
| 527 | { | - | ||||||||||||||||||||||||
| 528 | return executed 72 times by 1 test: ctx->data;return ctx->data;Executed by:
executed 72 times by 1 test: return ctx->data;Executed by:
| 72 | ||||||||||||||||||||||||
| 529 | } | - | ||||||||||||||||||||||||
| 530 | - | |||||||||||||||||||||||||
| 531 | EVP_PKEY * | - | ||||||||||||||||||||||||
| 532 | EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
| 533 | { | - | ||||||||||||||||||||||||
| 534 | return executed 10 times by 2 tests: ctx->pkey;return ctx->pkey;Executed by:
executed 10 times by 2 tests: return ctx->pkey;Executed by:
| 10 | ||||||||||||||||||||||||
| 535 | } | - | ||||||||||||||||||||||||
| 536 | - | |||||||||||||||||||||||||
| 537 | EVP_PKEY * | - | ||||||||||||||||||||||||
| 538 | EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
| 539 | { | - | ||||||||||||||||||||||||
| 540 | return never executed: ctx->peerkey;return ctx->peerkey;never executed: return ctx->peerkey; | 0 | ||||||||||||||||||||||||
| 541 | } | - | ||||||||||||||||||||||||
| 542 | - | |||||||||||||||||||||||||
| 543 | void | - | ||||||||||||||||||||||||
| 544 | EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data) | - | ||||||||||||||||||||||||
| 545 | { | - | ||||||||||||||||||||||||
| 546 | ctx->app_data = data; | - | ||||||||||||||||||||||||
| 547 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 548 | - | |||||||||||||||||||||||||
| 549 | void * | - | ||||||||||||||||||||||||
| 550 | EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
| 551 | { | - | ||||||||||||||||||||||||
| 552 | return never executed: ctx->app_data;return ctx->app_data;never executed: return ctx->app_data; | 0 | ||||||||||||||||||||||||
| 553 | } | - | ||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||
| 555 | void | - | ||||||||||||||||||||||||
| 556 | EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 557 | int (*init)(EVP_PKEY_CTX *ctx)) | - | ||||||||||||||||||||||||
| 558 | { | - | ||||||||||||||||||||||||
| 559 | pmeth->init = init; | - | ||||||||||||||||||||||||
| 560 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 561 | - | |||||||||||||||||||||||||
| 562 | void | - | ||||||||||||||||||||||||
| 563 | EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 564 | int (*copy)(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)) | - | ||||||||||||||||||||||||
| 565 | { | - | ||||||||||||||||||||||||
| 566 | pmeth->copy = copy; | - | ||||||||||||||||||||||||
| 567 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 568 | - | |||||||||||||||||||||||||
| 569 | void | - | ||||||||||||||||||||||||
| 570 | EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 571 | void (*cleanup)(EVP_PKEY_CTX *ctx)) | - | ||||||||||||||||||||||||
| 572 | { | - | ||||||||||||||||||||||||
| 573 | pmeth->cleanup = cleanup; | - | ||||||||||||||||||||||||
| 574 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 575 | - | |||||||||||||||||||||||||
| 576 | void | - | ||||||||||||||||||||||||
| 577 | EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 578 | int (*paramgen_init)(EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
| 579 | int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
| 580 | { | - | ||||||||||||||||||||||||
| 581 | pmeth->paramgen_init = paramgen_init; | - | ||||||||||||||||||||||||
| 582 | pmeth->paramgen = paramgen; | - | ||||||||||||||||||||||||
| 583 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 584 | - | |||||||||||||||||||||||||
| 585 | void | - | ||||||||||||||||||||||||
| 586 | EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 587 | int (*keygen_init)(EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
| 588 | int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
| 589 | { | - | ||||||||||||||||||||||||
| 590 | pmeth->keygen_init = keygen_init; | - | ||||||||||||||||||||||||
| 591 | pmeth->keygen = keygen; | - | ||||||||||||||||||||||||
| 592 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 593 | - | |||||||||||||||||||||||||
| 594 | void | - | ||||||||||||||||||||||||
| 595 | EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 596 | int (*sign_init)(EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
| 597 | int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, | - | ||||||||||||||||||||||||
| 598 | const unsigned char *tbs, size_t tbslen)) | - | ||||||||||||||||||||||||
| 599 | { | - | ||||||||||||||||||||||||
| 600 | pmeth->sign_init = sign_init; | - | ||||||||||||||||||||||||
| 601 | pmeth->sign = sign; | - | ||||||||||||||||||||||||
| 602 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 603 | - | |||||||||||||||||||||||||
| 604 | void | - | ||||||||||||||||||||||||
| 605 | EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 606 | int (*verify_init)(EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
| 607 | int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen, | - | ||||||||||||||||||||||||
| 608 | const unsigned char *tbs, size_t tbslen)) | - | ||||||||||||||||||||||||
| 609 | { | - | ||||||||||||||||||||||||
| 610 | pmeth->verify_init = verify_init; | - | ||||||||||||||||||||||||
| 611 | pmeth->verify = verify; | - | ||||||||||||||||||||||||
| 612 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 613 | - | |||||||||||||||||||||||||
| 614 | void | - | ||||||||||||||||||||||||
| 615 | EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 616 | int (*verify_recover_init)(EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
| 617 | int (*verify_recover)(EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
| 618 | unsigned char *sig, size_t *siglen, | - | ||||||||||||||||||||||||
| 619 | const unsigned char *tbs, size_t tbslen)) | - | ||||||||||||||||||||||||
| 620 | { | - | ||||||||||||||||||||||||
| 621 | pmeth->verify_recover_init = verify_recover_init; | - | ||||||||||||||||||||||||
| 622 | pmeth->verify_recover = verify_recover; | - | ||||||||||||||||||||||||
| 623 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 624 | - | |||||||||||||||||||||||||
| 625 | void | - | ||||||||||||||||||||||||
| 626 | EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 627 | int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), | - | ||||||||||||||||||||||||
| 628 | int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, | - | ||||||||||||||||||||||||
| 629 | EVP_MD_CTX *mctx)) | - | ||||||||||||||||||||||||
| 630 | { | - | ||||||||||||||||||||||||
| 631 | pmeth->signctx_init = signctx_init; | - | ||||||||||||||||||||||||
| 632 | pmeth->signctx = signctx; | - | ||||||||||||||||||||||||
| 633 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||
| 635 | void | - | ||||||||||||||||||||||||
| 636 | EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 637 | int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), | - | ||||||||||||||||||||||||
| 638 | int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen, | - | ||||||||||||||||||||||||
| 639 | EVP_MD_CTX *mctx)) | - | ||||||||||||||||||||||||
| 640 | { | - | ||||||||||||||||||||||||
| 641 | pmeth->verifyctx_init = verifyctx_init; | - | ||||||||||||||||||||||||
| 642 | pmeth->verifyctx = verifyctx; | - | ||||||||||||||||||||||||
| 643 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 644 | - | |||||||||||||||||||||||||
| 645 | void | - | ||||||||||||||||||||||||
| 646 | EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 647 | int (*encrypt_init)(EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
| 648 | int (*encryptfn)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, | - | ||||||||||||||||||||||||
| 649 | const unsigned char *in, size_t inlen)) | - | ||||||||||||||||||||||||
| 650 | { | - | ||||||||||||||||||||||||
| 651 | pmeth->encrypt_init = encrypt_init; | - | ||||||||||||||||||||||||
| 652 | pmeth->encrypt = encryptfn; | - | ||||||||||||||||||||||||
| 653 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 654 | - | |||||||||||||||||||||||||
| 655 | void | - | ||||||||||||||||||||||||
| 656 | EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 657 | int (*decrypt_init)(EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
| 658 | int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, | - | ||||||||||||||||||||||||
| 659 | const unsigned char *in, size_t inlen)) | - | ||||||||||||||||||||||||
| 660 | { | - | ||||||||||||||||||||||||
| 661 | pmeth->decrypt_init = decrypt_init; | - | ||||||||||||||||||||||||
| 662 | pmeth->decrypt = decrypt; | - | ||||||||||||||||||||||||
| 663 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 664 | - | |||||||||||||||||||||||||
| 665 | void | - | ||||||||||||||||||||||||
| 666 | EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 667 | int (*derive_init)(EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
| 668 | int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)) | - | ||||||||||||||||||||||||
| 669 | { | - | ||||||||||||||||||||||||
| 670 | pmeth->derive_init = derive_init; | - | ||||||||||||||||||||||||
| 671 | pmeth->derive = derive; | - | ||||||||||||||||||||||||
| 672 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 673 | - | |||||||||||||||||||||||||
| 674 | void | - | ||||||||||||||||||||||||
| 675 | EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
| 676 | int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2), | - | ||||||||||||||||||||||||
| 677 | int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value)) | - | ||||||||||||||||||||||||
| 678 | { | - | ||||||||||||||||||||||||
| 679 | pmeth->ctrl = ctrl; | - | ||||||||||||||||||||||||
| 680 | pmeth->ctrl_str = ctrl_str; | - | ||||||||||||||||||||||||
| 681 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |