Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/x509_lu.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method) | - | ||||||||||||||||||||||||
3 | { | - | ||||||||||||||||||||||||
4 | X509_LOOKUP *ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 20); | - | ||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | if (ret ==
| 0-2281 | ||||||||||||||||||||||||
7 | ((void *)0)
| 0-2281 | ||||||||||||||||||||||||
8 | ) { | - | ||||||||||||||||||||||||
9 | ERR_put_error(11,(155),((1|64)),__FILE__,23); | - | ||||||||||||||||||||||||
10 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
11 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
12 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
13 | } | - | ||||||||||||||||||||||||
14 | - | |||||||||||||||||||||||||
15 | ret->method = method; | - | ||||||||||||||||||||||||
16 | if (method->new_item !=
| 492-1789 | ||||||||||||||||||||||||
17 | ((void *)0)
| 492-1789 | ||||||||||||||||||||||||
18 | && method->new_item(ret) == 0
| 0-492 | ||||||||||||||||||||||||
19 | CRYPTO_free(ret, __FILE__, 29); | - | ||||||||||||||||||||||||
20 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
21 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
22 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
23 | } | - | ||||||||||||||||||||||||
24 | return executed 2281 times by 1 test: ret;return ret; Executed by:
executed 2281 times by 1 test: return ret; Executed by:
| 2281 | ||||||||||||||||||||||||
25 | } | - | ||||||||||||||||||||||||
26 | - | |||||||||||||||||||||||||
27 | void X509_LOOKUP_free(X509_LOOKUP *ctx) | - | ||||||||||||||||||||||||
28 | { | - | ||||||||||||||||||||||||
29 | if (ctx ==
| 0-2281 | ||||||||||||||||||||||||
30 | ((void *)0)
| 0-2281 | ||||||||||||||||||||||||
31 | ) | - | ||||||||||||||||||||||||
32 | return; never executed: return; | 0 | ||||||||||||||||||||||||
33 | if ((
| 0-2281 | ||||||||||||||||||||||||
34 | ((void *)0)
| 0-2281 | ||||||||||||||||||||||||
35 | )
| 0-2281 | ||||||||||||||||||||||||
36 | ((void *)0)
| 492-1789 | ||||||||||||||||||||||||
37 | )
| 492-1789 | ||||||||||||||||||||||||
38 | (* executed 492 times by 1 test: ctx->method->free) (ctx);(*ctx->method->free) (ctx); Executed by:
executed 492 times by 1 test: (*ctx->method->free) (ctx); Executed by:
| 492 | ||||||||||||||||||||||||
39 | CRYPTO_free(ctx, __FILE__, 41); | - | ||||||||||||||||||||||||
40 | } executed 2281 times by 1 test: end of block Executed by:
| 2281 | ||||||||||||||||||||||||
41 | - | |||||||||||||||||||||||||
42 | int X509_STORE_lock(X509_STORE *s) | - | ||||||||||||||||||||||||
43 | { | - | ||||||||||||||||||||||||
44 | return never executed: CRYPTO_THREAD_write_lock(s->lock);return CRYPTO_THREAD_write_lock(s->lock); never executed: return CRYPTO_THREAD_write_lock(s->lock); | 0 | ||||||||||||||||||||||||
45 | } | - | ||||||||||||||||||||||||
46 | - | |||||||||||||||||||||||||
47 | int X509_STORE_unlock(X509_STORE *s) | - | ||||||||||||||||||||||||
48 | { | - | ||||||||||||||||||||||||
49 | return never executed: CRYPTO_THREAD_unlock(s->lock);return CRYPTO_THREAD_unlock(s->lock); never executed: return CRYPTO_THREAD_unlock(s->lock); | 0 | ||||||||||||||||||||||||
50 | } | - | ||||||||||||||||||||||||
51 | - | |||||||||||||||||||||||||
52 | int X509_LOOKUP_init(X509_LOOKUP *ctx) | - | ||||||||||||||||||||||||
53 | { | - | ||||||||||||||||||||||||
54 | if (ctx->method ==
| 0 | ||||||||||||||||||||||||
55 | ((void *)0)
| 0 | ||||||||||||||||||||||||
56 | ) | - | ||||||||||||||||||||||||
57 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
58 | if (ctx->method->init !=
| 0 | ||||||||||||||||||||||||
59 | ((void *)0)
| 0 | ||||||||||||||||||||||||
60 | ) | - | ||||||||||||||||||||||||
61 | return never executed: ctx->method->init(ctx);return ctx->method->init(ctx); never executed: return ctx->method->init(ctx); | 0 | ||||||||||||||||||||||||
62 | else | - | ||||||||||||||||||||||||
63 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
64 | } | - | ||||||||||||||||||||||||
65 | - | |||||||||||||||||||||||||
66 | int X509_LOOKUP_shutdown(X509_LOOKUP *ctx) | - | ||||||||||||||||||||||||
67 | { | - | ||||||||||||||||||||||||
68 | if (ctx->method ==
| 0-2281 | ||||||||||||||||||||||||
69 | ((void *)0)
| 0-2281 | ||||||||||||||||||||||||
70 | ) | - | ||||||||||||||||||||||||
71 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
72 | if (ctx->method->shutdown !=
| 0-2281 | ||||||||||||||||||||||||
73 | ((void *)0)
| 0-2281 | ||||||||||||||||||||||||
74 | ) | - | ||||||||||||||||||||||||
75 | return never executed: ctx->method->shutdown(ctx);return ctx->method->shutdown(ctx); never executed: return ctx->method->shutdown(ctx); | 0 | ||||||||||||||||||||||||
76 | else | - | ||||||||||||||||||||||||
77 | return executed 2281 times by 1 test: 1;return 1; Executed by:
executed 2281 times by 1 test: return 1; Executed by:
| 2281 | ||||||||||||||||||||||||
78 | } | - | ||||||||||||||||||||||||
79 | - | |||||||||||||||||||||||||
80 | int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, | - | ||||||||||||||||||||||||
81 | char **ret) | - | ||||||||||||||||||||||||
82 | { | - | ||||||||||||||||||||||||
83 | if (ctx->method ==
| 0-2292 | ||||||||||||||||||||||||
84 | ((void *)0)
| 0-2292 | ||||||||||||||||||||||||
85 | ) | - | ||||||||||||||||||||||||
86 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
87 | if (ctx->method->ctrl !=
| 0-2292 | ||||||||||||||||||||||||
88 | ((void *)0)
| 0-2292 | ||||||||||||||||||||||||
89 | ) | - | ||||||||||||||||||||||||
90 | return executed 2292 times by 1 test: ctx->method->ctrl(ctx, cmd, argc, argl, ret);return ctx->method->ctrl(ctx, cmd, argc, argl, ret); Executed by:
executed 2292 times by 1 test: return ctx->method->ctrl(ctx, cmd, argc, argl, ret); Executed by:
| 2292 | ||||||||||||||||||||||||
91 | else | - | ||||||||||||||||||||||||
92 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
93 | } | - | ||||||||||||||||||||||||
94 | - | |||||||||||||||||||||||||
95 | int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, | - | ||||||||||||||||||||||||
96 | X509_NAME *name, X509_OBJECT *ret) | - | ||||||||||||||||||||||||
97 | { | - | ||||||||||||||||||||||||
98 | if ((
| 0-857 | ||||||||||||||||||||||||
99 | ((void *)0)
| 0-857 | ||||||||||||||||||||||||
100 | )
| 0-857 | ||||||||||||||||||||||||
101 | ((void *)0)
| 396-461 | ||||||||||||||||||||||||
102 | )
| 396-461 | ||||||||||||||||||||||||
103 | return executed 461 times by 1 test: 0;return 0; Executed by:
executed 461 times by 1 test: return 0; Executed by:
| 461 | ||||||||||||||||||||||||
104 | if (ctx->skip
| 0-396 | ||||||||||||||||||||||||
105 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
106 | return executed 396 times by 1 test: ctx->method->get_by_subject(ctx, type, name, ret);return ctx->method->get_by_subject(ctx, type, name, ret); Executed by:
executed 396 times by 1 test: return ctx->method->get_by_subject(ctx, type, name, ret); Executed by:
| 396 | ||||||||||||||||||||||||
107 | } | - | ||||||||||||||||||||||||
108 | - | |||||||||||||||||||||||||
109 | int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, | - | ||||||||||||||||||||||||
110 | X509_NAME *name, ASN1_INTEGER *serial, | - | ||||||||||||||||||||||||
111 | X509_OBJECT *ret) | - | ||||||||||||||||||||||||
112 | { | - | ||||||||||||||||||||||||
113 | if ((
| 0 | ||||||||||||||||||||||||
114 | ((void *)0)
| 0 | ||||||||||||||||||||||||
115 | )
| 0 | ||||||||||||||||||||||||
116 | ((void *)0)
| 0 | ||||||||||||||||||||||||
117 | )
| 0 | ||||||||||||||||||||||||
118 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
119 | return never executed: ctx->method->get_by_issuer_serial(ctx, type, name, serial, ret);return ctx->method->get_by_issuer_serial(ctx, type, name, serial, ret); never executed: return ctx->method->get_by_issuer_serial(ctx, type, name, serial, ret); | 0 | ||||||||||||||||||||||||
120 | } | - | ||||||||||||||||||||||||
121 | - | |||||||||||||||||||||||||
122 | int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, | - | ||||||||||||||||||||||||
123 | const unsigned char *bytes, int len, | - | ||||||||||||||||||||||||
124 | X509_OBJECT *ret) | - | ||||||||||||||||||||||||
125 | { | - | ||||||||||||||||||||||||
126 | if ((
| 0 | ||||||||||||||||||||||||
127 | ((void *)0)
| 0 | ||||||||||||||||||||||||
128 | )
| 0 | ||||||||||||||||||||||||
129 | ((void *)0)
| 0 | ||||||||||||||||||||||||
130 | )
| 0 | ||||||||||||||||||||||||
131 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
132 | return never executed: ctx->method->get_by_fingerprint(ctx, type, bytes, len, ret);return ctx->method->get_by_fingerprint(ctx, type, bytes, len, ret); never executed: return ctx->method->get_by_fingerprint(ctx, type, bytes, len, ret); | 0 | ||||||||||||||||||||||||
133 | } | - | ||||||||||||||||||||||||
134 | - | |||||||||||||||||||||||||
135 | int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, | - | ||||||||||||||||||||||||
136 | const char *str, int len, X509_OBJECT *ret) | - | ||||||||||||||||||||||||
137 | { | - | ||||||||||||||||||||||||
138 | if ((
| 0 | ||||||||||||||||||||||||
139 | ((void *)0)
| 0 | ||||||||||||||||||||||||
140 | )
| 0 | ||||||||||||||||||||||||
141 | ((void *)0)
| 0 | ||||||||||||||||||||||||
142 | )
| 0 | ||||||||||||||||||||||||
143 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
144 | return never executed: ctx->method->get_by_alias(ctx, type, str, len, ret);return ctx->method->get_by_alias(ctx, type, str, len, ret); never executed: return ctx->method->get_by_alias(ctx, type, str, len, ret); | 0 | ||||||||||||||||||||||||
145 | } | - | ||||||||||||||||||||||||
146 | - | |||||||||||||||||||||||||
147 | int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data) | - | ||||||||||||||||||||||||
148 | { | - | ||||||||||||||||||||||||
149 | ctx->method_data = data; | - | ||||||||||||||||||||||||
150 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
151 | } | - | ||||||||||||||||||||||||
152 | - | |||||||||||||||||||||||||
153 | void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx) | - | ||||||||||||||||||||||||
154 | { | - | ||||||||||||||||||||||||
155 | return never executed: ctx->method_data;return ctx->method_data; never executed: return ctx->method_data; | 0 | ||||||||||||||||||||||||
156 | } | - | ||||||||||||||||||||||||
157 | - | |||||||||||||||||||||||||
158 | X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx) | - | ||||||||||||||||||||||||
159 | { | - | ||||||||||||||||||||||||
160 | return never executed: ctx->store_ctx;return ctx->store_ctx; never executed: return ctx->store_ctx; | 0 | ||||||||||||||||||||||||
161 | } | - | ||||||||||||||||||||||||
162 | - | |||||||||||||||||||||||||
163 | - | |||||||||||||||||||||||||
164 | static int x509_object_cmp(const X509_OBJECT *const *a, | - | ||||||||||||||||||||||||
165 | const X509_OBJECT *const *b) | - | ||||||||||||||||||||||||
166 | { | - | ||||||||||||||||||||||||
167 | int ret; | - | ||||||||||||||||||||||||
168 | - | |||||||||||||||||||||||||
169 | ret = ((*a)->type - (*b)->type); | - | ||||||||||||||||||||||||
170 | if (ret
| 0-1197 | ||||||||||||||||||||||||
171 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
172 | switch ((*a)->type) { | - | ||||||||||||||||||||||||
173 | case executed 1197 times by 1 test: X509_LU_X509:case X509_LU_X509: Executed by:
executed 1197 times by 1 test: case X509_LU_X509: Executed by:
| 1197 | ||||||||||||||||||||||||
174 | ret = X509_subject_name_cmp((*a)->data.x509, (*b)->data.x509); | - | ||||||||||||||||||||||||
175 | break; executed 1197 times by 1 test: break; Executed by:
| 1197 | ||||||||||||||||||||||||
176 | case never executed: X509_LU_CRL:case X509_LU_CRL: never executed: case X509_LU_CRL: | 0 | ||||||||||||||||||||||||
177 | ret = X509_CRL_cmp((*a)->data.crl, (*b)->data.crl); | - | ||||||||||||||||||||||||
178 | break; never executed: break; | 0 | ||||||||||||||||||||||||
179 | case never executed: X509_LU_NONE:case X509_LU_NONE: never executed: case X509_LU_NONE: | 0 | ||||||||||||||||||||||||
180 | - | |||||||||||||||||||||||||
181 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
182 | } | - | ||||||||||||||||||||||||
183 | return executed 1197 times by 1 test: ret;return ret; Executed by:
executed 1197 times by 1 test: return ret; Executed by:
| 1197 | ||||||||||||||||||||||||
184 | } | - | ||||||||||||||||||||||||
185 | - | |||||||||||||||||||||||||
186 | X509_STORE *X509_STORE_new(void) | - | ||||||||||||||||||||||||
187 | { | - | ||||||||||||||||||||||||
188 | X509_STORE *ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 162); | - | ||||||||||||||||||||||||
189 | - | |||||||||||||||||||||||||
190 | if (ret ==
| 0-9559 | ||||||||||||||||||||||||
191 | ((void *)0)
| 0-9559 | ||||||||||||||||||||||||
192 | ) { | - | ||||||||||||||||||||||||
193 | ERR_put_error(11,(158),((1|64)),__FILE__,165); | - | ||||||||||||||||||||||||
194 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
195 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
196 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
197 | } | - | ||||||||||||||||||||||||
198 | if ((
| 0-9559 | ||||||||||||||||||||||||
199 | ((void *)0)
| 0-9559 | ||||||||||||||||||||||||
200 | ) { | - | ||||||||||||||||||||||||
201 | ERR_put_error(11,(158),((1|64)),__FILE__,169); | - | ||||||||||||||||||||||||
202 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
203 | } | - | ||||||||||||||||||||||||
204 | ret->cache = 1; | - | ||||||||||||||||||||||||
205 | if ((
| 0-9559 | ||||||||||||||||||||||||
206 | ((void *)0)
| 0-9559 | ||||||||||||||||||||||||
207 | ) { | - | ||||||||||||||||||||||||
208 | ERR_put_error(11,(158),((1|64)),__FILE__,174); | - | ||||||||||||||||||||||||
209 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
210 | } | - | ||||||||||||||||||||||||
211 | - | |||||||||||||||||||||||||
212 | if ((
| 0-9559 | ||||||||||||||||||||||||
213 | ((void *)0)
| 0-9559 | ||||||||||||||||||||||||
214 | ) { | - | ||||||||||||||||||||||||
215 | ERR_put_error(11,(158),((1|64)),__FILE__,179); | - | ||||||||||||||||||||||||
216 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
217 | } | - | ||||||||||||||||||||||||
218 | if (!CRYPTO_new_ex_data(4, ret, &ret->ex_data)
| 0-9559 | ||||||||||||||||||||||||
219 | ERR_put_error(11,(158),((1|64)),__FILE__,183); | - | ||||||||||||||||||||||||
220 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
221 | } | - | ||||||||||||||||||||||||
222 | - | |||||||||||||||||||||||||
223 | ret->lock = CRYPTO_THREAD_lock_new(); | - | ||||||||||||||||||||||||
224 | if (ret->lock ==
| 0-9559 | ||||||||||||||||||||||||
225 | ((void *)0)
| 0-9559 | ||||||||||||||||||||||||
226 | ) { | - | ||||||||||||||||||||||||
227 | ERR_put_error(11,(158),((1|64)),__FILE__,189); | - | ||||||||||||||||||||||||
228 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
229 | } | - | ||||||||||||||||||||||||
230 | - | |||||||||||||||||||||||||
231 | ret->references = 1; | - | ||||||||||||||||||||||||
232 | return executed 9559 times by 1 test: ret;return ret; Executed by:
executed 9559 times by 1 test: return ret; Executed by:
| 9559 | ||||||||||||||||||||||||
233 | - | |||||||||||||||||||||||||
234 | err: | - | ||||||||||||||||||||||||
235 | X509_VERIFY_PARAM_free(ret->param); | - | ||||||||||||||||||||||||
236 | sk_X509_OBJECT_free(ret->objs); | - | ||||||||||||||||||||||||
237 | sk_X509_LOOKUP_free(ret->get_cert_methods); | - | ||||||||||||||||||||||||
238 | CRYPTO_free(ret, __FILE__, 200); | - | ||||||||||||||||||||||||
239 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
240 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
241 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
242 | } | - | ||||||||||||||||||||||||
243 | - | |||||||||||||||||||||||||
244 | void X509_STORE_free(X509_STORE *vfy) | - | ||||||||||||||||||||||||
245 | { | - | ||||||||||||||||||||||||
246 | int i; | - | ||||||||||||||||||||||||
247 | struct stack_st_X509_LOOKUP *sk; | - | ||||||||||||||||||||||||
248 | X509_LOOKUP *lu; | - | ||||||||||||||||||||||||
249 | - | |||||||||||||||||||||||||
250 | if (vfy ==
| 10798-30954 | ||||||||||||||||||||||||
251 | ((void *)0)
| 10798-30954 | ||||||||||||||||||||||||
252 | ) | - | ||||||||||||||||||||||||
253 | return; executed 30954 times by 1 test: return; Executed by:
| 30954 | ||||||||||||||||||||||||
254 | CRYPTO_DOWN_REF(&vfy->references, &i, vfy->lock); | - | ||||||||||||||||||||||||
255 | ; | - | ||||||||||||||||||||||||
256 | if (i > 0
| 1239-9559 | ||||||||||||||||||||||||
257 | return; executed 1239 times by 1 test: return; Executed by:
| 1239 | ||||||||||||||||||||||||
258 | ; | - | ||||||||||||||||||||||||
259 | - | |||||||||||||||||||||||||
260 | sk = vfy->get_cert_methods; | - | ||||||||||||||||||||||||
261 | for (i = 0; i < sk_X509_LOOKUP_num(sk)
| 2281-9559 | ||||||||||||||||||||||||
262 | lu = sk_X509_LOOKUP_value(sk, i); | - | ||||||||||||||||||||||||
263 | X509_LOOKUP_shutdown(lu); | - | ||||||||||||||||||||||||
264 | X509_LOOKUP_free(lu); | - | ||||||||||||||||||||||||
265 | } executed 2281 times by 1 test: end of block Executed by:
| 2281 | ||||||||||||||||||||||||
266 | sk_X509_LOOKUP_free(sk); | - | ||||||||||||||||||||||||
267 | sk_X509_OBJECT_pop_free(vfy->objs, X509_OBJECT_free); | - | ||||||||||||||||||||||||
268 | - | |||||||||||||||||||||||||
269 | CRYPTO_free_ex_data(4, vfy, &vfy->ex_data); | - | ||||||||||||||||||||||||
270 | X509_VERIFY_PARAM_free(vfy->param); | - | ||||||||||||||||||||||||
271 | CRYPTO_THREAD_lock_free(vfy->lock); | - | ||||||||||||||||||||||||
272 | CRYPTO_free(vfy, __FILE__, 230); | - | ||||||||||||||||||||||||
273 | } executed 9559 times by 1 test: end of block Executed by:
| 9559 | ||||||||||||||||||||||||
274 | - | |||||||||||||||||||||||||
275 | int X509_STORE_up_ref(X509_STORE *vfy) | - | ||||||||||||||||||||||||
276 | { | - | ||||||||||||||||||||||||
277 | int i; | - | ||||||||||||||||||||||||
278 | - | |||||||||||||||||||||||||
279 | if (CRYPTO_UP_REF(&vfy->references, &i, vfy->lock) <= 0
| 0-1239 | ||||||||||||||||||||||||
280 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
281 | - | |||||||||||||||||||||||||
282 | ; | - | ||||||||||||||||||||||||
283 | ; | - | ||||||||||||||||||||||||
284 | return executed 1239 times by 1 test: ((return ((i > 1) ? 1 : 0); Executed by:
executed 1239 times by 1 test: return ((i > 1) ? 1 : 0); Executed by:
| 0-1239 | ||||||||||||||||||||||||
285 | } | - | ||||||||||||||||||||||||
286 | - | |||||||||||||||||||||||||
287 | X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) | - | ||||||||||||||||||||||||
288 | { | - | ||||||||||||||||||||||||
289 | int i; | - | ||||||||||||||||||||||||
290 | struct stack_st_X509_LOOKUP *sk; | - | ||||||||||||||||||||||||
291 | X509_LOOKUP *lu; | - | ||||||||||||||||||||||||
292 | - | |||||||||||||||||||||||||
293 | sk = v->get_cert_methods; | - | ||||||||||||||||||||||||
294 | for (i = 0; i < sk_X509_LOOKUP_num(sk)
| 504-2281 | ||||||||||||||||||||||||
295 | lu = sk_X509_LOOKUP_value(sk, i); | - | ||||||||||||||||||||||||
296 | if (m == lu->method
| 12-492 | ||||||||||||||||||||||||
297 | return executed 12 times by 1 test: lu;return lu; Executed by:
executed 12 times by 1 test: return lu; Executed by:
| 12 | ||||||||||||||||||||||||
298 | } | - | ||||||||||||||||||||||||
299 | } executed 492 times by 1 test: end of block Executed by:
| 492 | ||||||||||||||||||||||||
300 | - | |||||||||||||||||||||||||
301 | lu = X509_LOOKUP_new(m); | - | ||||||||||||||||||||||||
302 | if (lu ==
| 0-2281 | ||||||||||||||||||||||||
303 | ((void *)0)
| 0-2281 | ||||||||||||||||||||||||
304 | ) { | - | ||||||||||||||||||||||||
305 | ERR_put_error(11,(157),((1|64)),__FILE__,261); | - | ||||||||||||||||||||||||
306 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
307 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
308 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
309 | } | - | ||||||||||||||||||||||||
310 | - | |||||||||||||||||||||||||
311 | lu->store_ctx = v; | - | ||||||||||||||||||||||||
312 | if (sk_X509_LOOKUP_push(v->get_cert_methods, lu)
| 0-2281 | ||||||||||||||||||||||||
313 | return executed 2281 times by 1 test: lu;return lu; Executed by:
executed 2281 times by 1 test: return lu; Executed by:
| 2281 | ||||||||||||||||||||||||
314 | - | |||||||||||||||||||||||||
315 | ERR_put_error(11,(157),((1|64)),__FILE__,269); | - | ||||||||||||||||||||||||
316 | X509_LOOKUP_free(lu); | - | ||||||||||||||||||||||||
317 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
318 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
319 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
320 | } | - | ||||||||||||||||||||||||
321 | - | |||||||||||||||||||||||||
322 | X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs, | - | ||||||||||||||||||||||||
323 | X509_LOOKUP_TYPE type, | - | ||||||||||||||||||||||||
324 | X509_NAME *name) | - | ||||||||||||||||||||||||
325 | { | - | ||||||||||||||||||||||||
326 | X509_OBJECT *ret = X509_OBJECT_new(); | - | ||||||||||||||||||||||||
327 | - | |||||||||||||||||||||||||
328 | if (ret ==
| 0 | ||||||||||||||||||||||||
329 | ((void *)0)
| 0 | ||||||||||||||||||||||||
330 | ) | - | ||||||||||||||||||||||||
331 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
332 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
333 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
334 | if (!X509_STORE_CTX_get_by_subject(vs, type, name, ret)
| 0 | ||||||||||||||||||||||||
335 | X509_OBJECT_free(ret); | - | ||||||||||||||||||||||||
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 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
341 | } | - | ||||||||||||||||||||||||
342 | - | |||||||||||||||||||||||||
343 | int X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, | - | ||||||||||||||||||||||||
344 | X509_NAME *name, X509_OBJECT *ret) | - | ||||||||||||||||||||||||
345 | { | - | ||||||||||||||||||||||||
346 | X509_STORE *ctx = vs->ctx; | - | ||||||||||||||||||||||||
347 | X509_LOOKUP *lu; | - | ||||||||||||||||||||||||
348 | X509_OBJECT stmp, *tmp; | - | ||||||||||||||||||||||||
349 | int i, j; | - | ||||||||||||||||||||||||
350 | - | |||||||||||||||||||||||||
351 | if (ctx ==
| 1-6504 | ||||||||||||||||||||||||
352 | ((void *)0)
| 1-6504 | ||||||||||||||||||||||||
353 | ) | - | ||||||||||||||||||||||||
354 | return executed 1 time by 1 test: 0;return 0; Executed by:
executed 1 time by 1 test: return 0; Executed by:
| 1 | ||||||||||||||||||||||||
355 | - | |||||||||||||||||||||||||
356 | CRYPTO_THREAD_write_lock(ctx->lock); | - | ||||||||||||||||||||||||
357 | tmp = X509_OBJECT_retrieve_by_subject(ctx->objs, type, name); | - | ||||||||||||||||||||||||
358 | CRYPTO_THREAD_unlock(ctx->lock); | - | ||||||||||||||||||||||||
359 | - | |||||||||||||||||||||||||
360 | if (tmp ==
| 1101-5403 | ||||||||||||||||||||||||
361 | ((void *)0)
| 1101-5403 | ||||||||||||||||||||||||
362 | || type == X509_LU_CRL
| 0-1101 | ||||||||||||||||||||||||
363 | for (i = 0; i < sk_X509_LOOKUP_num(ctx->get_cert_methods)
| 857-5403 | ||||||||||||||||||||||||
364 | lu = sk_X509_LOOKUP_value(ctx->get_cert_methods, i); | - | ||||||||||||||||||||||||
365 | j = X509_LOOKUP_by_subject(lu, type, name, &stmp); | - | ||||||||||||||||||||||||
366 | if (j
| 0-857 | ||||||||||||||||||||||||
367 | tmp = &stmp; | - | ||||||||||||||||||||||||
368 | break; never executed: break; | 0 | ||||||||||||||||||||||||
369 | } | - | ||||||||||||||||||||||||
370 | } executed 857 times by 1 test: end of block Executed by:
| 857 | ||||||||||||||||||||||||
371 | if (tmp ==
| 0-5403 | ||||||||||||||||||||||||
372 | ((void *)0)
| 0-5403 | ||||||||||||||||||||||||
373 | ) | - | ||||||||||||||||||||||||
374 | return executed 5403 times by 1 test: 0;return 0; Executed by:
executed 5403 times by 1 test: return 0; Executed by:
| 5403 | ||||||||||||||||||||||||
375 | } never executed: end of block | 0 | ||||||||||||||||||||||||
376 | - | |||||||||||||||||||||||||
377 | ret->type = tmp->type; | - | ||||||||||||||||||||||||
378 | ret->data.ptr = tmp->data.ptr; | - | ||||||||||||||||||||||||
379 | - | |||||||||||||||||||||||||
380 | X509_OBJECT_up_ref_count(ret); | - | ||||||||||||||||||||||||
381 | - | |||||||||||||||||||||||||
382 | return executed 1101 times by 1 test: 1;return 1; Executed by:
executed 1101 times by 1 test: return 1; Executed by:
| 1101 | ||||||||||||||||||||||||
383 | } | - | ||||||||||||||||||||||||
384 | - | |||||||||||||||||||||||||
385 | static int x509_store_add(X509_STORE *ctx, void *x, int crl) { | - | ||||||||||||||||||||||||
386 | X509_OBJECT *obj; | - | ||||||||||||||||||||||||
387 | int ret = 0, added = 0; | - | ||||||||||||||||||||||||
388 | - | |||||||||||||||||||||||||
389 | if (x ==
| 0-1368 | ||||||||||||||||||||||||
390 | ((void *)0)
| 0-1368 | ||||||||||||||||||||||||
391 | ) | - | ||||||||||||||||||||||||
392 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
393 | obj = X509_OBJECT_new(); | - | ||||||||||||||||||||||||
394 | if (obj ==
| 0-1368 | ||||||||||||||||||||||||
395 | ((void *)0)
| 0-1368 | ||||||||||||||||||||||||
396 | ) | - | ||||||||||||||||||||||||
397 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
398 | - | |||||||||||||||||||||||||
399 | if (crl
| 0-1368 | ||||||||||||||||||||||||
400 | obj->type = X509_LU_CRL; | - | ||||||||||||||||||||||||
401 | obj->data.crl = (X509_CRL *)x; | - | ||||||||||||||||||||||||
402 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
403 | obj->type = X509_LU_X509; | - | ||||||||||||||||||||||||
404 | obj->data.x509 = (X509 *)x; | - | ||||||||||||||||||||||||
405 | } executed 1368 times by 1 test: end of block Executed by:
| 1368 | ||||||||||||||||||||||||
406 | X509_OBJECT_up_ref_count(obj); | - | ||||||||||||||||||||||||
407 | - | |||||||||||||||||||||||||
408 | CRYPTO_THREAD_write_lock(ctx->lock); | - | ||||||||||||||||||||||||
409 | - | |||||||||||||||||||||||||
410 | if (X509_OBJECT_retrieve_match(ctx->objs, obj)
| 1-1367 | ||||||||||||||||||||||||
411 | ret = 1; | - | ||||||||||||||||||||||||
412 | } executed 1 time by 1 test: else {end of block Executed by:
| 1 | ||||||||||||||||||||||||
413 | added = sk_X509_OBJECT_push(ctx->objs, obj); | - | ||||||||||||||||||||||||
414 | ret = added != 0; | - | ||||||||||||||||||||||||
415 | } executed 1367 times by 1 test: end of block Executed by:
| 1367 | ||||||||||||||||||||||||
416 | - | |||||||||||||||||||||||||
417 | CRYPTO_THREAD_unlock(ctx->lock); | - | ||||||||||||||||||||||||
418 | - | |||||||||||||||||||||||||
419 | if (added == 0
| 1-1367 | ||||||||||||||||||||||||
420 | X509_OBJECT_free(obj); executed 1 time by 1 test: X509_OBJECT_free(obj); Executed by:
| 1 | ||||||||||||||||||||||||
421 | - | |||||||||||||||||||||||||
422 | return executed 1368 times by 1 test: ret;return ret; Executed by:
executed 1368 times by 1 test: return ret; Executed by:
| 1368 | ||||||||||||||||||||||||
423 | } | - | ||||||||||||||||||||||||
424 | - | |||||||||||||||||||||||||
425 | int X509_STORE_add_cert(X509_STORE *ctx, X509 *x) | - | ||||||||||||||||||||||||
426 | { | - | ||||||||||||||||||||||||
427 | if (!x509_store_add(ctx, x, 0)
| 0-1368 | ||||||||||||||||||||||||
428 | ERR_put_error(11,(124),((1|64)),__FILE__,364); | - | ||||||||||||||||||||||||
429 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
430 | } | - | ||||||||||||||||||||||||
431 | return executed 1368 times by 1 test: 1;return 1; Executed by:
executed 1368 times by 1 test: return 1; Executed by:
| 1368 | ||||||||||||||||||||||||
432 | } | - | ||||||||||||||||||||||||
433 | - | |||||||||||||||||||||||||
434 | int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x) | - | ||||||||||||||||||||||||
435 | { | - | ||||||||||||||||||||||||
436 | if (!x509_store_add(ctx, x, 1)
| 0 | ||||||||||||||||||||||||
437 | ERR_put_error(11,(125),((1|64)),__FILE__,373); | - | ||||||||||||||||||||||||
438 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
439 | } | - | ||||||||||||||||||||||||
440 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
441 | } | - | ||||||||||||||||||||||||
442 | - | |||||||||||||||||||||||||
443 | int X509_OBJECT_up_ref_count(X509_OBJECT *a) | - | ||||||||||||||||||||||||
444 | { | - | ||||||||||||||||||||||||
445 | switch (a->type) { | - | ||||||||||||||||||||||||
446 | case never executed: X509_LU_NONE:case X509_LU_NONE: never executed: case X509_LU_NONE: | 0 | ||||||||||||||||||||||||
447 | break; never executed: break; | 0 | ||||||||||||||||||||||||
448 | case executed 2469 times by 1 test: X509_LU_X509:case X509_LU_X509: Executed by:
executed 2469 times by 1 test: case X509_LU_X509: Executed by:
| 2469 | ||||||||||||||||||||||||
449 | return executed 2469 times by 1 test: X509_up_ref(a->data.x509);return X509_up_ref(a->data.x509); Executed by:
executed 2469 times by 1 test: return X509_up_ref(a->data.x509); Executed by:
| 2469 | ||||||||||||||||||||||||
450 | case never executed: X509_LU_CRL:case X509_LU_CRL: never executed: case X509_LU_CRL: | 0 | ||||||||||||||||||||||||
451 | return never executed: X509_CRL_up_ref(a->data.crl);return X509_CRL_up_ref(a->data.crl); never executed: return X509_CRL_up_ref(a->data.crl); | 0 | ||||||||||||||||||||||||
452 | } | - | ||||||||||||||||||||||||
453 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
454 | } | - | ||||||||||||||||||||||||
455 | - | |||||||||||||||||||||||||
456 | X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a) | - | ||||||||||||||||||||||||
457 | { | - | ||||||||||||||||||||||||
458 | if (a ==
| 0 | ||||||||||||||||||||||||
459 | ((void *)0)
| 0 | ||||||||||||||||||||||||
460 | || a->type != X509_LU_X509
| 0 | ||||||||||||||||||||||||
461 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
462 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
463 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
464 | return never executed: a->data.x509;return a->data.x509; never executed: return a->data.x509; | 0 | ||||||||||||||||||||||||
465 | } | - | ||||||||||||||||||||||||
466 | - | |||||||||||||||||||||||||
467 | X509_CRL *X509_OBJECT_get0_X509_CRL(X509_OBJECT *a) | - | ||||||||||||||||||||||||
468 | { | - | ||||||||||||||||||||||||
469 | if (a ==
| 0 | ||||||||||||||||||||||||
470 | ((void *)0)
| 0 | ||||||||||||||||||||||||
471 | || a->type != X509_LU_CRL
| 0 | ||||||||||||||||||||||||
472 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
473 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
474 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
475 | return never executed: a->data.crl;return a->data.crl; never executed: return a->data.crl; | 0 | ||||||||||||||||||||||||
476 | } | - | ||||||||||||||||||||||||
477 | - | |||||||||||||||||||||||||
478 | X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a) | - | ||||||||||||||||||||||||
479 | { | - | ||||||||||||||||||||||||
480 | return never executed: a->type;return a->type; never executed: return a->type; | 0 | ||||||||||||||||||||||||
481 | } | - | ||||||||||||||||||||||||
482 | - | |||||||||||||||||||||||||
483 | X509_OBJECT *X509_OBJECT_new(void) | - | ||||||||||||||||||||||||
484 | { | - | ||||||||||||||||||||||||
485 | X509_OBJECT *ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 413); | - | ||||||||||||||||||||||||
486 | - | |||||||||||||||||||||||||
487 | if (ret ==
| 0-7873 | ||||||||||||||||||||||||
488 | ((void *)0)
| 0-7873 | ||||||||||||||||||||||||
489 | ) { | - | ||||||||||||||||||||||||
490 | ERR_put_error(11,(150),((1|64)),__FILE__,416); | - | ||||||||||||||||||||||||
491 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
492 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
493 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
494 | } | - | ||||||||||||||||||||||||
495 | ret->type = X509_LU_NONE; | - | ||||||||||||||||||||||||
496 | return executed 7873 times by 1 test: ret;return ret; Executed by:
executed 7873 times by 1 test: return ret; Executed by:
| 7873 | ||||||||||||||||||||||||
497 | } | - | ||||||||||||||||||||||||
498 | - | |||||||||||||||||||||||||
499 | static void x509_object_free_internal(X509_OBJECT *a) | - | ||||||||||||||||||||||||
500 | { | - | ||||||||||||||||||||||||
501 | if (a ==
| 0-7873 | ||||||||||||||||||||||||
502 | ((void *)0)
| 0-7873 | ||||||||||||||||||||||||
503 | ) | - | ||||||||||||||||||||||||
504 | return; never executed: return; | 0 | ||||||||||||||||||||||||
505 | switch (a->type) { | - | ||||||||||||||||||||||||
506 | case executed 5404 times by 1 test: X509_LU_NONE:case X509_LU_NONE: Executed by:
executed 5404 times by 1 test: case X509_LU_NONE: Executed by:
| 5404 | ||||||||||||||||||||||||
507 | break; executed 5404 times by 1 test: break; Executed by:
| 5404 | ||||||||||||||||||||||||
508 | case executed 2469 times by 1 test: X509_LU_X509:case X509_LU_X509: Executed by:
executed 2469 times by 1 test: case X509_LU_X509: Executed by:
| 2469 | ||||||||||||||||||||||||
509 | X509_free(a->data.x509); | - | ||||||||||||||||||||||||
510 | break; executed 2469 times by 1 test: break; Executed by:
| 2469 | ||||||||||||||||||||||||
511 | case never executed: X509_LU_CRL:case X509_LU_CRL: never executed: case X509_LU_CRL: | 0 | ||||||||||||||||||||||||
512 | X509_CRL_free(a->data.crl); | - | ||||||||||||||||||||||||
513 | break; never executed: break; | 0 | ||||||||||||||||||||||||
514 | } | - | ||||||||||||||||||||||||
515 | } executed 7873 times by 1 test: end of block Executed by:
| 7873 | ||||||||||||||||||||||||
516 | - | |||||||||||||||||||||||||
517 | int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj) | - | ||||||||||||||||||||||||
518 | { | - | ||||||||||||||||||||||||
519 | if (a ==
| 0 | ||||||||||||||||||||||||
520 | ((void *)0)
| 0 | ||||||||||||||||||||||||
521 | || !X509_up_ref(obj)
| 0 | ||||||||||||||||||||||||
522 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
523 | - | |||||||||||||||||||||||||
524 | x509_object_free_internal(a); | - | ||||||||||||||||||||||||
525 | a->type = X509_LU_X509; | - | ||||||||||||||||||||||||
526 | a->data.x509 = obj; | - | ||||||||||||||||||||||||
527 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
528 | } | - | ||||||||||||||||||||||||
529 | - | |||||||||||||||||||||||||
530 | int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj) | - | ||||||||||||||||||||||||
531 | { | - | ||||||||||||||||||||||||
532 | if (a ==
| 0 | ||||||||||||||||||||||||
533 | ((void *)0)
| 0 | ||||||||||||||||||||||||
534 | || !X509_CRL_up_ref(obj)
| 0 | ||||||||||||||||||||||||
535 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
536 | - | |||||||||||||||||||||||||
537 | x509_object_free_internal(a); | - | ||||||||||||||||||||||||
538 | a->type = X509_LU_CRL; | - | ||||||||||||||||||||||||
539 | a->data.crl = obj; | - | ||||||||||||||||||||||||
540 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
541 | } | - | ||||||||||||||||||||||||
542 | - | |||||||||||||||||||||||||
543 | void X509_OBJECT_free(X509_OBJECT *a) | - | ||||||||||||||||||||||||
544 | { | - | ||||||||||||||||||||||||
545 | x509_object_free_internal(a); | - | ||||||||||||||||||||||||
546 | CRYPTO_free(a, __FILE__, 464); | - | ||||||||||||||||||||||||
547 | } executed 7873 times by 1 test: end of block Executed by:
| 7873 | ||||||||||||||||||||||||
548 | - | |||||||||||||||||||||||||
549 | static int x509_object_idx_cnt(struct stack_st_X509_OBJECT *h, X509_LOOKUP_TYPE type, | - | ||||||||||||||||||||||||
550 | X509_NAME *name, int *pnmatch) | - | ||||||||||||||||||||||||
551 | { | - | ||||||||||||||||||||||||
552 | X509_OBJECT stmp; | - | ||||||||||||||||||||||||
553 | X509 x509_s; | - | ||||||||||||||||||||||||
554 | X509_CRL crl_s; | - | ||||||||||||||||||||||||
555 | int idx; | - | ||||||||||||||||||||||||
556 | - | |||||||||||||||||||||||||
557 | stmp.type = type; | - | ||||||||||||||||||||||||
558 | switch (type) { | - | ||||||||||||||||||||||||
559 | case executed 6510 times by 1 test: X509_LU_X509:case X509_LU_X509: Executed by:
executed 6510 times by 1 test: case X509_LU_X509: Executed by:
| 6510 | ||||||||||||||||||||||||
560 | stmp.data.x509 = &x509_s; | - | ||||||||||||||||||||||||
561 | x509_s.cert_info.subject = name; | - | ||||||||||||||||||||||||
562 | break; executed 6510 times by 1 test: break; Executed by:
| 6510 | ||||||||||||||||||||||||
563 | case executed 4 times by 1 test: X509_LU_CRL:case X509_LU_CRL: Executed by:
executed 4 times by 1 test: case X509_LU_CRL: Executed by:
| 4 | ||||||||||||||||||||||||
564 | stmp.data.crl = &crl_s; | - | ||||||||||||||||||||||||
565 | crl_s.crl.issuer = name; | - | ||||||||||||||||||||||||
566 | break; executed 4 times by 1 test: break; Executed by:
| 4 | ||||||||||||||||||||||||
567 | case never executed: X509_LU_NONE:case X509_LU_NONE: never executed: case X509_LU_NONE: | 0 | ||||||||||||||||||||||||
568 | - | |||||||||||||||||||||||||
569 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
570 | } | - | ||||||||||||||||||||||||
571 | - | |||||||||||||||||||||||||
572 | idx = sk_X509_OBJECT_find(h, &stmp); | - | ||||||||||||||||||||||||
573 | if (idx >= 0
| 5-5408 | ||||||||||||||||||||||||
574 | int tidx; | - | ||||||||||||||||||||||||
575 | const X509_OBJECT *tobj, *pstmp; | - | ||||||||||||||||||||||||
576 | *pnmatch = 1; | - | ||||||||||||||||||||||||
577 | pstmp = &stmp; | - | ||||||||||||||||||||||||
578 | for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h)
| 0-5 | ||||||||||||||||||||||||
579 | tobj = sk_X509_OBJECT_value(h, tidx); | - | ||||||||||||||||||||||||
580 | if (x509_object_cmp(&tobj, &pstmp)
| 0 | ||||||||||||||||||||||||
581 | break; never executed: break; | 0 | ||||||||||||||||||||||||
582 | (*pnmatch)++; | - | ||||||||||||||||||||||||
583 | } never executed: end of block | 0 | ||||||||||||||||||||||||
584 | } executed 5 times by 1 test: end of block Executed by:
| 5 | ||||||||||||||||||||||||
585 | return executed 6514 times by 1 test: idx;return idx; Executed by:
executed 6514 times by 1 test: return idx; Executed by:
| 6514 | ||||||||||||||||||||||||
586 | } | - | ||||||||||||||||||||||||
587 | - | |||||||||||||||||||||||||
588 | int X509_OBJECT_idx_by_subject(struct stack_st_X509_OBJECT *h, X509_LOOKUP_TYPE type, | - | ||||||||||||||||||||||||
589 | X509_NAME *name) | - | ||||||||||||||||||||||||
590 | { | - | ||||||||||||||||||||||||
591 | return executed 6504 times by 1 test: x509_object_idx_cnt(h, type, name, return x509_object_idx_cnt(h, type, name, ((void *)0) ); Executed by:
executed 6504 times by 1 test: return x509_object_idx_cnt(h, type, name, ((void *)0) ); Executed by:
| 6504 | ||||||||||||||||||||||||
592 | ((void *)0) executed 6504 times by 1 test: return x509_object_idx_cnt(h, type, name, ((void *)0) ); Executed by:
| 6504 | ||||||||||||||||||||||||
593 | ); executed 6504 times by 1 test: return x509_object_idx_cnt(h, type, name, ((void *)0) ); Executed by:
| 6504 | ||||||||||||||||||||||||
594 | } | - | ||||||||||||||||||||||||
595 | - | |||||||||||||||||||||||||
596 | X509_OBJECT *X509_OBJECT_retrieve_by_subject(struct stack_st_X509_OBJECT *h, | - | ||||||||||||||||||||||||
597 | X509_LOOKUP_TYPE type, | - | ||||||||||||||||||||||||
598 | X509_NAME *name) | - | ||||||||||||||||||||||||
599 | { | - | ||||||||||||||||||||||||
600 | int idx; | - | ||||||||||||||||||||||||
601 | idx = X509_OBJECT_idx_by_subject(h, type, name); | - | ||||||||||||||||||||||||
602 | if (idx == -1
| 1101-5403 | ||||||||||||||||||||||||
603 | return executed 5403 times by 1 test: return ((void *)0) ; Executed by:
executed 5403 times by 1 test: return ((void *)0) ; Executed by:
| 5403 | ||||||||||||||||||||||||
604 | ((void *)0) executed 5403 times by 1 test: return ((void *)0) ; Executed by:
| 5403 | ||||||||||||||||||||||||
605 | ; executed 5403 times by 1 test: return ((void *)0) ; Executed by:
| 5403 | ||||||||||||||||||||||||
606 | return executed 1101 times by 1 test: sk_X509_OBJECT_value(h, idx);return sk_X509_OBJECT_value(h, idx); Executed by:
executed 1101 times by 1 test: return sk_X509_OBJECT_value(h, idx); Executed by:
| 1101 | ||||||||||||||||||||||||
607 | } | - | ||||||||||||||||||||||||
608 | - | |||||||||||||||||||||||||
609 | struct stack_st_X509_OBJECT *X509_STORE_get0_objects(X509_STORE *v) | - | ||||||||||||||||||||||||
610 | { | - | ||||||||||||||||||||||||
611 | return never executed: v->objs;return v->objs; never executed: return v->objs; | 0 | ||||||||||||||||||||||||
612 | } | - | ||||||||||||||||||||||||
613 | - | |||||||||||||||||||||||||
614 | struct stack_st_X509 *X509_STORE_CTX_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm) | - | ||||||||||||||||||||||||
615 | { | - | ||||||||||||||||||||||||
616 | int i, idx, cnt; | - | ||||||||||||||||||||||||
617 | struct stack_st_X509 *sk = | - | ||||||||||||||||||||||||
618 | ((void *)0) | - | ||||||||||||||||||||||||
619 | ; | - | ||||||||||||||||||||||||
620 | X509 *x; | - | ||||||||||||||||||||||||
621 | X509_OBJECT *obj; | - | ||||||||||||||||||||||||
622 | - | |||||||||||||||||||||||||
623 | if (ctx->ctx ==
| 0-10 | ||||||||||||||||||||||||
624 | ((void *)0)
| 0-10 | ||||||||||||||||||||||||
625 | ) | - | ||||||||||||||||||||||||
626 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
627 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
628 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
629 | - | |||||||||||||||||||||||||
630 | CRYPTO_THREAD_write_lock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
631 | idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); | - | ||||||||||||||||||||||||
632 | if (idx < 0
| 5 | ||||||||||||||||||||||||
633 | - | |||||||||||||||||||||||||
634 | - | |||||||||||||||||||||||||
635 | - | |||||||||||||||||||||||||
636 | - | |||||||||||||||||||||||||
637 | X509_OBJECT *xobj = X509_OBJECT_new(); | - | ||||||||||||||||||||||||
638 | - | |||||||||||||||||||||||||
639 | CRYPTO_THREAD_unlock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
640 | if (xobj ==
| 0-5 | ||||||||||||||||||||||||
641 | ((void *)0)
| 0-5 | ||||||||||||||||||||||||
642 | ) | - | ||||||||||||||||||||||||
643 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
644 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
645 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
646 | if (!X509_STORE_CTX_get_by_subject(ctx, X509_LU_X509, nm, xobj)
| 0-5 | ||||||||||||||||||||||||
647 | X509_OBJECT_free(xobj); | - | ||||||||||||||||||||||||
648 | return executed 5 times by 1 test: return ((void *)0) ; Executed by:
executed 5 times by 1 test: return ((void *)0) ; Executed by:
| 5 | ||||||||||||||||||||||||
649 | ((void *)0) executed 5 times by 1 test: return ((void *)0) ; Executed by:
| 5 | ||||||||||||||||||||||||
650 | ; executed 5 times by 1 test: return ((void *)0) ; Executed by:
| 5 | ||||||||||||||||||||||||
651 | } | - | ||||||||||||||||||||||||
652 | X509_OBJECT_free(xobj); | - | ||||||||||||||||||||||||
653 | CRYPTO_THREAD_write_lock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
654 | idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); | - | ||||||||||||||||||||||||
655 | if (idx < 0
| 0 | ||||||||||||||||||||||||
656 | CRYPTO_THREAD_unlock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
657 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
658 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
659 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
660 | } | - | ||||||||||||||||||||||||
661 | } never executed: end of block | 0 | ||||||||||||||||||||||||
662 | - | |||||||||||||||||||||||||
663 | sk = sk_X509_new_null(); | - | ||||||||||||||||||||||||
664 | for (i = 0; i < cnt
| 5 | ||||||||||||||||||||||||
665 | obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); | - | ||||||||||||||||||||||||
666 | x = obj->data.x509; | - | ||||||||||||||||||||||||
667 | X509_up_ref(x); | - | ||||||||||||||||||||||||
668 | if (!sk_X509_push(sk, x)
| 0-5 | ||||||||||||||||||||||||
669 | CRYPTO_THREAD_unlock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
670 | X509_free(x); | - | ||||||||||||||||||||||||
671 | sk_X509_pop_free(sk, X509_free); | - | ||||||||||||||||||||||||
672 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
673 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
674 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
675 | } | - | ||||||||||||||||||||||||
676 | } executed 5 times by 1 test: end of block Executed by:
| 5 | ||||||||||||||||||||||||
677 | CRYPTO_THREAD_unlock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
678 | return executed 5 times by 1 test: sk;return sk; Executed by:
executed 5 times by 1 test: return sk; Executed by:
| 5 | ||||||||||||||||||||||||
679 | } | - | ||||||||||||||||||||||||
680 | - | |||||||||||||||||||||||||
681 | struct stack_st_X509_CRL *X509_STORE_CTX_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm) | - | ||||||||||||||||||||||||
682 | { | - | ||||||||||||||||||||||||
683 | int i, idx, cnt; | - | ||||||||||||||||||||||||
684 | struct stack_st_X509_CRL *sk = sk_X509_CRL_new_null(); | - | ||||||||||||||||||||||||
685 | X509_CRL *x; | - | ||||||||||||||||||||||||
686 | X509_OBJECT *obj, *xobj = X509_OBJECT_new(); | - | ||||||||||||||||||||||||
687 | - | |||||||||||||||||||||||||
688 | - | |||||||||||||||||||||||||
689 | if (sk ==
| 0-4 | ||||||||||||||||||||||||
690 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||
691 | - | |||||||||||||||||||||||||
692 | || xobj ==
| 0-4 | ||||||||||||||||||||||||
693 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||
694 | - | |||||||||||||||||||||||||
695 | || ctx->ctx ==
| 0-4 | ||||||||||||||||||||||||
696 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||
697 | - | |||||||||||||||||||||||||
698 | || !X509_STORE_CTX_get_by_subject(ctx, X509_LU_CRL, nm, xobj)
| 0-4 | ||||||||||||||||||||||||
699 | X509_OBJECT_free(xobj); | - | ||||||||||||||||||||||||
700 | sk_X509_CRL_free(sk); | - | ||||||||||||||||||||||||
701 | return executed 4 times by 1 test: return ((void *)0) ; Executed by:
executed 4 times by 1 test: return ((void *)0) ; Executed by:
| 4 | ||||||||||||||||||||||||
702 | ((void *)0) executed 4 times by 1 test: return ((void *)0) ; Executed by:
| 4 | ||||||||||||||||||||||||
703 | ; executed 4 times by 1 test: return ((void *)0) ; Executed by:
| 4 | ||||||||||||||||||||||||
704 | } | - | ||||||||||||||||||||||||
705 | X509_OBJECT_free(xobj); | - | ||||||||||||||||||||||||
706 | CRYPTO_THREAD_write_lock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
707 | idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt); | - | ||||||||||||||||||||||||
708 | if (idx < 0
| 0 | ||||||||||||||||||||||||
709 | CRYPTO_THREAD_unlock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
710 | sk_X509_CRL_free(sk); | - | ||||||||||||||||||||||||
711 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
712 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
713 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
714 | } | - | ||||||||||||||||||||||||
715 | - | |||||||||||||||||||||||||
716 | for (i = 0; i < cnt
| 0 | ||||||||||||||||||||||||
717 | obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); | - | ||||||||||||||||||||||||
718 | x = obj->data.crl; | - | ||||||||||||||||||||||||
719 | X509_CRL_up_ref(x); | - | ||||||||||||||||||||||||
720 | if (!sk_X509_CRL_push(sk, x)
| 0 | ||||||||||||||||||||||||
721 | CRYPTO_THREAD_unlock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
722 | X509_CRL_free(x); | - | ||||||||||||||||||||||||
723 | sk_X509_CRL_pop_free(sk, X509_CRL_free); | - | ||||||||||||||||||||||||
724 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
725 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
726 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
727 | } | - | ||||||||||||||||||||||||
728 | } never executed: end of block | 0 | ||||||||||||||||||||||||
729 | CRYPTO_THREAD_unlock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
730 | return never executed: sk;return sk; never executed: return sk; | 0 | ||||||||||||||||||||||||
731 | } | - | ||||||||||||||||||||||||
732 | - | |||||||||||||||||||||||||
733 | X509_OBJECT *X509_OBJECT_retrieve_match(struct stack_st_X509_OBJECT *h, | - | ||||||||||||||||||||||||
734 | X509_OBJECT *x) | - | ||||||||||||||||||||||||
735 | { | - | ||||||||||||||||||||||||
736 | int idx, i, num; | - | ||||||||||||||||||||||||
737 | X509_OBJECT *obj; | - | ||||||||||||||||||||||||
738 | - | |||||||||||||||||||||||||
739 | idx = sk_X509_OBJECT_find(h, x); | - | ||||||||||||||||||||||||
740 | if (idx < 0
| 1-1367 | ||||||||||||||||||||||||
741 | return executed 1367 times by 1 test: return ((void *)0) ; Executed by:
executed 1367 times by 1 test: return ((void *)0) ; Executed by:
| 1367 | ||||||||||||||||||||||||
742 | ((void *)0) executed 1367 times by 1 test: return ((void *)0) ; Executed by:
| 1367 | ||||||||||||||||||||||||
743 | ; executed 1367 times by 1 test: return ((void *)0) ; Executed by:
| 1367 | ||||||||||||||||||||||||
744 | if ((
| 0-1 | ||||||||||||||||||||||||
745 | return never executed: sk_X509_OBJECT_value(h, idx);return sk_X509_OBJECT_value(h, idx); never executed: return sk_X509_OBJECT_value(h, idx); | 0 | ||||||||||||||||||||||||
746 | for (i = idx, num = sk_X509_OBJECT_num(h); i < num
| 0-1 | ||||||||||||||||||||||||
747 | obj = sk_X509_OBJECT_value(h, i); | - | ||||||||||||||||||||||||
748 | if (x509_object_cmp((const X509_OBJECT **)&obj,
| 0-1 | ||||||||||||||||||||||||
749 | (const X509_OBJECT **)&x)
| 0-1 | ||||||||||||||||||||||||
750 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
751 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
752 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
753 | if (x->type == X509_LU_X509
| 0-1 | ||||||||||||||||||||||||
754 | if (!X509_cmp(obj->data.x509, x->data.x509)
| 0-1 | ||||||||||||||||||||||||
755 | return executed 1 time by 1 test: obj;return obj; Executed by:
executed 1 time by 1 test: return obj; Executed by:
| 1 | ||||||||||||||||||||||||
756 | } never executed: else if (x->type == X509_LU_CRLend of block
| 0 | ||||||||||||||||||||||||
757 | if (!X509_CRL_match(obj->data.crl, x->data.crl)
| 0 | ||||||||||||||||||||||||
758 | return never executed: obj;return obj; never executed: return obj; | 0 | ||||||||||||||||||||||||
759 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
760 | return never executed: obj;return obj; never executed: return obj; | 0 | ||||||||||||||||||||||||
761 | } | - | ||||||||||||||||||||||||
762 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
763 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
764 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
765 | } | - | ||||||||||||||||||||||||
766 | int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) | - | ||||||||||||||||||||||||
767 | { | - | ||||||||||||||||||||||||
768 | X509_NAME *xn; | - | ||||||||||||||||||||||||
769 | X509_OBJECT *obj = X509_OBJECT_new(), *pobj = | - | ||||||||||||||||||||||||
770 | ((void *)0) | - | ||||||||||||||||||||||||
771 | ; | - | ||||||||||||||||||||||||
772 | int i, ok, idx, ret; | - | ||||||||||||||||||||||||
773 | - | |||||||||||||||||||||||||
774 | if (obj ==
| 0-6496 | ||||||||||||||||||||||||
775 | ((void *)0)
| 0-6496 | ||||||||||||||||||||||||
776 | ) | - | ||||||||||||||||||||||||
777 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
778 | *issuer = | - | ||||||||||||||||||||||||
779 | ((void *)0) | - | ||||||||||||||||||||||||
780 | ; | - | ||||||||||||||||||||||||
781 | xn = X509_get_issuer_name(x); | - | ||||||||||||||||||||||||
782 | ok = X509_STORE_CTX_get_by_subject(ctx, X509_LU_X509, xn, obj); | - | ||||||||||||||||||||||||
783 | if (ok != 1
| 1101-5395 | ||||||||||||||||||||||||
784 | X509_OBJECT_free(obj); | - | ||||||||||||||||||||||||
785 | return executed 5395 times by 1 test: 0;return 0; Executed by:
executed 5395 times by 1 test: return 0; Executed by:
| 5395 | ||||||||||||||||||||||||
786 | } | - | ||||||||||||||||||||||||
787 | - | |||||||||||||||||||||||||
788 | if (ctx->check_issued(ctx, x, obj->data.x509)
| 0-1101 | ||||||||||||||||||||||||
789 | if (x509_check_cert_time(ctx, obj->data.x509, -1)
| 0-1101 | ||||||||||||||||||||||||
790 | *issuer = obj->data.x509; | - | ||||||||||||||||||||||||
791 | X509_up_ref(*issuer); | - | ||||||||||||||||||||||||
792 | X509_OBJECT_free(obj); | - | ||||||||||||||||||||||||
793 | return executed 1101 times by 1 test: 1;return 1; Executed by:
executed 1101 times by 1 test: return 1; Executed by:
| 1101 | ||||||||||||||||||||||||
794 | } | - | ||||||||||||||||||||||||
795 | } never executed: end of block | 0 | ||||||||||||||||||||||||
796 | X509_OBJECT_free(obj); | - | ||||||||||||||||||||||||
797 | - | |||||||||||||||||||||||||
798 | if (ctx->ctx ==
| 0 | ||||||||||||||||||||||||
799 | ((void *)0)
| 0 | ||||||||||||||||||||||||
800 | ) | - | ||||||||||||||||||||||||
801 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
802 | - | |||||||||||||||||||||||||
803 | - | |||||||||||||||||||||||||
804 | ret = 0; | - | ||||||||||||||||||||||||
805 | CRYPTO_THREAD_write_lock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
806 | idx = X509_OBJECT_idx_by_subject(ctx->ctx->objs, X509_LU_X509, xn); | - | ||||||||||||||||||||||||
807 | if (idx != -1
| 0 | ||||||||||||||||||||||||
808 | - | |||||||||||||||||||||||||
809 | - | |||||||||||||||||||||||||
810 | for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs)
| 0 | ||||||||||||||||||||||||
811 | pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i); | - | ||||||||||||||||||||||||
812 | - | |||||||||||||||||||||||||
813 | if (pobj->type != X509_LU_X509
| 0 | ||||||||||||||||||||||||
814 | break; never executed: break; | 0 | ||||||||||||||||||||||||
815 | if (X509_NAME_cmp(xn, X509_get_subject_name(pobj->data.x509))
| 0 | ||||||||||||||||||||||||
816 | break; never executed: break; | 0 | ||||||||||||||||||||||||
817 | if (ctx->check_issued(ctx, x, pobj->data.x509)
| 0 | ||||||||||||||||||||||||
818 | *issuer = pobj->data.x509; | - | ||||||||||||||||||||||||
819 | ret = 1; | - | ||||||||||||||||||||||||
820 | - | |||||||||||||||||||||||||
821 | - | |||||||||||||||||||||||||
822 | - | |||||||||||||||||||||||||
823 | - | |||||||||||||||||||||||||
824 | - | |||||||||||||||||||||||||
825 | - | |||||||||||||||||||||||||
826 | - | |||||||||||||||||||||||||
827 | if (x509_check_cert_time(ctx, *issuer, -1)
| 0 | ||||||||||||||||||||||||
828 | break; never executed: break; | 0 | ||||||||||||||||||||||||
829 | } never executed: end of block | 0 | ||||||||||||||||||||||||
830 | } never executed: end of block | 0 | ||||||||||||||||||||||||
831 | } never executed: end of block | 0 | ||||||||||||||||||||||||
832 | CRYPTO_THREAD_unlock(ctx->ctx->lock); | - | ||||||||||||||||||||||||
833 | if (*
| 0 | ||||||||||||||||||||||||
834 | X509_up_ref(*issuer); never executed: X509_up_ref(*issuer); | 0 | ||||||||||||||||||||||||
835 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
836 | } | - | ||||||||||||||||||||||||
837 | - | |||||||||||||||||||||||||
838 | int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags) | - | ||||||||||||||||||||||||
839 | { | - | ||||||||||||||||||||||||
840 | return executed 140 times by 1 test: X509_VERIFY_PARAM_set_flags(ctx->param, flags);return X509_VERIFY_PARAM_set_flags(ctx->param, flags); Executed by:
executed 140 times by 1 test: return X509_VERIFY_PARAM_set_flags(ctx->param, flags); Executed by:
| 140 | ||||||||||||||||||||||||
841 | } | - | ||||||||||||||||||||||||
842 | - | |||||||||||||||||||||||||
843 | int X509_STORE_set_depth(X509_STORE *ctx, int depth) | - | ||||||||||||||||||||||||
844 | { | - | ||||||||||||||||||||||||
845 | X509_VERIFY_PARAM_set_depth(ctx->param, depth); | - | ||||||||||||||||||||||||
846 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
847 | } | - | ||||||||||||||||||||||||
848 | - | |||||||||||||||||||||||||
849 | int X509_STORE_set_purpose(X509_STORE *ctx, int purpose) | - | ||||||||||||||||||||||||
850 | { | - | ||||||||||||||||||||||||
851 | return never executed: X509_VERIFY_PARAM_set_purpose(ctx->param, purpose);return X509_VERIFY_PARAM_set_purpose(ctx->param, purpose); never executed: return X509_VERIFY_PARAM_set_purpose(ctx->param, purpose); | 0 | ||||||||||||||||||||||||
852 | } | - | ||||||||||||||||||||||||
853 | - | |||||||||||||||||||||||||
854 | int X509_STORE_set_trust(X509_STORE *ctx, int trust) | - | ||||||||||||||||||||||||
855 | { | - | ||||||||||||||||||||||||
856 | return never executed: X509_VERIFY_PARAM_set_trust(ctx->param, trust);return X509_VERIFY_PARAM_set_trust(ctx->param, trust); never executed: return X509_VERIFY_PARAM_set_trust(ctx->param, trust); | 0 | ||||||||||||||||||||||||
857 | } | - | ||||||||||||||||||||||||
858 | - | |||||||||||||||||||||||||
859 | int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *param) | - | ||||||||||||||||||||||||
860 | { | - | ||||||||||||||||||||||||
861 | return executed 189 times by 1 test: X509_VERIFY_PARAM_set1(ctx->param, param);return X509_VERIFY_PARAM_set1(ctx->param, param); Executed by:
executed 189 times by 1 test: return X509_VERIFY_PARAM_set1(ctx->param, param); Executed by:
| 189 | ||||||||||||||||||||||||
862 | } | - | ||||||||||||||||||||||||
863 | - | |||||||||||||||||||||||||
864 | X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx) | - | ||||||||||||||||||||||||
865 | { | - | ||||||||||||||||||||||||
866 | return never executed: ctx->param;return ctx->param; never executed: return ctx->param; | 0 | ||||||||||||||||||||||||
867 | } | - | ||||||||||||||||||||||||
868 | - | |||||||||||||||||||||||||
869 | void X509_STORE_set_verify(X509_STORE *ctx, X509_STORE_CTX_verify_fn verify) | - | ||||||||||||||||||||||||
870 | { | - | ||||||||||||||||||||||||
871 | ctx->verify = verify; | - | ||||||||||||||||||||||||
872 | } never executed: end of block | 0 | ||||||||||||||||||||||||
873 | - | |||||||||||||||||||||||||
874 | X509_STORE_CTX_verify_fn X509_STORE_get_verify(X509_STORE *ctx) | - | ||||||||||||||||||||||||
875 | { | - | ||||||||||||||||||||||||
876 | return never executed: ctx->verify;return ctx->verify; never executed: return ctx->verify; | 0 | ||||||||||||||||||||||||
877 | } | - | ||||||||||||||||||||||||
878 | - | |||||||||||||||||||||||||
879 | void X509_STORE_set_verify_cb(X509_STORE *ctx, | - | ||||||||||||||||||||||||
880 | X509_STORE_CTX_verify_cb verify_cb) | - | ||||||||||||||||||||||||
881 | { | - | ||||||||||||||||||||||||
882 | ctx->verify_cb = verify_cb; | - | ||||||||||||||||||||||||
883 | } executed 239 times by 1 test: end of block Executed by:
| 239 | ||||||||||||||||||||||||
884 | - | |||||||||||||||||||||||||
885 | X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(X509_STORE *ctx) | - | ||||||||||||||||||||||||
886 | { | - | ||||||||||||||||||||||||
887 | return never executed: ctx->verify_cb;return ctx->verify_cb; never executed: return ctx->verify_cb; | 0 | ||||||||||||||||||||||||
888 | } | - | ||||||||||||||||||||||||
889 | - | |||||||||||||||||||||||||
890 | void X509_STORE_set_get_issuer(X509_STORE *ctx, | - | ||||||||||||||||||||||||
891 | X509_STORE_CTX_get_issuer_fn get_issuer) | - | ||||||||||||||||||||||||
892 | { | - | ||||||||||||||||||||||||
893 | ctx->get_issuer = get_issuer; | - | ||||||||||||||||||||||||
894 | } never executed: end of block | 0 | ||||||||||||||||||||||||
895 | - | |||||||||||||||||||||||||
896 | X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(X509_STORE *ctx) | - | ||||||||||||||||||||||||
897 | { | - | ||||||||||||||||||||||||
898 | return never executed: ctx->get_issuer;return ctx->get_issuer; never executed: return ctx->get_issuer; | 0 | ||||||||||||||||||||||||
899 | } | - | ||||||||||||||||||||||||
900 | - | |||||||||||||||||||||||||
901 | void X509_STORE_set_check_issued(X509_STORE *ctx, | - | ||||||||||||||||||||||||
902 | X509_STORE_CTX_check_issued_fn check_issued) | - | ||||||||||||||||||||||||
903 | { | - | ||||||||||||||||||||||||
904 | ctx->check_issued = check_issued; | - | ||||||||||||||||||||||||
905 | } never executed: end of block | 0 | ||||||||||||||||||||||||
906 | - | |||||||||||||||||||||||||
907 | X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(X509_STORE *ctx) | - | ||||||||||||||||||||||||
908 | { | - | ||||||||||||||||||||||||
909 | return never executed: ctx->check_issued;return ctx->check_issued; never executed: return ctx->check_issued; | 0 | ||||||||||||||||||||||||
910 | } | - | ||||||||||||||||||||||||
911 | - | |||||||||||||||||||||||||
912 | void X509_STORE_set_check_revocation(X509_STORE *ctx, | - | ||||||||||||||||||||||||
913 | X509_STORE_CTX_check_revocation_fn check_revocation) | - | ||||||||||||||||||||||||
914 | { | - | ||||||||||||||||||||||||
915 | ctx->check_revocation = check_revocation; | - | ||||||||||||||||||||||||
916 | } never executed: end of block | 0 | ||||||||||||||||||||||||
917 | - | |||||||||||||||||||||||||
918 | X509_STORE_CTX_check_revocation_fn X509_STORE_get_check_revocation(X509_STORE *ctx) | - | ||||||||||||||||||||||||
919 | { | - | ||||||||||||||||||||||||
920 | return never executed: ctx->check_revocation;return ctx->check_revocation; never executed: return ctx->check_revocation; | 0 | ||||||||||||||||||||||||
921 | } | - | ||||||||||||||||||||||||
922 | - | |||||||||||||||||||||||||
923 | void X509_STORE_set_get_crl(X509_STORE *ctx, | - | ||||||||||||||||||||||||
924 | X509_STORE_CTX_get_crl_fn get_crl) | - | ||||||||||||||||||||||||
925 | { | - | ||||||||||||||||||||||||
926 | ctx->get_crl = get_crl; | - | ||||||||||||||||||||||||
927 | } never executed: end of block | 0 | ||||||||||||||||||||||||
928 | - | |||||||||||||||||||||||||
929 | X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(X509_STORE *ctx) | - | ||||||||||||||||||||||||
930 | { | - | ||||||||||||||||||||||||
931 | return never executed: ctx->get_crl;return ctx->get_crl; never executed: return ctx->get_crl; | 0 | ||||||||||||||||||||||||
932 | } | - | ||||||||||||||||||||||||
933 | - | |||||||||||||||||||||||||
934 | void X509_STORE_set_check_crl(X509_STORE *ctx, | - | ||||||||||||||||||||||||
935 | X509_STORE_CTX_check_crl_fn check_crl) | - | ||||||||||||||||||||||||
936 | { | - | ||||||||||||||||||||||||
937 | ctx->check_crl = check_crl; | - | ||||||||||||||||||||||||
938 | } never executed: end of block | 0 | ||||||||||||||||||||||||
939 | - | |||||||||||||||||||||||||
940 | X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(X509_STORE *ctx) | - | ||||||||||||||||||||||||
941 | { | - | ||||||||||||||||||||||||
942 | return never executed: ctx->check_crl;return ctx->check_crl; never executed: return ctx->check_crl; | 0 | ||||||||||||||||||||||||
943 | } | - | ||||||||||||||||||||||||
944 | - | |||||||||||||||||||||||||
945 | void X509_STORE_set_cert_crl(X509_STORE *ctx, | - | ||||||||||||||||||||||||
946 | X509_STORE_CTX_cert_crl_fn cert_crl) | - | ||||||||||||||||||||||||
947 | { | - | ||||||||||||||||||||||||
948 | ctx->cert_crl = cert_crl; | - | ||||||||||||||||||||||||
949 | } never executed: end of block | 0 | ||||||||||||||||||||||||
950 | - | |||||||||||||||||||||||||
951 | X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(X509_STORE *ctx) | - | ||||||||||||||||||||||||
952 | { | - | ||||||||||||||||||||||||
953 | return never executed: ctx->cert_crl;return ctx->cert_crl; never executed: return ctx->cert_crl; | 0 | ||||||||||||||||||||||||
954 | } | - | ||||||||||||||||||||||||
955 | - | |||||||||||||||||||||||||
956 | void X509_STORE_set_check_policy(X509_STORE *ctx, | - | ||||||||||||||||||||||||
957 | X509_STORE_CTX_check_policy_fn check_policy) | - | ||||||||||||||||||||||||
958 | { | - | ||||||||||||||||||||||||
959 | ctx->check_policy = check_policy; | - | ||||||||||||||||||||||||
960 | } never executed: end of block | 0 | ||||||||||||||||||||||||
961 | - | |||||||||||||||||||||||||
962 | X509_STORE_CTX_check_policy_fn X509_STORE_get_check_policy(X509_STORE *ctx) | - | ||||||||||||||||||||||||
963 | { | - | ||||||||||||||||||||||||
964 | return never executed: ctx->check_policy;return ctx->check_policy; never executed: return ctx->check_policy; | 0 | ||||||||||||||||||||||||
965 | } | - | ||||||||||||||||||||||||
966 | - | |||||||||||||||||||||||||
967 | void X509_STORE_set_lookup_certs(X509_STORE *ctx, | - | ||||||||||||||||||||||||
968 | X509_STORE_CTX_lookup_certs_fn lookup_certs) | - | ||||||||||||||||||||||||
969 | { | - | ||||||||||||||||||||||||
970 | ctx->lookup_certs = lookup_certs; | - | ||||||||||||||||||||||||
971 | } never executed: end of block | 0 | ||||||||||||||||||||||||
972 | - | |||||||||||||||||||||||||
973 | X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(X509_STORE *ctx) | - | ||||||||||||||||||||||||
974 | { | - | ||||||||||||||||||||||||
975 | return never executed: ctx->lookup_certs;return ctx->lookup_certs; never executed: return ctx->lookup_certs; | 0 | ||||||||||||||||||||||||
976 | } | - | ||||||||||||||||||||||||
977 | - | |||||||||||||||||||||||||
978 | void X509_STORE_set_lookup_crls(X509_STORE *ctx, | - | ||||||||||||||||||||||||
979 | X509_STORE_CTX_lookup_crls_fn lookup_crls) | - | ||||||||||||||||||||||||
980 | { | - | ||||||||||||||||||||||||
981 | ctx->lookup_crls = lookup_crls; | - | ||||||||||||||||||||||||
982 | } never executed: end of block | 0 | ||||||||||||||||||||||||
983 | - | |||||||||||||||||||||||||
984 | X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(X509_STORE *ctx) | - | ||||||||||||||||||||||||
985 | { | - | ||||||||||||||||||||||||
986 | return never executed: ctx->lookup_crls;return ctx->lookup_crls; never executed: return ctx->lookup_crls; | 0 | ||||||||||||||||||||||||
987 | } | - | ||||||||||||||||||||||||
988 | - | |||||||||||||||||||||||||
989 | void X509_STORE_set_cleanup(X509_STORE *ctx, | - | ||||||||||||||||||||||||
990 | X509_STORE_CTX_cleanup_fn ctx_cleanup) | - | ||||||||||||||||||||||||
991 | { | - | ||||||||||||||||||||||||
992 | ctx->cleanup = ctx_cleanup; | - | ||||||||||||||||||||||||
993 | } never executed: end of block | 0 | ||||||||||||||||||||||||
994 | - | |||||||||||||||||||||||||
995 | X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(X509_STORE *ctx) | - | ||||||||||||||||||||||||
996 | { | - | ||||||||||||||||||||||||
997 | return never executed: ctx->cleanup;return ctx->cleanup; never executed: return ctx->cleanup; | 0 | ||||||||||||||||||||||||
998 | } | - | ||||||||||||||||||||||||
999 | - | |||||||||||||||||||||||||
1000 | int X509_STORE_set_ex_data(X509_STORE *ctx, int idx, void *data) | - | ||||||||||||||||||||||||
1001 | { | - | ||||||||||||||||||||||||
1002 | return never executed: CRYPTO_set_ex_data(&ctx->ex_data, idx, data);return CRYPTO_set_ex_data(&ctx->ex_data, idx, data); never executed: return CRYPTO_set_ex_data(&ctx->ex_data, idx, data); | 0 | ||||||||||||||||||||||||
1003 | } | - | ||||||||||||||||||||||||
1004 | - | |||||||||||||||||||||||||
1005 | void *X509_STORE_get_ex_data(X509_STORE *ctx, int idx) | - | ||||||||||||||||||||||||
1006 | { | - | ||||||||||||||||||||||||
1007 | return never executed: CRYPTO_get_ex_data(&ctx->ex_data, idx);return CRYPTO_get_ex_data(&ctx->ex_data, idx); never executed: return CRYPTO_get_ex_data(&ctx->ex_data, idx); | 0 | ||||||||||||||||||||||||
1008 | } | - | ||||||||||||||||||||||||
1009 | - | |||||||||||||||||||||||||
1010 | X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx) | - | ||||||||||||||||||||||||
1011 | { | - | ||||||||||||||||||||||||
1012 | return never executed: ctx->ctx;return ctx->ctx; never executed: return ctx->ctx; | 0 | ||||||||||||||||||||||||
1013 | } | - | ||||||||||||||||||||||||
Switch to Source code | Preprocessed file |