Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/pmeth_lib.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | typedef int sk_cmp_fn_type(const char *const *a, const char *const *b); | - | ||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | static struct stack_st_EVP_PKEY_METHOD *app_pkey_methods = | - | ||||||||||||||||||||||||
6 | ((void *)0) | - | ||||||||||||||||||||||||
7 | ; | - | ||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||
10 | static const EVP_PKEY_METHOD *standard_methods[] = { | - | ||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||
12 | &rsa_pkey_meth, | - | ||||||||||||||||||||||||
13 | - | |||||||||||||||||||||||||
14 | - | |||||||||||||||||||||||||
15 | &dh_pkey_meth, | - | ||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||
17 | - | |||||||||||||||||||||||||
18 | &dsa_pkey_meth, | - | ||||||||||||||||||||||||
19 | - | |||||||||||||||||||||||||
20 | - | |||||||||||||||||||||||||
21 | &ec_pkey_meth, | - | ||||||||||||||||||||||||
22 | - | |||||||||||||||||||||||||
23 | &hmac_pkey_meth, | - | ||||||||||||||||||||||||
24 | - | |||||||||||||||||||||||||
25 | &cmac_pkey_meth, | - | ||||||||||||||||||||||||
26 | - | |||||||||||||||||||||||||
27 | - | |||||||||||||||||||||||||
28 | &rsa_pss_pkey_meth, | - | ||||||||||||||||||||||||
29 | - | |||||||||||||||||||||||||
30 | - | |||||||||||||||||||||||||
31 | &dhx_pkey_meth, | - | ||||||||||||||||||||||||
32 | - | |||||||||||||||||||||||||
33 | - | |||||||||||||||||||||||||
34 | &scrypt_pkey_meth, | - | ||||||||||||||||||||||||
35 | - | |||||||||||||||||||||||||
36 | &tls1_prf_pkey_meth, | - | ||||||||||||||||||||||||
37 | - | |||||||||||||||||||||||||
38 | &ecx25519_pkey_meth, | - | ||||||||||||||||||||||||
39 | &ecx448_pkey_meth, | - | ||||||||||||||||||||||||
40 | - | |||||||||||||||||||||||||
41 | &hkdf_pkey_meth, | - | ||||||||||||||||||||||||
42 | - | |||||||||||||||||||||||||
43 | &poly1305_pkey_meth, | - | ||||||||||||||||||||||||
44 | - | |||||||||||||||||||||||||
45 | - | |||||||||||||||||||||||||
46 | &siphash_pkey_meth, | - | ||||||||||||||||||||||||
47 | - | |||||||||||||||||||||||||
48 | - | |||||||||||||||||||||||||
49 | &ed25519_pkey_meth, | - | ||||||||||||||||||||||||
50 | &ed448_pkey_meth, | - | ||||||||||||||||||||||||
51 | - | |||||||||||||||||||||||||
52 | - | |||||||||||||||||||||||||
53 | &sm2_pkey_meth, | - | ||||||||||||||||||||||||
54 | - | |||||||||||||||||||||||||
55 | }; | - | ||||||||||||||||||||||||
56 | - | |||||||||||||||||||||||||
57 | static int pmeth_cmp_BSEARCH_CMP_FN(const void *, const void *); static int pmeth_cmp(const EVP_PKEY_METHOD * const *, const EVP_PKEY_METHOD * const *); static const EVP_PKEY_METHOD * * OBJ_bsearch_pmeth(const EVP_PKEY_METHOD * *key, const EVP_PKEY_METHOD * const *base, int num) | - | ||||||||||||||||||||||||
58 | ; | - | ||||||||||||||||||||||||
59 | - | |||||||||||||||||||||||||
60 | static int pmeth_cmp(const EVP_PKEY_METHOD *const *a, | - | ||||||||||||||||||||||||
61 | const EVP_PKEY_METHOD *const *b) | - | ||||||||||||||||||||||||
62 | { | - | ||||||||||||||||||||||||
63 | return executed 236446 times by 1 test: ((*a)->pkey_id - (*b)->pkey_id);return ((*a)->pkey_id - (*b)->pkey_id); Executed by:
executed 236446 times by 1 test: return ((*a)->pkey_id - (*b)->pkey_id); Executed by:
| 236446 | ||||||||||||||||||||||||
64 | } | - | ||||||||||||||||||||||||
65 | - | |||||||||||||||||||||||||
66 | static int pmeth_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) { const EVP_PKEY_METHOD * const *a = a_; const EVP_PKEY_METHOD * const *b = b_; return executed 236428 times by 1 test: pmeth_cmp(a,b);return pmeth_cmp(a,b); Executed by:
executed 236428 times by 1 test: } static const EVP_PKEY_METHOD * *OBJ_bsearch_pmeth(const EVP_PKEY_METHOD * *key, const EVP_PKEY_METHOD * const *base, int num) { returnreturn pmeth_cmp(a,b); Executed by:
executed 82147 times by 1 test: (const EVP_PKEY_METHOD * *)OBJ_bsearch_(key, base, num, sizeof(const EVP_PKEY_METHOD *), pmeth_cmp_BSEARCH_CMP_FN);return (const EVP_PKEY_METHOD * *)OBJ_bsearch_(key, base, num, sizeof(const EVP_PKEY_METHOD *), pmeth_cmp_BSEARCH_CMP_FN); Executed by:
executed 82147 times by 1 test: } extern void dummy_prototype(void)return (const EVP_PKEY_METHOD * *)OBJ_bsearch_(key, base, num, sizeof(const EVP_PKEY_METHOD *), pmeth_cmp_BSEARCH_CMP_FN); Executed by:
| 82147-236428 | ||||||||||||||||||||||||
67 | ; | - | ||||||||||||||||||||||||
68 | - | |||||||||||||||||||||||||
69 | const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type) | - | ||||||||||||||||||||||||
70 | { | - | ||||||||||||||||||||||||
71 | EVP_PKEY_METHOD tmp; | - | ||||||||||||||||||||||||
72 | const EVP_PKEY_METHOD *t = &tmp, **ret; | - | ||||||||||||||||||||||||
73 | tmp.pkey_id = type; | - | ||||||||||||||||||||||||
74 | if (app_pkey_methods
| 18-82134 | ||||||||||||||||||||||||
75 | int idx; | - | ||||||||||||||||||||||||
76 | idx = sk_EVP_PKEY_METHOD_find(app_pkey_methods, &tmp); | - | ||||||||||||||||||||||||
77 | if (idx >= 0
| 5-13 | ||||||||||||||||||||||||
78 | return executed 5 times by 1 test: sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx);return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx); Executed by:
executed 5 times by 1 test: return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx); Executed by:
| 5 | ||||||||||||||||||||||||
79 | } executed 13 times by 1 test: end of block Executed by:
| 13 | ||||||||||||||||||||||||
80 | ret = OBJ_bsearch_pmeth(&t, standard_methods, | - | ||||||||||||||||||||||||
81 | sizeof(standard_methods) / | - | ||||||||||||||||||||||||
82 | sizeof(EVP_PKEY_METHOD *)); | - | ||||||||||||||||||||||||
83 | if (!ret
| 0-82147 | ||||||||||||||||||||||||
84 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
85 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
86 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
87 | return executed 82147 times by 1 test: *ret;return *ret; Executed by:
executed 82147 times by 1 test: return *ret; Executed by:
| 82147 | ||||||||||||||||||||||||
88 | } | - | ||||||||||||||||||||||||
89 | - | |||||||||||||||||||||||||
90 | static EVP_PKEY_CTX *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
| 32127-50029 | ||||||||||||||||||||||||
96 | if (pkey ==
| 0-32127 | ||||||||||||||||||||||||
97 | ((void *)0)
| 0-32127 | ||||||||||||||||||||||||
98 | ) | - | ||||||||||||||||||||||||
99 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
100 | id = pkey->type; | - | ||||||||||||||||||||||||
101 | } executed 32127 times by 1 test: end of block Executed by:
| 32127 | ||||||||||||||||||||||||
102 | - | |||||||||||||||||||||||||
103 | if (e ==
| 3-82153 | ||||||||||||||||||||||||
104 | ((void *)0)
| 3-82153 | ||||||||||||||||||||||||
105 | && pkey !=
| 32124-50029 | ||||||||||||||||||||||||
106 | ((void *)0)
| 32124-50029 | ||||||||||||||||||||||||
107 | ) | - | ||||||||||||||||||||||||
108 | e = pkey->pmeth_engine !=
executed 32124 times by 1 test: e = pkey->pmeth_engine != ((void *)0) ? pkey->pmeth_engine : pkey->engine; Executed by:
| 1-32124 | ||||||||||||||||||||||||
109 | ((void *)0)
executed 32124 times by 1 test: e = pkey->pmeth_engine != ((void *)0) ? pkey->pmeth_engine : pkey->engine; Executed by:
| 1-32124 | ||||||||||||||||||||||||
110 | ? pkey->pmeth_engine : pkey->engine; executed 32124 times by 1 test: e = pkey->pmeth_engine != ((void *)0) ? pkey->pmeth_engine : pkey->engine; Executed by:
| 32124 | ||||||||||||||||||||||||
111 | - | |||||||||||||||||||||||||
112 | if (e
| 4-82152 | ||||||||||||||||||||||||
113 | if (!ENGINE_init(e)
| 0-4 | ||||||||||||||||||||||||
114 | ERR_put_error(6,(157),(38),__FILE__,119); | - | ||||||||||||||||||||||||
115 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
116 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
117 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
118 | } | - | ||||||||||||||||||||||||
119 | } executed 4 times by 1 test: else {end of block Executed by:
| 4 | ||||||||||||||||||||||||
120 | e = ENGINE_get_pkey_meth_engine(id); | - | ||||||||||||||||||||||||
121 | } executed 82152 times by 1 test: end of block Executed by:
| 82152 | ||||||||||||||||||||||||
122 | - | |||||||||||||||||||||||||
123 | - | |||||||||||||||||||||||||
124 | - | |||||||||||||||||||||||||
125 | - | |||||||||||||||||||||||||
126 | - | |||||||||||||||||||||||||
127 | if (e
| 4-82152 | ||||||||||||||||||||||||
128 | pmeth = ENGINE_get_pkey_meth(e, id); executed 4 times by 1 test: pmeth = ENGINE_get_pkey_meth(e, id); Executed by:
| 4 | ||||||||||||||||||||||||
129 | else | - | ||||||||||||||||||||||||
130 | - | |||||||||||||||||||||||||
131 | pmeth = EVP_PKEY_meth_find(id); executed 82152 times by 1 test: pmeth = EVP_PKEY_meth_find(id); Executed by:
| 82152 | ||||||||||||||||||||||||
132 | - | |||||||||||||||||||||||||
133 | if (pmeth ==
| 1-82155 | ||||||||||||||||||||||||
134 | ((void *)0)
| 1-82155 | ||||||||||||||||||||||||
135 | ) { | - | ||||||||||||||||||||||||
136 | - | |||||||||||||||||||||||||
137 | ENGINE_finish(e); | - | ||||||||||||||||||||||||
138 | - | |||||||||||||||||||||||||
139 | ERR_put_error(6,(157),(156),__FILE__,140); | - | ||||||||||||||||||||||||
140 | return executed 1 time by 1 test: return ((void *)0) ; Executed by:
executed 1 time by 1 test: return ((void *)0) ; Executed by:
| 1 | ||||||||||||||||||||||||
141 | ((void *)0) executed 1 time by 1 test: return ((void *)0) ; Executed by:
| 1 | ||||||||||||||||||||||||
142 | ; executed 1 time by 1 test: return ((void *)0) ; Executed by:
| 1 | ||||||||||||||||||||||||
143 | } | - | ||||||||||||||||||||||||
144 | - | |||||||||||||||||||||||||
145 | ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 144); | - | ||||||||||||||||||||||||
146 | if (ret ==
| 0-82155 | ||||||||||||||||||||||||
147 | ((void *)0)
| 0-82155 | ||||||||||||||||||||||||
148 | ) { | - | ||||||||||||||||||||||||
149 | - | |||||||||||||||||||||||||
150 | ENGINE_finish(e); | - | ||||||||||||||||||||||||
151 | - | |||||||||||||||||||||||||
152 | ERR_put_error(6,(157),((1|64)),__FILE__,149); | - | ||||||||||||||||||||||||
153 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
154 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
155 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
156 | } | - | ||||||||||||||||||||||||
157 | ret->engine = e; | - | ||||||||||||||||||||||||
158 | ret->pmeth = pmeth; | - | ||||||||||||||||||||||||
159 | ret->operation = 0; | - | ||||||||||||||||||||||||
160 | ret->pkey = pkey; | - | ||||||||||||||||||||||||
161 | if (pkey !=
| 32126-50029 | ||||||||||||||||||||||||
162 | ((void *)0)
| 32126-50029 | ||||||||||||||||||||||||
163 | ) | - | ||||||||||||||||||||||||
164 | EVP_PKEY_up_ref(pkey); executed 32126 times by 1 test: EVP_PKEY_up_ref(pkey); Executed by:
| 32126 | ||||||||||||||||||||||||
165 | - | |||||||||||||||||||||||||
166 | if (pmeth->init
| 9263-72892 | ||||||||||||||||||||||||
167 | if (pmeth->init(ret) <= 0
| 0-72892 | ||||||||||||||||||||||||
168 | ret->pmeth = | - | ||||||||||||||||||||||||
169 | ((void *)0) | - | ||||||||||||||||||||||||
170 | ; | - | ||||||||||||||||||||||||
171 | EVP_PKEY_CTX_free(ret); | - | ||||||||||||||||||||||||
172 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
173 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
174 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
175 | } | - | ||||||||||||||||||||||||
176 | } executed 72892 times by 1 test: end of block Executed by:
| 72892 | ||||||||||||||||||||||||
177 | - | |||||||||||||||||||||||||
178 | return executed 82155 times by 1 test: ret;return ret; Executed by:
executed 82155 times by 1 test: return ret; Executed by:
| 82155 | ||||||||||||||||||||||||
179 | } | - | ||||||||||||||||||||||||
180 | - | |||||||||||||||||||||||||
181 | EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags) | - | ||||||||||||||||||||||||
182 | { | - | ||||||||||||||||||||||||
183 | EVP_PKEY_METHOD *pmeth; | - | ||||||||||||||||||||||||
184 | - | |||||||||||||||||||||||||
185 | pmeth = CRYPTO_zalloc(sizeof(*pmeth), __FILE__, 174); | - | ||||||||||||||||||||||||
186 | if (pmeth ==
| 0-2 | ||||||||||||||||||||||||
187 | ((void *)0)
| 0-2 | ||||||||||||||||||||||||
188 | ) { | - | ||||||||||||||||||||||||
189 | ERR_put_error(6,(195),((1|64)),__FILE__,176); | - | ||||||||||||||||||||||||
190 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
191 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
192 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
193 | } | - | ||||||||||||||||||||||||
194 | - | |||||||||||||||||||||||||
195 | pmeth->pkey_id = id; | - | ||||||||||||||||||||||||
196 | pmeth->flags = flags | 1; | - | ||||||||||||||||||||||||
197 | return executed 2 times by 1 test: pmeth;return pmeth; Executed by:
executed 2 times by 1 test: return pmeth; Executed by:
| 2 | ||||||||||||||||||||||||
198 | } | - | ||||||||||||||||||||||||
199 | - | |||||||||||||||||||||||||
200 | void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags, | - | ||||||||||||||||||||||||
201 | const EVP_PKEY_METHOD *meth) | - | ||||||||||||||||||||||||
202 | { | - | ||||||||||||||||||||||||
203 | if (ppkey_id
| 0-18 | ||||||||||||||||||||||||
204 | * executed 18 times by 1 test: ppkey_id = meth->pkey_id;*ppkey_id = meth->pkey_id; Executed by:
executed 18 times by 1 test: *ppkey_id = meth->pkey_id; Executed by:
| 18 | ||||||||||||||||||||||||
205 | if (pflags
| 0-18 | ||||||||||||||||||||||||
206 | * never executed: pflags = meth->flags;*pflags = meth->flags; never executed: *pflags = meth->flags; | 0 | ||||||||||||||||||||||||
207 | } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||||||||||||||||||||
208 | - | |||||||||||||||||||||||||
209 | void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src) | - | ||||||||||||||||||||||||
210 | { | - | ||||||||||||||||||||||||
211 | - | |||||||||||||||||||||||||
212 | dst->init = src->init; | - | ||||||||||||||||||||||||
213 | dst->copy = src->copy; | - | ||||||||||||||||||||||||
214 | dst->cleanup = src->cleanup; | - | ||||||||||||||||||||||||
215 | - | |||||||||||||||||||||||||
216 | dst->paramgen_init = src->paramgen_init; | - | ||||||||||||||||||||||||
217 | dst->paramgen = src->paramgen; | - | ||||||||||||||||||||||||
218 | - | |||||||||||||||||||||||||
219 | dst->keygen_init = src->keygen_init; | - | ||||||||||||||||||||||||
220 | dst->keygen = src->keygen; | - | ||||||||||||||||||||||||
221 | - | |||||||||||||||||||||||||
222 | dst->sign_init = src->sign_init; | - | ||||||||||||||||||||||||
223 | dst->sign = src->sign; | - | ||||||||||||||||||||||||
224 | - | |||||||||||||||||||||||||
225 | dst->verify_init = src->verify_init; | - | ||||||||||||||||||||||||
226 | dst->verify = src->verify; | - | ||||||||||||||||||||||||
227 | - | |||||||||||||||||||||||||
228 | dst->verify_recover_init = src->verify_recover_init; | - | ||||||||||||||||||||||||
229 | dst->verify_recover = src->verify_recover; | - | ||||||||||||||||||||||||
230 | - | |||||||||||||||||||||||||
231 | dst->signctx_init = src->signctx_init; | - | ||||||||||||||||||||||||
232 | dst->signctx = src->signctx; | - | ||||||||||||||||||||||||
233 | - | |||||||||||||||||||||||||
234 | dst->verifyctx_init = src->verifyctx_init; | - | ||||||||||||||||||||||||
235 | dst->verifyctx = src->verifyctx; | - | ||||||||||||||||||||||||
236 | - | |||||||||||||||||||||||||
237 | dst->encrypt_init = src->encrypt_init; | - | ||||||||||||||||||||||||
238 | dst->encrypt = src->encrypt; | - | ||||||||||||||||||||||||
239 | - | |||||||||||||||||||||||||
240 | dst->decrypt_init = src->decrypt_init; | - | ||||||||||||||||||||||||
241 | dst->decrypt = src->decrypt; | - | ||||||||||||||||||||||||
242 | - | |||||||||||||||||||||||||
243 | dst->derive_init = src->derive_init; | - | ||||||||||||||||||||||||
244 | dst->derive = src->derive; | - | ||||||||||||||||||||||||
245 | - | |||||||||||||||||||||||||
246 | dst->ctrl = src->ctrl; | - | ||||||||||||||||||||||||
247 | dst->ctrl_str = src->ctrl_str; | - | ||||||||||||||||||||||||
248 | - | |||||||||||||||||||||||||
249 | dst->check = src->check; | - | ||||||||||||||||||||||||
250 | } never executed: end of block | 0 | ||||||||||||||||||||||||
251 | - | |||||||||||||||||||||||||
252 | void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth) | - | ||||||||||||||||||||||||
253 | { | - | ||||||||||||||||||||||||
254 | if (pmeth
| 0-2 | ||||||||||||||||||||||||
255 | CRYPTO_free(pmeth, __FILE__, 240); executed 2 times by 1 test: CRYPTO_free(pmeth, __FILE__, 240); Executed by:
| 2 | ||||||||||||||||||||||||
256 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||||||||||||||
257 | - | |||||||||||||||||||||||||
258 | EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e) | - | ||||||||||||||||||||||||
259 | { | - | ||||||||||||||||||||||||
260 | return executed 32127 times by 1 test: int_ctx_new(pkey, e, -1);return int_ctx_new(pkey, e, -1); Executed by:
executed 32127 times by 1 test: return int_ctx_new(pkey, e, -1); Executed by:
| 32127 | ||||||||||||||||||||||||
261 | } | - | ||||||||||||||||||||||||
262 | - | |||||||||||||||||||||||||
263 | EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e) | - | ||||||||||||||||||||||||
264 | { | - | ||||||||||||||||||||||||
265 | return executed 50029 times by 1 test: int_ctx_new(return int_ctx_new( ((void *)0) , e, id); Executed by:
executed 50029 times by 1 test: return int_ctx_new( ((void *)0) , e, id); Executed by:
| 50029 | ||||||||||||||||||||||||
266 | ((void *)0) executed 50029 times by 1 test: return int_ctx_new( ((void *)0) , e, id); Executed by:
| 50029 | ||||||||||||||||||||||||
267 | , e, id); executed 50029 times by 1 test: return int_ctx_new( ((void *)0) , e, id); Executed by:
| 50029 | ||||||||||||||||||||||||
268 | } | - | ||||||||||||||||||||||||
269 | - | |||||||||||||||||||||||||
270 | EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *pctx) | - | ||||||||||||||||||||||||
271 | { | - | ||||||||||||||||||||||||
272 | EVP_PKEY_CTX *rctx; | - | ||||||||||||||||||||||||
273 | if (!pctx->pmeth
| 0-164841 | ||||||||||||||||||||||||
274 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
275 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
276 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
277 | - | |||||||||||||||||||||||||
278 | - | |||||||||||||||||||||||||
279 | if (pctx->engine
| 0-164841 | ||||||||||||||||||||||||
280 | ERR_put_error(6,(156),(38),__FILE__,261); | - | ||||||||||||||||||||||||
281 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
282 | } | - | ||||||||||||||||||||||||
283 | - | |||||||||||||||||||||||||
284 | rctx = CRYPTO_malloc(sizeof(*rctx), __FILE__, 265); | - | ||||||||||||||||||||||||
285 | if (rctx ==
| 0-164841 | ||||||||||||||||||||||||
286 | ((void *)0)
| 0-164841 | ||||||||||||||||||||||||
287 | ) { | - | ||||||||||||||||||||||||
288 | ERR_put_error(6,(156),((1|64)),__FILE__,267); | - | ||||||||||||||||||||||||
289 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
290 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
291 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
292 | } | - | ||||||||||||||||||||||||
293 | - | |||||||||||||||||||||||||
294 | rctx->pmeth = pctx->pmeth; | - | ||||||||||||||||||||||||
295 | - | |||||||||||||||||||||||||
296 | rctx->engine = pctx->engine; | - | ||||||||||||||||||||||||
297 | - | |||||||||||||||||||||||||
298 | - | |||||||||||||||||||||||||
299 | if (pctx->pkey
| 0-164841 | ||||||||||||||||||||||||
300 | EVP_PKEY_up_ref(pctx->pkey); executed 164841 times by 1 test: EVP_PKEY_up_ref(pctx->pkey); Executed by:
| 164841 | ||||||||||||||||||||||||
301 | - | |||||||||||||||||||||||||
302 | rctx->pkey = pctx->pkey; | - | ||||||||||||||||||||||||
303 | - | |||||||||||||||||||||||||
304 | if (pctx->peerkey
| 0-164841 | ||||||||||||||||||||||||
305 | EVP_PKEY_up_ref(pctx->peerkey); never executed: EVP_PKEY_up_ref(pctx->peerkey); | 0 | ||||||||||||||||||||||||
306 | - | |||||||||||||||||||||||||
307 | rctx->peerkey = pctx->peerkey; | - | ||||||||||||||||||||||||
308 | - | |||||||||||||||||||||||||
309 | rctx->data = | - | ||||||||||||||||||||||||
310 | ((void *)0) | - | ||||||||||||||||||||||||
311 | ; | - | ||||||||||||||||||||||||
312 | rctx->app_data = | - | ||||||||||||||||||||||||
313 | ((void *)0) | - | ||||||||||||||||||||||||
314 | ; | - | ||||||||||||||||||||||||
315 | rctx->operation = pctx->operation; | - | ||||||||||||||||||||||||
316 | - | |||||||||||||||||||||||||
317 | if (pctx->pmeth->copy(rctx, pctx) > 0
| 0-164841 | ||||||||||||||||||||||||
318 | return executed 164841 times by 1 test: rctx;return rctx; Executed by:
executed 164841 times by 1 test: return rctx; Executed by:
| 164841 | ||||||||||||||||||||||||
319 | - | |||||||||||||||||||||||||
320 | rctx->pmeth = | - | ||||||||||||||||||||||||
321 | ((void *)0) | - | ||||||||||||||||||||||||
322 | ; | - | ||||||||||||||||||||||||
323 | EVP_PKEY_CTX_free(rctx); | - | ||||||||||||||||||||||||
324 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
325 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
326 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
327 | - | |||||||||||||||||||||||||
328 | } | - | ||||||||||||||||||||||||
329 | - | |||||||||||||||||||||||||
330 | int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth) | - | ||||||||||||||||||||||||
331 | { | - | ||||||||||||||||||||||||
332 | if (app_pkey_methods ==
| 0-1 | ||||||||||||||||||||||||
333 | ((void *)0)
| 0-1 | ||||||||||||||||||||||||
334 | ) { | - | ||||||||||||||||||||||||
335 | app_pkey_methods = sk_EVP_PKEY_METHOD_new(pmeth_cmp); | - | ||||||||||||||||||||||||
336 | if (app_pkey_methods ==
| 0-1 | ||||||||||||||||||||||||
337 | ((void *)0)
| 0-1 | ||||||||||||||||||||||||
338 | ){ | - | ||||||||||||||||||||||||
339 | ERR_put_error(6,(194),((1|64)),__FILE__,304); | - | ||||||||||||||||||||||||
340 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
341 | } | - | ||||||||||||||||||||||||
342 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||||||||
343 | if (!sk_EVP_PKEY_METHOD_push(app_pkey_methods, pmeth)
| 0-1 | ||||||||||||||||||||||||
344 | ERR_put_error(6,(194),((1|64)),__FILE__,309); | - | ||||||||||||||||||||||||
345 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
346 | } | - | ||||||||||||||||||||||||
347 | sk_EVP_PKEY_METHOD_sort(app_pkey_methods); | - | ||||||||||||||||||||||||
348 | return executed 1 time by 1 test: 1;return 1; Executed by:
executed 1 time by 1 test: return 1; Executed by:
| 1 | ||||||||||||||||||||||||
349 | } | - | ||||||||||||||||||||||||
350 | - | |||||||||||||||||||||||||
351 | void evp_app_cleanup_int(void) | - | ||||||||||||||||||||||||
352 | { | - | ||||||||||||||||||||||||
353 | if (app_pkey_methods !=
| 1-2075 | ||||||||||||||||||||||||
354 | ((void *)0)
| 1-2075 | ||||||||||||||||||||||||
355 | ) | - | ||||||||||||||||||||||||
356 | sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free); executed 1 time by 1 test: sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free); Executed by:
| 1 | ||||||||||||||||||||||||
357 | } executed 2076 times by 12 tests: end of block Executed by:
| 2076 | ||||||||||||||||||||||||
358 | - | |||||||||||||||||||||||||
359 | int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth) | - | ||||||||||||||||||||||||
360 | { | - | ||||||||||||||||||||||||
361 | const EVP_PKEY_METHOD *ret; | - | ||||||||||||||||||||||||
362 | - | |||||||||||||||||||||||||
363 | ret = sk_EVP_PKEY_METHOD_delete_ptr(app_pkey_methods, pmeth); | - | ||||||||||||||||||||||||
364 | - | |||||||||||||||||||||||||
365 | return never executed: ret == return ret == ((void *)0) ? 0 : 1;
never executed: return ret == ((void *)0) ? 0 : 1; | 0 | ||||||||||||||||||||||||
366 | ((void *)0)
never executed: return ret == ((void *)0) ? 0 : 1; | 0 | ||||||||||||||||||||||||
367 | ? 0 : 1; never executed: return ret == ((void *)0) ? 0 : 1; | 0 | ||||||||||||||||||||||||
368 | } | - | ||||||||||||||||||||||||
369 | - | |||||||||||||||||||||||||
370 | size_t EVP_PKEY_meth_get_count(void) | - | ||||||||||||||||||||||||
371 | { | - | ||||||||||||||||||||||||
372 | size_t rv = (sizeof(standard_methods)/sizeof((standard_methods)[0])); | - | ||||||||||||||||||||||||
373 | - | |||||||||||||||||||||||||
374 | if (app_pkey_methods
| 0-19 | ||||||||||||||||||||||||
375 | rv += sk_EVP_PKEY_METHOD_num(app_pkey_methods); never executed: rv += sk_EVP_PKEY_METHOD_num(app_pkey_methods); | 0 | ||||||||||||||||||||||||
376 | return executed 19 times by 1 test: rv;return rv; Executed by:
executed 19 times by 1 test: return rv; Executed by:
| 19 | ||||||||||||||||||||||||
377 | } | - | ||||||||||||||||||||||||
378 | - | |||||||||||||||||||||||||
379 | const EVP_PKEY_METHOD *EVP_PKEY_meth_get0(size_t idx) | - | ||||||||||||||||||||||||
380 | { | - | ||||||||||||||||||||||||
381 | if (idx < (sizeof(standard_methods)/sizeof((standard_methods)[0]))
| 0-18 | ||||||||||||||||||||||||
382 | return executed 18 times by 1 test: standard_methods[idx];return standard_methods[idx]; Executed by:
executed 18 times by 1 test: return standard_methods[idx]; Executed by:
| 18 | ||||||||||||||||||||||||
383 | if (app_pkey_methods ==
| 0 | ||||||||||||||||||||||||
384 | ((void *)0)
| 0 | ||||||||||||||||||||||||
385 | ) | - | ||||||||||||||||||||||||
386 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
387 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
388 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
389 | idx -= (sizeof(standard_methods)/sizeof((standard_methods)[0])); | - | ||||||||||||||||||||||||
390 | if (idx >= (size_t)sk_EVP_PKEY_METHOD_num(app_pkey_methods)
| 0 | ||||||||||||||||||||||||
391 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
392 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
393 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
394 | return never executed: sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx);return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx); never executed: return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx); | 0 | ||||||||||||||||||||||||
395 | } | - | ||||||||||||||||||||||||
396 | - | |||||||||||||||||||||||||
397 | void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
398 | { | - | ||||||||||||||||||||||||
399 | if (ctx ==
| 246996-2378786 | ||||||||||||||||||||||||
400 | ((void *)0)
| 246996-2378786 | ||||||||||||||||||||||||
401 | ) | - | ||||||||||||||||||||||||
402 | return; executed 2378786 times by 3 tests: return; Executed by:
| 2378786 | ||||||||||||||||||||||||
403 | if (ctx->pmeth
| 0-246996 | ||||||||||||||||||||||||
404 | ctx->pmeth->cleanup(ctx); executed 237733 times by 1 test: ctx->pmeth->cleanup(ctx); Executed by:
| 237733 | ||||||||||||||||||||||||
405 | EVP_PKEY_free(ctx->pkey); | - | ||||||||||||||||||||||||
406 | EVP_PKEY_free(ctx->peerkey); | - | ||||||||||||||||||||||||
407 | - | |||||||||||||||||||||||||
408 | ENGINE_finish(ctx->engine); | - | ||||||||||||||||||||||||
409 | - | |||||||||||||||||||||||||
410 | CRYPTO_free(ctx, __FILE__, 363); | - | ||||||||||||||||||||||||
411 | } executed 246996 times by 1 test: end of block Executed by:
| 246996 | ||||||||||||||||||||||||
412 | - | |||||||||||||||||||||||||
413 | int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, | - | ||||||||||||||||||||||||
414 | int cmd, int p1, void *p2) | - | ||||||||||||||||||||||||
415 | { | - | ||||||||||||||||||||||||
416 | int ret; | - | ||||||||||||||||||||||||
417 | - | |||||||||||||||||||||||||
418 | if (!ctx
| 0-256133 | ||||||||||||||||||||||||
419 | ERR_put_error(6,(137),(147),__FILE__,372); | - | ||||||||||||||||||||||||
420 | return never executed: -2;return -2; never executed: return -2; | 0 | ||||||||||||||||||||||||
421 | } | - | ||||||||||||||||||||||||
422 | if ((
| 0-254617 | ||||||||||||||||||||||||
423 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
424 | - | |||||||||||||||||||||||||
425 | - | |||||||||||||||||||||||||
426 | if (ctx->pmeth->digest_custom !=
| 12-256121 | ||||||||||||||||||||||||
427 | ((void *)0)
| 12-256121 | ||||||||||||||||||||||||
428 | ) | - | ||||||||||||||||||||||||
429 | goto executed 12 times by 1 test: doit;goto doit; Executed by:
executed 12 times by 1 test: goto doit; Executed by:
| 12 | ||||||||||||||||||||||||
430 | - | |||||||||||||||||||||||||
431 | if (ctx->operation == 0
| 0-256121 | ||||||||||||||||||||||||
432 | ERR_put_error(6,(137),(149),__FILE__,383); | - | ||||||||||||||||||||||||
433 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
434 | } | - | ||||||||||||||||||||||||
435 | - | |||||||||||||||||||||||||
436 | if ((
| 0-253927 | ||||||||||||||||||||||||
437 | ERR_put_error(6,(137),(148),__FILE__,388); | - | ||||||||||||||||||||||||
438 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
439 | } | - | ||||||||||||||||||||||||
440 | - | |||||||||||||||||||||||||
441 | doit: code before this statement executed 256121 times by 1 test: doit: Executed by:
| 256121 | ||||||||||||||||||||||||
442 | ret = ctx->pmeth->ctrl(ctx, cmd, p1, p2); | - | ||||||||||||||||||||||||
443 | - | |||||||||||||||||||||||||
444 | if (ret == -2
| 6-256127 | ||||||||||||||||||||||||
445 | ERR_put_error(6,(137),(147),__FILE__,396); executed 6 times by 1 test: ERR_put_error(6,(137),(147),__FILE__,396); Executed by:
| 6 | ||||||||||||||||||||||||
446 | - | |||||||||||||||||||||||||
447 | return executed 256133 times by 1 test: ret;return ret; Executed by:
executed 256133 times by 1 test: return ret; Executed by:
| 256133 | ||||||||||||||||||||||||
448 | } | - | ||||||||||||||||||||||||
449 | - | |||||||||||||||||||||||||
450 | int EVP_PKEY_CTX_ctrl_uint64(EVP_PKEY_CTX *ctx, int keytype, int optype, | - | ||||||||||||||||||||||||
451 | int cmd, uint64_t value) | - | ||||||||||||||||||||||||
452 | { | - | ||||||||||||||||||||||||
453 | return executed 5 times by 1 test: EVP_PKEY_CTX_ctrl(ctx, keytype, optype, cmd, 0, &value);return EVP_PKEY_CTX_ctrl(ctx, keytype, optype, cmd, 0, &value); Executed by:
executed 5 times by 1 test: return EVP_PKEY_CTX_ctrl(ctx, keytype, optype, cmd, 0, &value); Executed by:
| 5 | ||||||||||||||||||||||||
454 | } | - | ||||||||||||||||||||||||
455 | - | |||||||||||||||||||||||||
456 | int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
457 | const char *name, const char *value) | - | ||||||||||||||||||||||||
458 | { | - | ||||||||||||||||||||||||
459 | if (!ctx
| 0-1078 | ||||||||||||||||||||||||
460 | ERR_put_error(6,(150),(147),__FILE__,411); | - | ||||||||||||||||||||||||
461 | return never executed: -2;return -2; never executed: return -2; | 0 | ||||||||||||||||||||||||
462 | } | - | ||||||||||||||||||||||||
463 | if ( | - | ||||||||||||||||||||||||
464 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 63-1015 | ||||||||||||||||||||||||
465 | name
| 63-1015 | ||||||||||||||||||||||||
466 | ) && __builtin_constant_p (
| 63-1015 | ||||||||||||||||||||||||
467 | "digest"
| 63-1015 | ||||||||||||||||||||||||
468 | ) && (__s1_len = __builtin_strlen (
| 63-1015 | ||||||||||||||||||||||||
469 | name
| 63-1015 | ||||||||||||||||||||||||
470 | ), __s2_len = __builtin_strlen (
| 63-1015 | ||||||||||||||||||||||||
471 | "digest"
| 63-1015 | ||||||||||||||||||||||||
472 | ), (!((size_t)(const void *)((
| 63-1015 | ||||||||||||||||||||||||
473 | name
| 63-1015 | ||||||||||||||||||||||||
474 | ) + 1) - (size_t)(const void *)(
| 63-1015 | ||||||||||||||||||||||||
475 | name
| 63-1015 | ||||||||||||||||||||||||
476 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 63-1015 | ||||||||||||||||||||||||
477 | "digest"
| 63-1015 | ||||||||||||||||||||||||
478 | ) + 1) - (size_t)(const void *)(
| 63-1015 | ||||||||||||||||||||||||
479 | "digest"
| 63-1015 | ||||||||||||||||||||||||
480 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 63-1015 | ||||||||||||||||||||||||
481 | name
| 63-1015 | ||||||||||||||||||||||||
482 | ,
| 63-1015 | ||||||||||||||||||||||||
483 | "digest"
| 63-1015 | ||||||||||||||||||||||||
484 | ) : (__builtin_constant_p (
| 63-1015 | ||||||||||||||||||||||||
485 | name
| 63-1015 | ||||||||||||||||||||||||
486 | ) && ((size_t)(const void *)((
| 63-1015 | ||||||||||||||||||||||||
487 | name
| 63-1015 | ||||||||||||||||||||||||
488 | ) + 1) - (size_t)(const void *)(
| 63-1015 | ||||||||||||||||||||||||
489 | name
| 63-1015 | ||||||||||||||||||||||||
490 | ) == 1) && (__s1_len = __builtin_strlen (
| 63-1015 | ||||||||||||||||||||||||
491 | name
| 63-1015 | ||||||||||||||||||||||||
492 | ), __s1_len < 4) ? (__builtin_constant_p (
| 63-1015 | ||||||||||||||||||||||||
493 | "digest"
| 63-1015 | ||||||||||||||||||||||||
494 | ) && ((size_t)(const void *)((
| 63-1015 | ||||||||||||||||||||||||
495 | "digest"
| 63-1015 | ||||||||||||||||||||||||
496 | ) + 1) - (size_t)(const void *)(
| 63-1015 | ||||||||||||||||||||||||
497 | "digest"
| 63-1015 | ||||||||||||||||||||||||
498 | ) == 1) ? __builtin_strcmp (
| 63-1015 | ||||||||||||||||||||||||
499 | name
| 63-1015 | ||||||||||||||||||||||||
500 | ,
| 63-1015 | ||||||||||||||||||||||||
501 | "digest"
| 63-1015 | ||||||||||||||||||||||||
502 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 63-1015 | ||||||||||||||||||||||||
503 | "digest"
| 63-1015 | ||||||||||||||||||||||||
504 | ); int __result = (((const unsigned char *) (const char *) (
| 63-1015 | ||||||||||||||||||||||||
505 | name
| 63-1015 | ||||||||||||||||||||||||
506 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-1015 | ||||||||||||||||||||||||
507 | name
| 63-1015 | ||||||||||||||||||||||||
508 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-1015 | ||||||||||||||||||||||||
509 | name
| 63-1015 | ||||||||||||||||||||||||
510 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]);
| 0-1015 | ||||||||||||||||||||||||
511 | name
never executed: __result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]); | 0-1015 | ||||||||||||||||||||||||
512 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]); never executed: }end of block never executed: __result; }))) : (__builtin_constant_p (end of block
| 0-1015 | ||||||||||||||||||||||||
513 | "digest"
| 63-1015 | ||||||||||||||||||||||||
514 | ) && ((size_t)(const void *)((
| 63-1015 | ||||||||||||||||||||||||
515 | "digest"
| 63-1015 | ||||||||||||||||||||||||
516 | ) + 1) - (size_t)(const void *)(
| 63-1015 | ||||||||||||||||||||||||
517 | "digest"
| 63-1015 | ||||||||||||||||||||||||
518 | ) == 1) && (__s2_len = __builtin_strlen (
| 63-1015 | ||||||||||||||||||||||||
519 | "digest"
| 63-1015 | ||||||||||||||||||||||||
520 | ), __s2_len < 4) ? (__builtin_constant_p (
| 63-1015 | ||||||||||||||||||||||||
521 | name
| 63-1015 | ||||||||||||||||||||||||
522 | ) && ((size_t)(const void *)((
| 63-1015 | ||||||||||||||||||||||||
523 | name
| 63-1015 | ||||||||||||||||||||||||
524 | ) + 1) - (size_t)(const void *)(
| 63-1015 | ||||||||||||||||||||||||
525 | name
| 63-1015 | ||||||||||||||||||||||||
526 | ) == 1) ? __builtin_strcmp (
| 63-1015 | ||||||||||||||||||||||||
527 | name
| 63-1015 | ||||||||||||||||||||||||
528 | ,
| 63-1015 | ||||||||||||||||||||||||
529 | "digest"
| 63-1015 | ||||||||||||||||||||||||
530 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 63-1015 | ||||||||||||||||||||||||
531 | name
| 63-1015 | ||||||||||||||||||||||||
532 | ); int __result = (((const unsigned char *) (const char *) (
| 63-1015 | ||||||||||||||||||||||||
533 | "digest"
| 63-1015 | ||||||||||||||||||||||||
534 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-1015 | ||||||||||||||||||||||||
535 | "digest"
| 63-1015 | ||||||||||||||||||||||||
536 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-1015 | ||||||||||||||||||||||||
537 | "digest"
| 63-1015 | ||||||||||||||||||||||||
538 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( "digest" ))[3] - __s2[3]);
| 0-1015 | ||||||||||||||||||||||||
539 | "digest"
never executed: __result = (((const unsigned char *) (const char *) ( "digest" ))[3] - __s2[3]); | 0-1015 | ||||||||||||||||||||||||
540 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( "digest" ))[3] - __s2[3]); never executed: }end of block never executed: __result; }))) : __builtin_strcmp (end of block
| 0-1015 | ||||||||||||||||||||||||
541 | name
| 63-1015 | ||||||||||||||||||||||||
542 | ,
| 63-1015 | ||||||||||||||||||||||||
543 | "digest"
| 63-1015 | ||||||||||||||||||||||||
544 | )))); })
| 63-1015 | ||||||||||||||||||||||||
545 | == 0
| 63-1015 | ||||||||||||||||||||||||
546 | return executed 63 times by 1 test: EVP_PKEY_CTX_md(ctx, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)), 1,return EVP_PKEY_CTX_md(ctx, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)), 1, value); Executed by:
executed 63 times by 1 test: return EVP_PKEY_CTX_md(ctx, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)), 1, value); Executed by:
| 63 | ||||||||||||||||||||||||
547 | value); executed 63 times by 1 test: return EVP_PKEY_CTX_md(ctx, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)), 1, value); Executed by:
| 63 | ||||||||||||||||||||||||
548 | return executed 1015 times by 1 test: ctx->pmeth->ctrl_str(ctx, name, value);return ctx->pmeth->ctrl_str(ctx, name, value); Executed by:
executed 1015 times by 1 test: return ctx->pmeth->ctrl_str(ctx, name, value); Executed by:
| 1015 | ||||||||||||||||||||||||
549 | } | - | ||||||||||||||||||||||||
550 | - | |||||||||||||||||||||||||
551 | - | |||||||||||||||||||||||||
552 | - | |||||||||||||||||||||||||
553 | int EVP_PKEY_CTX_str2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *str) | - | ||||||||||||||||||||||||
554 | { | - | ||||||||||||||||||||||||
555 | size_t len; | - | ||||||||||||||||||||||||
556 | - | |||||||||||||||||||||||||
557 | len = strlen(str); | - | ||||||||||||||||||||||||
558 | if (len > 0x7fffffff
| 0-35 | ||||||||||||||||||||||||
559 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
560 | return executed 35 times by 1 test: ctx->pmeth->ctrl(ctx, cmd, len, (void *)str);return ctx->pmeth->ctrl(ctx, cmd, len, (void *)str); Executed by:
executed 35 times by 1 test: return ctx->pmeth->ctrl(ctx, cmd, len, (void *)str); Executed by:
| 35 | ||||||||||||||||||||||||
561 | } | - | ||||||||||||||||||||||||
562 | - | |||||||||||||||||||||||||
563 | int EVP_PKEY_CTX_hex2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *hex) | - | ||||||||||||||||||||||||
564 | { | - | ||||||||||||||||||||||||
565 | unsigned char *bin; | - | ||||||||||||||||||||||||
566 | long binlen; | - | ||||||||||||||||||||||||
567 | int rv = -1; | - | ||||||||||||||||||||||||
568 | - | |||||||||||||||||||||||||
569 | bin = OPENSSL_hexstr2buf(hex, &binlen); | - | ||||||||||||||||||||||||
570 | if (bin ==
| 0-61 | ||||||||||||||||||||||||
571 | ((void *)0)
| 0-61 | ||||||||||||||||||||||||
572 | ) | - | ||||||||||||||||||||||||
573 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
574 | if (binlen <= 0x7fffffff
| 0-61 | ||||||||||||||||||||||||
575 | rv = ctx->pmeth->ctrl(ctx, cmd, binlen, bin); executed 61 times by 1 test: rv = ctx->pmeth->ctrl(ctx, cmd, binlen, bin); Executed by:
| 61 | ||||||||||||||||||||||||
576 | CRYPTO_free(bin, __FILE__, 443); | - | ||||||||||||||||||||||||
577 | return executed 61 times by 1 test: rv;return rv; Executed by:
executed 61 times by 1 test: return rv; Executed by:
| 61 | ||||||||||||||||||||||||
578 | } | - | ||||||||||||||||||||||||
579 | - | |||||||||||||||||||||||||
580 | - | |||||||||||||||||||||||||
581 | int EVP_PKEY_CTX_md(EVP_PKEY_CTX *ctx, int optype, int cmd, const char *md) | - | ||||||||||||||||||||||||
582 | { | - | ||||||||||||||||||||||||
583 | const EVP_MD *m; | - | ||||||||||||||||||||||||
584 | - | |||||||||||||||||||||||||
585 | if (md ==
| 0-222 | ||||||||||||||||||||||||
586 | ((void *)0)
| 0-222 | ||||||||||||||||||||||||
587 | || (
| 0-222 | ||||||||||||||||||||||||
588 | ((void *)0)
| 0-222 | ||||||||||||||||||||||||
589 | ) { | - | ||||||||||||||||||||||||
590 | ERR_put_error(6,(168),(152),__FILE__,453); | - | ||||||||||||||||||||||||
591 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
592 | } | - | ||||||||||||||||||||||||
593 | return executed 222 times by 1 test: EVP_PKEY_CTX_ctrl(ctx, -1, optype, cmd, 0, (void *)m);return EVP_PKEY_CTX_ctrl(ctx, -1, optype, cmd, 0, (void *)m); Executed by:
executed 222 times by 1 test: return EVP_PKEY_CTX_ctrl(ctx, -1, optype, cmd, 0, (void *)m); Executed by:
| 222 | ||||||||||||||||||||||||
594 | } | - | ||||||||||||||||||||||||
595 | - | |||||||||||||||||||||||||
596 | int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
597 | { | - | ||||||||||||||||||||||||
598 | return never executed: ctx->operation;return ctx->operation; never executed: return ctx->operation; | 0 | ||||||||||||||||||||||||
599 | } | - | ||||||||||||||||||||||||
600 | - | |||||||||||||||||||||||||
601 | void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen) | - | ||||||||||||||||||||||||
602 | { | - | ||||||||||||||||||||||||
603 | ctx->keygen_info = dat; | - | ||||||||||||||||||||||||
604 | ctx->keygen_info_count = datlen; | - | ||||||||||||||||||||||||
605 | } executed 136 times by 1 test: end of block Executed by:
| 136 | ||||||||||||||||||||||||
606 | - | |||||||||||||||||||||||||
607 | void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data) | - | ||||||||||||||||||||||||
608 | { | - | ||||||||||||||||||||||||
609 | ctx->data = data; | - | ||||||||||||||||||||||||
610 | } executed 181832 times by 1 test: end of block Executed by:
| 181832 | ||||||||||||||||||||||||
611 | - | |||||||||||||||||||||||||
612 | void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
613 | { | - | ||||||||||||||||||||||||
614 | return executed 501214 times by 1 test: ctx->data;return ctx->data; Executed by:
executed 501214 times by 1 test: return ctx->data; Executed by:
| 501214 | ||||||||||||||||||||||||
615 | } | - | ||||||||||||||||||||||||
616 | - | |||||||||||||||||||||||||
617 | EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
618 | { | - | ||||||||||||||||||||||||
619 | return executed 79 times by 1 test: ctx->pkey;return ctx->pkey; Executed by:
executed 79 times by 1 test: return ctx->pkey; Executed by:
| 79 | ||||||||||||||||||||||||
620 | } | - | ||||||||||||||||||||||||
621 | - | |||||||||||||||||||||||||
622 | EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
623 | { | - | ||||||||||||||||||||||||
624 | return executed 6 times by 1 test: ctx->peerkey;return ctx->peerkey; Executed by:
executed 6 times by 1 test: return ctx->peerkey; Executed by:
| 6 | ||||||||||||||||||||||||
625 | } | - | ||||||||||||||||||||||||
626 | - | |||||||||||||||||||||||||
627 | void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data) | - | ||||||||||||||||||||||||
628 | { | - | ||||||||||||||||||||||||
629 | ctx->app_data = data; | - | ||||||||||||||||||||||||
630 | } executed 13 times by 1 test: end of block Executed by:
| 13 | ||||||||||||||||||||||||
631 | - | |||||||||||||||||||||||||
632 | void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx) | - | ||||||||||||||||||||||||
633 | { | - | ||||||||||||||||||||||||
634 | return executed 2168 times by 1 test: ctx->app_data;return ctx->app_data; Executed by:
executed 2168 times by 1 test: return ctx->app_data; Executed by:
| 2168 | ||||||||||||||||||||||||
635 | } | - | ||||||||||||||||||||||||
636 | - | |||||||||||||||||||||||||
637 | void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
638 | int (*init) (EVP_PKEY_CTX *ctx)) | - | ||||||||||||||||||||||||
639 | { | - | ||||||||||||||||||||||||
640 | pmeth->init = init; | - | ||||||||||||||||||||||||
641 | } never executed: end of block | 0 | ||||||||||||||||||||||||
642 | - | |||||||||||||||||||||||||
643 | void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
644 | int (*copy) (EVP_PKEY_CTX *dst, | - | ||||||||||||||||||||||||
645 | EVP_PKEY_CTX *src)) | - | ||||||||||||||||||||||||
646 | { | - | ||||||||||||||||||||||||
647 | pmeth->copy = copy; | - | ||||||||||||||||||||||||
648 | } never executed: end of block | 0 | ||||||||||||||||||||||||
649 | - | |||||||||||||||||||||||||
650 | void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
651 | void (*cleanup) (EVP_PKEY_CTX *ctx)) | - | ||||||||||||||||||||||||
652 | { | - | ||||||||||||||||||||||||
653 | pmeth->cleanup = cleanup; | - | ||||||||||||||||||||||||
654 | } never executed: end of block | 0 | ||||||||||||||||||||||||
655 | - | |||||||||||||||||||||||||
656 | void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
657 | int (*paramgen_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
658 | int (*paramgen) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
659 | EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
660 | { | - | ||||||||||||||||||||||||
661 | pmeth->paramgen_init = paramgen_init; | - | ||||||||||||||||||||||||
662 | pmeth->paramgen = paramgen; | - | ||||||||||||||||||||||||
663 | } never executed: end of block | 0 | ||||||||||||||||||||||||
664 | - | |||||||||||||||||||||||||
665 | void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
666 | int (*keygen_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
667 | int (*keygen) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
668 | EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
669 | { | - | ||||||||||||||||||||||||
670 | pmeth->keygen_init = keygen_init; | - | ||||||||||||||||||||||||
671 | pmeth->keygen = keygen; | - | ||||||||||||||||||||||||
672 | } never executed: end of block | 0 | ||||||||||||||||||||||||
673 | - | |||||||||||||||||||||||||
674 | void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
675 | int (*sign_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
676 | int (*sign) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
677 | unsigned char *sig, size_t *siglen, | - | ||||||||||||||||||||||||
678 | const unsigned char *tbs, | - | ||||||||||||||||||||||||
679 | size_t tbslen)) | - | ||||||||||||||||||||||||
680 | { | - | ||||||||||||||||||||||||
681 | pmeth->sign_init = sign_init; | - | ||||||||||||||||||||||||
682 | pmeth->sign = sign; | - | ||||||||||||||||||||||||
683 | } never executed: end of block | 0 | ||||||||||||||||||||||||
684 | - | |||||||||||||||||||||||||
685 | void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
686 | int (*verify_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
687 | int (*verify) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
688 | const unsigned char *sig, | - | ||||||||||||||||||||||||
689 | size_t siglen, | - | ||||||||||||||||||||||||
690 | const unsigned char *tbs, | - | ||||||||||||||||||||||||
691 | size_t tbslen)) | - | ||||||||||||||||||||||||
692 | { | - | ||||||||||||||||||||||||
693 | pmeth->verify_init = verify_init; | - | ||||||||||||||||||||||||
694 | pmeth->verify = verify; | - | ||||||||||||||||||||||||
695 | } never executed: end of block | 0 | ||||||||||||||||||||||||
696 | - | |||||||||||||||||||||||||
697 | void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
698 | int (*verify_recover_init) (EVP_PKEY_CTX | - | ||||||||||||||||||||||||
699 | *ctx), | - | ||||||||||||||||||||||||
700 | int (*verify_recover) (EVP_PKEY_CTX | - | ||||||||||||||||||||||||
701 | *ctx, | - | ||||||||||||||||||||||||
702 | unsigned char | - | ||||||||||||||||||||||||
703 | *sig, | - | ||||||||||||||||||||||||
704 | size_t *siglen, | - | ||||||||||||||||||||||||
705 | const unsigned | - | ||||||||||||||||||||||||
706 | char *tbs, | - | ||||||||||||||||||||||||
707 | size_t tbslen)) | - | ||||||||||||||||||||||||
708 | { | - | ||||||||||||||||||||||||
709 | pmeth->verify_recover_init = verify_recover_init; | - | ||||||||||||||||||||||||
710 | pmeth->verify_recover = verify_recover; | - | ||||||||||||||||||||||||
711 | } never executed: end of block | 0 | ||||||||||||||||||||||||
712 | - | |||||||||||||||||||||||||
713 | void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
714 | int (*signctx_init) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
715 | EVP_MD_CTX *mctx), | - | ||||||||||||||||||||||||
716 | int (*signctx) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
717 | unsigned char *sig, | - | ||||||||||||||||||||||||
718 | size_t *siglen, | - | ||||||||||||||||||||||||
719 | EVP_MD_CTX *mctx)) | - | ||||||||||||||||||||||||
720 | { | - | ||||||||||||||||||||||||
721 | pmeth->signctx_init = signctx_init; | - | ||||||||||||||||||||||||
722 | pmeth->signctx = signctx; | - | ||||||||||||||||||||||||
723 | } never executed: end of block | 0 | ||||||||||||||||||||||||
724 | - | |||||||||||||||||||||||||
725 | void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
726 | int (*verifyctx_init) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
727 | EVP_MD_CTX *mctx), | - | ||||||||||||||||||||||||
728 | int (*verifyctx) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
729 | const unsigned char *sig, | - | ||||||||||||||||||||||||
730 | int siglen, | - | ||||||||||||||||||||||||
731 | EVP_MD_CTX *mctx)) | - | ||||||||||||||||||||||||
732 | { | - | ||||||||||||||||||||||||
733 | pmeth->verifyctx_init = verifyctx_init; | - | ||||||||||||||||||||||||
734 | pmeth->verifyctx = verifyctx; | - | ||||||||||||||||||||||||
735 | } never executed: end of block | 0 | ||||||||||||||||||||||||
736 | - | |||||||||||||||||||||||||
737 | void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
738 | int (*encrypt_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
739 | int (*encryptfn) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
740 | unsigned char *out, | - | ||||||||||||||||||||||||
741 | size_t *outlen, | - | ||||||||||||||||||||||||
742 | const unsigned char *in, | - | ||||||||||||||||||||||||
743 | size_t inlen)) | - | ||||||||||||||||||||||||
744 | { | - | ||||||||||||||||||||||||
745 | pmeth->encrypt_init = encrypt_init; | - | ||||||||||||||||||||||||
746 | pmeth->encrypt = encryptfn; | - | ||||||||||||||||||||||||
747 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||||||||
748 | - | |||||||||||||||||||||||||
749 | void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
750 | int (*decrypt_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
751 | int (*decrypt) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
752 | unsigned char *out, | - | ||||||||||||||||||||||||
753 | size_t *outlen, | - | ||||||||||||||||||||||||
754 | const unsigned char *in, | - | ||||||||||||||||||||||||
755 | size_t inlen)) | - | ||||||||||||||||||||||||
756 | { | - | ||||||||||||||||||||||||
757 | pmeth->decrypt_init = decrypt_init; | - | ||||||||||||||||||||||||
758 | pmeth->decrypt = decrypt; | - | ||||||||||||||||||||||||
759 | } never executed: end of block | 0 | ||||||||||||||||||||||||
760 | - | |||||||||||||||||||||||||
761 | void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
762 | int (*derive_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
763 | int (*derive) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
764 | unsigned char *key, | - | ||||||||||||||||||||||||
765 | size_t *keylen)) | - | ||||||||||||||||||||||||
766 | { | - | ||||||||||||||||||||||||
767 | pmeth->derive_init = derive_init; | - | ||||||||||||||||||||||||
768 | pmeth->derive = derive; | - | ||||||||||||||||||||||||
769 | } never executed: end of block | 0 | ||||||||||||||||||||||||
770 | - | |||||||||||||||||||||||||
771 | void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
772 | int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1, | - | ||||||||||||||||||||||||
773 | void *p2), | - | ||||||||||||||||||||||||
774 | int (*ctrl_str) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
775 | const char *type, | - | ||||||||||||||||||||||||
776 | const char *value)) | - | ||||||||||||||||||||||||
777 | { | - | ||||||||||||||||||||||||
778 | pmeth->ctrl = ctrl; | - | ||||||||||||||||||||||||
779 | pmeth->ctrl_str = ctrl_str; | - | ||||||||||||||||||||||||
780 | } never executed: end of block | 0 | ||||||||||||||||||||||||
781 | - | |||||||||||||||||||||||||
782 | void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
783 | int (*check) (EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
784 | { | - | ||||||||||||||||||||||||
785 | pmeth->check = check; | - | ||||||||||||||||||||||||
786 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||||||||
787 | - | |||||||||||||||||||||||||
788 | void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
789 | int (*check) (EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
790 | { | - | ||||||||||||||||||||||||
791 | pmeth->public_check = check; | - | ||||||||||||||||||||||||
792 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||||||||
793 | - | |||||||||||||||||||||||||
794 | void EVP_PKEY_meth_set_param_check(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
795 | int (*check) (EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
796 | { | - | ||||||||||||||||||||||||
797 | pmeth->param_check = check; | - | ||||||||||||||||||||||||
798 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||||||||
799 | - | |||||||||||||||||||||||||
800 | void EVP_PKEY_meth_set_digest_custom(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
801 | int (*digest_custom) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
802 | EVP_MD_CTX *mctx)) | - | ||||||||||||||||||||||||
803 | { | - | ||||||||||||||||||||||||
804 | pmeth->digest_custom = digest_custom; | - | ||||||||||||||||||||||||
805 | } never executed: end of block | 0 | ||||||||||||||||||||||||
806 | - | |||||||||||||||||||||||||
807 | void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
808 | int (**pinit) (EVP_PKEY_CTX *ctx)) | - | ||||||||||||||||||||||||
809 | { | - | ||||||||||||||||||||||||
810 | *pinit = pmeth->init; | - | ||||||||||||||||||||||||
811 | } never executed: end of block | 0 | ||||||||||||||||||||||||
812 | - | |||||||||||||||||||||||||
813 | void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
814 | int (**pcopy) (EVP_PKEY_CTX *dst, | - | ||||||||||||||||||||||||
815 | EVP_PKEY_CTX *src)) | - | ||||||||||||||||||||||||
816 | { | - | ||||||||||||||||||||||||
817 | *pcopy = pmeth->copy; | - | ||||||||||||||||||||||||
818 | } never executed: end of block | 0 | ||||||||||||||||||||||||
819 | - | |||||||||||||||||||||||||
820 | void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
821 | void (**pcleanup) (EVP_PKEY_CTX *ctx)) | - | ||||||||||||||||||||||||
822 | { | - | ||||||||||||||||||||||||
823 | *pcleanup = pmeth->cleanup; | - | ||||||||||||||||||||||||
824 | } never executed: end of block | 0 | ||||||||||||||||||||||||
825 | - | |||||||||||||||||||||||||
826 | void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
827 | int (**pparamgen_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
828 | int (**pparamgen) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
829 | EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
830 | { | - | ||||||||||||||||||||||||
831 | if (pparamgen_init
| 0 | ||||||||||||||||||||||||
832 | * never executed: pparamgen_init = pmeth->paramgen_init;*pparamgen_init = pmeth->paramgen_init; never executed: *pparamgen_init = pmeth->paramgen_init; | 0 | ||||||||||||||||||||||||
833 | if (pparamgen
| 0 | ||||||||||||||||||||||||
834 | * never executed: pparamgen = pmeth->paramgen;*pparamgen = pmeth->paramgen; never executed: *pparamgen = pmeth->paramgen; | 0 | ||||||||||||||||||||||||
835 | } never executed: end of block | 0 | ||||||||||||||||||||||||
836 | - | |||||||||||||||||||||||||
837 | void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
838 | int (**pkeygen_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
839 | int (**pkeygen) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
840 | EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
841 | { | - | ||||||||||||||||||||||||
842 | if (pkeygen_init
| 0 | ||||||||||||||||||||||||
843 | * never executed: pkeygen_init = pmeth->keygen_init;*pkeygen_init = pmeth->keygen_init; never executed: *pkeygen_init = pmeth->keygen_init; | 0 | ||||||||||||||||||||||||
844 | if (pkeygen
| 0 | ||||||||||||||||||||||||
845 | * never executed: pkeygen = pmeth->keygen;*pkeygen = pmeth->keygen; never executed: *pkeygen = pmeth->keygen; | 0 | ||||||||||||||||||||||||
846 | } never executed: end of block | 0 | ||||||||||||||||||||||||
847 | - | |||||||||||||||||||||||||
848 | void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
849 | int (**psign_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
850 | int (**psign) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
851 | unsigned char *sig, size_t *siglen, | - | ||||||||||||||||||||||||
852 | const unsigned char *tbs, | - | ||||||||||||||||||||||||
853 | size_t tbslen)) | - | ||||||||||||||||||||||||
854 | { | - | ||||||||||||||||||||||||
855 | if (psign_init
| 0 | ||||||||||||||||||||||||
856 | * never executed: psign_init = pmeth->sign_init;*psign_init = pmeth->sign_init; never executed: *psign_init = pmeth->sign_init; | 0 | ||||||||||||||||||||||||
857 | if (psign
| 0 | ||||||||||||||||||||||||
858 | * never executed: psign = pmeth->sign;*psign = pmeth->sign; never executed: *psign = pmeth->sign; | 0 | ||||||||||||||||||||||||
859 | } never executed: end of block | 0 | ||||||||||||||||||||||||
860 | - | |||||||||||||||||||||||||
861 | void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
862 | int (**pverify_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
863 | int (**pverify) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
864 | const unsigned char *sig, | - | ||||||||||||||||||||||||
865 | size_t siglen, | - | ||||||||||||||||||||||||
866 | const unsigned char *tbs, | - | ||||||||||||||||||||||||
867 | size_t tbslen)) | - | ||||||||||||||||||||||||
868 | { | - | ||||||||||||||||||||||||
869 | if (pverify_init
| 0 | ||||||||||||||||||||||||
870 | * never executed: pverify_init = pmeth->verify_init;*pverify_init = pmeth->verify_init; never executed: *pverify_init = pmeth->verify_init; | 0 | ||||||||||||||||||||||||
871 | if (pverify
| 0 | ||||||||||||||||||||||||
872 | * never executed: pverify = pmeth->verify;*pverify = pmeth->verify; never executed: *pverify = pmeth->verify; | 0 | ||||||||||||||||||||||||
873 | } never executed: end of block | 0 | ||||||||||||||||||||||||
874 | - | |||||||||||||||||||||||||
875 | void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
876 | int (**pverify_recover_init) (EVP_PKEY_CTX | - | ||||||||||||||||||||||||
877 | *ctx), | - | ||||||||||||||||||||||||
878 | int (**pverify_recover) (EVP_PKEY_CTX | - | ||||||||||||||||||||||||
879 | *ctx, | - | ||||||||||||||||||||||||
880 | unsigned char | - | ||||||||||||||||||||||||
881 | *sig, | - | ||||||||||||||||||||||||
882 | size_t *siglen, | - | ||||||||||||||||||||||||
883 | const unsigned | - | ||||||||||||||||||||||||
884 | char *tbs, | - | ||||||||||||||||||||||||
885 | size_t tbslen)) | - | ||||||||||||||||||||||||
886 | { | - | ||||||||||||||||||||||||
887 | if (pverify_recover_init
| 0 | ||||||||||||||||||||||||
888 | * never executed: pverify_recover_init = pmeth->verify_recover_init;*pverify_recover_init = pmeth->verify_recover_init; never executed: *pverify_recover_init = pmeth->verify_recover_init; | 0 | ||||||||||||||||||||||||
889 | if (pverify_recover
| 0 | ||||||||||||||||||||||||
890 | * never executed: pverify_recover = pmeth->verify_recover;*pverify_recover = pmeth->verify_recover; never executed: *pverify_recover = pmeth->verify_recover; | 0 | ||||||||||||||||||||||||
891 | } never executed: end of block | 0 | ||||||||||||||||||||||||
892 | - | |||||||||||||||||||||||||
893 | void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
894 | int (**psignctx_init) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
895 | EVP_MD_CTX *mctx), | - | ||||||||||||||||||||||||
896 | int (**psignctx) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
897 | unsigned char *sig, | - | ||||||||||||||||||||||||
898 | size_t *siglen, | - | ||||||||||||||||||||||||
899 | EVP_MD_CTX *mctx)) | - | ||||||||||||||||||||||||
900 | { | - | ||||||||||||||||||||||||
901 | if (psignctx_init
| 0 | ||||||||||||||||||||||||
902 | * never executed: psignctx_init = pmeth->signctx_init;*psignctx_init = pmeth->signctx_init; never executed: *psignctx_init = pmeth->signctx_init; | 0 | ||||||||||||||||||||||||
903 | if (psignctx
| 0 | ||||||||||||||||||||||||
904 | * never executed: psignctx = pmeth->signctx;*psignctx = pmeth->signctx; never executed: *psignctx = pmeth->signctx; | 0 | ||||||||||||||||||||||||
905 | } never executed: end of block | 0 | ||||||||||||||||||||||||
906 | - | |||||||||||||||||||||||||
907 | void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
908 | int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
909 | EVP_MD_CTX *mctx), | - | ||||||||||||||||||||||||
910 | int (**pverifyctx) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
911 | const unsigned char *sig, | - | ||||||||||||||||||||||||
912 | int siglen, | - | ||||||||||||||||||||||||
913 | EVP_MD_CTX *mctx)) | - | ||||||||||||||||||||||||
914 | { | - | ||||||||||||||||||||||||
915 | if (pverifyctx_init
| 0 | ||||||||||||||||||||||||
916 | * never executed: pverifyctx_init = pmeth->verifyctx_init;*pverifyctx_init = pmeth->verifyctx_init; never executed: *pverifyctx_init = pmeth->verifyctx_init; | 0 | ||||||||||||||||||||||||
917 | if (pverifyctx
| 0 | ||||||||||||||||||||||||
918 | * never executed: pverifyctx = pmeth->verifyctx;*pverifyctx = pmeth->verifyctx; never executed: *pverifyctx = pmeth->verifyctx; | 0 | ||||||||||||||||||||||||
919 | } never executed: end of block | 0 | ||||||||||||||||||||||||
920 | - | |||||||||||||||||||||||||
921 | void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
922 | int (**pencrypt_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
923 | int (**pencryptfn) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
924 | unsigned char *out, | - | ||||||||||||||||||||||||
925 | size_t *outlen, | - | ||||||||||||||||||||||||
926 | const unsigned char *in, | - | ||||||||||||||||||||||||
927 | size_t inlen)) | - | ||||||||||||||||||||||||
928 | { | - | ||||||||||||||||||||||||
929 | if (pencrypt_init
| 0 | ||||||||||||||||||||||||
930 | * never executed: pencrypt_init = pmeth->encrypt_init;*pencrypt_init = pmeth->encrypt_init; never executed: *pencrypt_init = pmeth->encrypt_init; | 0 | ||||||||||||||||||||||||
931 | if (pencryptfn
| 0 | ||||||||||||||||||||||||
932 | * never executed: pencryptfn = pmeth->encrypt;*pencryptfn = pmeth->encrypt; never executed: *pencryptfn = pmeth->encrypt; | 0 | ||||||||||||||||||||||||
933 | } never executed: end of block | 0 | ||||||||||||||||||||||||
934 | - | |||||||||||||||||||||||||
935 | void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
936 | int (**pdecrypt_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
937 | int (**pdecrypt) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
938 | unsigned char *out, | - | ||||||||||||||||||||||||
939 | size_t *outlen, | - | ||||||||||||||||||||||||
940 | const unsigned char *in, | - | ||||||||||||||||||||||||
941 | size_t inlen)) | - | ||||||||||||||||||||||||
942 | { | - | ||||||||||||||||||||||||
943 | if (pdecrypt_init
| 0 | ||||||||||||||||||||||||
944 | * never executed: pdecrypt_init = pmeth->decrypt_init;*pdecrypt_init = pmeth->decrypt_init; never executed: *pdecrypt_init = pmeth->decrypt_init; | 0 | ||||||||||||||||||||||||
945 | if (pdecrypt
| 0 | ||||||||||||||||||||||||
946 | * never executed: pdecrypt = pmeth->decrypt;*pdecrypt = pmeth->decrypt; never executed: *pdecrypt = pmeth->decrypt; | 0 | ||||||||||||||||||||||||
947 | } never executed: end of block | 0 | ||||||||||||||||||||||||
948 | - | |||||||||||||||||||||||||
949 | void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
950 | int (**pderive_init) (EVP_PKEY_CTX *ctx), | - | ||||||||||||||||||||||||
951 | int (**pderive) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
952 | unsigned char *key, | - | ||||||||||||||||||||||||
953 | size_t *keylen)) | - | ||||||||||||||||||||||||
954 | { | - | ||||||||||||||||||||||||
955 | if (pderive_init
| 0 | ||||||||||||||||||||||||
956 | * never executed: pderive_init = pmeth->derive_init;*pderive_init = pmeth->derive_init; never executed: *pderive_init = pmeth->derive_init; | 0 | ||||||||||||||||||||||||
957 | if (pderive
| 0 | ||||||||||||||||||||||||
958 | * never executed: pderive = pmeth->derive;*pderive = pmeth->derive; never executed: *pderive = pmeth->derive; | 0 | ||||||||||||||||||||||||
959 | } never executed: end of block | 0 | ||||||||||||||||||||||||
960 | - | |||||||||||||||||||||||||
961 | void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
962 | int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, | - | ||||||||||||||||||||||||
963 | void *p2), | - | ||||||||||||||||||||||||
964 | int (**pctrl_str) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
965 | const char *type, | - | ||||||||||||||||||||||||
966 | const char *value)) | - | ||||||||||||||||||||||||
967 | { | - | ||||||||||||||||||||||||
968 | if (pctrl
| 0 | ||||||||||||||||||||||||
969 | * never executed: pctrl = pmeth->ctrl;*pctrl = pmeth->ctrl; never executed: *pctrl = pmeth->ctrl; | 0 | ||||||||||||||||||||||||
970 | if (pctrl_str
| 0 | ||||||||||||||||||||||||
971 | * never executed: pctrl_str = pmeth->ctrl_str;*pctrl_str = pmeth->ctrl_str; never executed: *pctrl_str = pmeth->ctrl_str; | 0 | ||||||||||||||||||||||||
972 | } never executed: end of block | 0 | ||||||||||||||||||||||||
973 | - | |||||||||||||||||||||||||
974 | void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
975 | int (**pcheck) (EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
976 | { | - | ||||||||||||||||||||||||
977 | if (pcheck !=
| 0 | ||||||||||||||||||||||||
978 | ((void *)0)
| 0 | ||||||||||||||||||||||||
979 | ) | - | ||||||||||||||||||||||||
980 | * never executed: pcheck = pmeth->check;*pcheck = pmeth->check; never executed: *pcheck = pmeth->check; | 0 | ||||||||||||||||||||||||
981 | } never executed: end of block | 0 | ||||||||||||||||||||||||
982 | - | |||||||||||||||||||||||||
983 | void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
984 | int (**pcheck) (EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
985 | { | - | ||||||||||||||||||||||||
986 | if (pcheck !=
| 0 | ||||||||||||||||||||||||
987 | ((void *)0)
| 0 | ||||||||||||||||||||||||
988 | ) | - | ||||||||||||||||||||||||
989 | * never executed: pcheck = pmeth->public_check;*pcheck = pmeth->public_check; never executed: *pcheck = pmeth->public_check; | 0 | ||||||||||||||||||||||||
990 | } never executed: end of block | 0 | ||||||||||||||||||||||||
991 | - | |||||||||||||||||||||||||
992 | void EVP_PKEY_meth_get_param_check(const EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
993 | int (**pcheck) (EVP_PKEY *pkey)) | - | ||||||||||||||||||||||||
994 | { | - | ||||||||||||||||||||||||
995 | if (pcheck !=
| 0 | ||||||||||||||||||||||||
996 | ((void *)0)
| 0 | ||||||||||||||||||||||||
997 | ) | - | ||||||||||||||||||||||||
998 | * never executed: pcheck = pmeth->param_check;*pcheck = pmeth->param_check; never executed: *pcheck = pmeth->param_check; | 0 | ||||||||||||||||||||||||
999 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1000 | - | |||||||||||||||||||||||||
1001 | void EVP_PKEY_meth_get_digest_custom(EVP_PKEY_METHOD *pmeth, | - | ||||||||||||||||||||||||
1002 | int (**pdigest_custom) (EVP_PKEY_CTX *ctx, | - | ||||||||||||||||||||||||
1003 | EVP_MD_CTX *mctx)) | - | ||||||||||||||||||||||||
1004 | { | - | ||||||||||||||||||||||||
1005 | if (pdigest_custom !=
| 0 | ||||||||||||||||||||||||
1006 | ((void *)0)
| 0 | ||||||||||||||||||||||||
1007 | ) | - | ||||||||||||||||||||||||
1008 | * never executed: pdigest_custom = pmeth->digest_custom;*pdigest_custom = pmeth->digest_custom; never executed: *pdigest_custom = pmeth->digest_custom; | 0 | ||||||||||||||||||||||||
1009 | } never executed: end of block | 0 | ||||||||||||||||||||||||
Switch to Source code | Preprocessed file |