Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/x509/x509_trs.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | static int tr_cmp(const X509_TRUST * const *a, const X509_TRUST * const *b); | - | ||||||||||||||||||||||||
4 | static void trtable_free(X509_TRUST *p); | - | ||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags); | - | ||||||||||||||||||||||||
7 | static int trust_1oid(X509_TRUST *trust, X509 *x, int flags); | - | ||||||||||||||||||||||||
8 | static int trust_compat(X509_TRUST *trust, X509 *x, int flags); | - | ||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||
10 | static int obj_trust(int id, X509 *x, int flags); | - | ||||||||||||||||||||||||
11 | static int (*default_trust)(int id, X509 *x, int flags) = obj_trust; | - | ||||||||||||||||||||||||
12 | - | |||||||||||||||||||||||||
13 | - | |||||||||||||||||||||||||
14 | - | |||||||||||||||||||||||||
15 | - | |||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||
17 | - | |||||||||||||||||||||||||
18 | static X509_TRUST trstandard[] = { | - | ||||||||||||||||||||||||
19 | {1, 0, trust_compat, "compatible", 0, | - | ||||||||||||||||||||||||
20 | ((void *)0) | - | ||||||||||||||||||||||||
21 | }, | - | ||||||||||||||||||||||||
22 | {2, 0, trust_1oidany, "SSL Client", 130, | - | ||||||||||||||||||||||||
23 | ((void *)0) | - | ||||||||||||||||||||||||
24 | }, | - | ||||||||||||||||||||||||
25 | {3, 0, trust_1oidany, "SSL Server", 129, | - | ||||||||||||||||||||||||
26 | ((void *)0) | - | ||||||||||||||||||||||||
27 | }, | - | ||||||||||||||||||||||||
28 | {4, 0, trust_1oidany, "S/MIME email", 132, | - | ||||||||||||||||||||||||
29 | ((void *)0) | - | ||||||||||||||||||||||||
30 | }, | - | ||||||||||||||||||||||||
31 | {5, 0, trust_1oidany, "Object Signer", 131, | - | ||||||||||||||||||||||||
32 | ((void *)0) | - | ||||||||||||||||||||||||
33 | }, | - | ||||||||||||||||||||||||
34 | {6, 0, trust_1oid, "OCSP responder", 180, | - | ||||||||||||||||||||||||
35 | ((void *)0) | - | ||||||||||||||||||||||||
36 | }, | - | ||||||||||||||||||||||||
37 | {7, 0, trust_1oid, "OCSP request", 178, | - | ||||||||||||||||||||||||
38 | ((void *)0) | - | ||||||||||||||||||||||||
39 | }, | - | ||||||||||||||||||||||||
40 | {8, 0, trust_1oidany, "TSA server", 133, | - | ||||||||||||||||||||||||
41 | ((void *)0) | - | ||||||||||||||||||||||||
42 | } | - | ||||||||||||||||||||||||
43 | }; | - | ||||||||||||||||||||||||
44 | - | |||||||||||||||||||||||||
45 | - | |||||||||||||||||||||||||
46 | - | |||||||||||||||||||||||||
47 | static struct stack_st_X509_TRUST *trtable = | - | ||||||||||||||||||||||||
48 | ((void *)0) | - | ||||||||||||||||||||||||
49 | ; | - | ||||||||||||||||||||||||
50 | - | |||||||||||||||||||||||||
51 | static int | - | ||||||||||||||||||||||||
52 | tr_cmp(const X509_TRUST * const *a, const X509_TRUST * const *b) | - | ||||||||||||||||||||||||
53 | { | - | ||||||||||||||||||||||||
54 | return never executed: (*a)->trust - (*b)->trust;return (*a)->trust - (*b)->trust; never executed: return (*a)->trust - (*b)->trust; | 0 | ||||||||||||||||||||||||
55 | } | - | ||||||||||||||||||||||||
56 | - | |||||||||||||||||||||||||
57 | int | - | ||||||||||||||||||||||||
58 | (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int) | - | ||||||||||||||||||||||||
59 | { | - | ||||||||||||||||||||||||
60 | int (*oldtrust)(int , X509 *, int); | - | ||||||||||||||||||||||||
61 | - | |||||||||||||||||||||||||
62 | oldtrust = default_trust; | - | ||||||||||||||||||||||||
63 | default_trust = trust; | - | ||||||||||||||||||||||||
64 | return never executed: oldtrust;return oldtrust; never executed: return oldtrust; | 0 | ||||||||||||||||||||||||
65 | } | - | ||||||||||||||||||||||||
66 | - | |||||||||||||||||||||||||
67 | int | - | ||||||||||||||||||||||||
68 | X509_check_trust(X509 *x, int id, int flags) | - | ||||||||||||||||||||||||
69 | { | - | ||||||||||||||||||||||||
70 | X509_TRUST *pt; | - | ||||||||||||||||||||||||
71 | int idx; | - | ||||||||||||||||||||||||
72 | - | |||||||||||||||||||||||||
73 | if (id == -1
| 0-57 | ||||||||||||||||||||||||
74 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
75 | if (id == 0
| 23-34 | ||||||||||||||||||||||||
76 | int rv; | - | ||||||||||||||||||||||||
77 | rv = obj_trust(910, x, 0); | - | ||||||||||||||||||||||||
78 | if (rv != 3
| 0-34 | ||||||||||||||||||||||||
79 | return never executed: rv;return rv; never executed: return rv; | 0 | ||||||||||||||||||||||||
80 | return executed 34 times by 1 test: trust_compat(return trust_compat( ((void *)0) , x, 0); Executed by:
executed 34 times by 1 test: return trust_compat( ((void *)0) , x, 0); Executed by:
| 34 | ||||||||||||||||||||||||
81 | ((void *)0) executed 34 times by 1 test: return trust_compat( ((void *)0) , x, 0); Executed by:
| 34 | ||||||||||||||||||||||||
82 | , x, 0); executed 34 times by 1 test: return trust_compat( ((void *)0) , x, 0); Executed by:
| 34 | ||||||||||||||||||||||||
83 | } | - | ||||||||||||||||||||||||
84 | idx = X509_TRUST_get_by_id(id); | - | ||||||||||||||||||||||||
85 | if (idx == -1
| 0-23 | ||||||||||||||||||||||||
86 | return never executed: default_trust(id, x, flags);return default_trust(id, x, flags); never executed: return default_trust(id, x, flags); | 0 | ||||||||||||||||||||||||
87 | pt = X509_TRUST_get0(idx); | - | ||||||||||||||||||||||||
88 | return executed 23 times by 2 tests: pt->check_trust(pt, x, flags);return pt->check_trust(pt, x, flags); Executed by:
executed 23 times by 2 tests: return pt->check_trust(pt, x, flags); Executed by:
| 23 | ||||||||||||||||||||||||
89 | } | - | ||||||||||||||||||||||||
90 | - | |||||||||||||||||||||||||
91 | int | - | ||||||||||||||||||||||||
92 | X509_TRUST_get_count(void) | - | ||||||||||||||||||||||||
93 | { | - | ||||||||||||||||||||||||
94 | if (!trtable
| 0 | ||||||||||||||||||||||||
95 | return never executed: (sizeof(trstandard)/sizeof(X509_TRUST));return (sizeof(trstandard)/sizeof(X509_TRUST)); never executed: return (sizeof(trstandard)/sizeof(X509_TRUST)); | 0 | ||||||||||||||||||||||||
96 | return never executed: sk_num(((_STACK*) (1 ? (trtable) : (struct stack_st_X509_TRUST*)0))) + (sizeof(trstandard)/sizeof(X509_TRUST));return sk_num(((_STACK*) (1 ? (trtable) : (struct stack_st_X509_TRUST*)0))) + (sizeof(trstandard)/sizeof(X509_TRUST)); never executed: return sk_num(((_STACK*) (1 ? (trtable) : (struct stack_st_X509_TRUST*)0))) + (sizeof(trstandard)/sizeof(X509_TRUST)); | 0 | ||||||||||||||||||||||||
97 | } | - | ||||||||||||||||||||||||
98 | - | |||||||||||||||||||||||||
99 | X509_TRUST * | - | ||||||||||||||||||||||||
100 | X509_TRUST_get0(int idx) | - | ||||||||||||||||||||||||
101 | { | - | ||||||||||||||||||||||||
102 | if (idx < 0
| 0-23 | ||||||||||||||||||||||||
103 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
104 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
105 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
106 | if (idx < (int)(sizeof(trstandard)/sizeof(X509_TRUST))
| 0-23 | ||||||||||||||||||||||||
107 | return executed 23 times by 2 tests: trstandard + idx;return trstandard + idx; Executed by:
executed 23 times by 2 tests: return trstandard + idx; Executed by:
| 23 | ||||||||||||||||||||||||
108 | return never executed: ((X509_TRUST *)sk_value(((_STACK*) (1 ? (trtable) : (struct stack_st_X509_TRUST*)0)), (idx - (sizeof(trstandard)/sizeof(X509_TRUST)))));return ((X509_TRUST *)sk_value(((_STACK*) (1 ? (trtable) : (struct stack_st_X509_TRUST*)0)), (idx - (sizeof(trstandard)/sizeof(X509_TRUST))))); never executed: return ((X509_TRUST *)sk_value(((_STACK*) (1 ? (trtable) : (struct stack_st_X509_TRUST*)0)), (idx - (sizeof(trstandard)/sizeof(X509_TRUST))))); | 0 | ||||||||||||||||||||||||
109 | } | - | ||||||||||||||||||||||||
110 | - | |||||||||||||||||||||||||
111 | int | - | ||||||||||||||||||||||||
112 | X509_TRUST_get_by_id(int id) | - | ||||||||||||||||||||||||
113 | { | - | ||||||||||||||||||||||||
114 | X509_TRUST tmp; | - | ||||||||||||||||||||||||
115 | int idx; | - | ||||||||||||||||||||||||
116 | - | |||||||||||||||||||||||||
117 | if ((
| 0-23 | ||||||||||||||||||||||||
118 | return executed 23 times by 2 tests: id - 1;return id - 1; Executed by:
executed 23 times by 2 tests: return id - 1; Executed by:
| 23 | ||||||||||||||||||||||||
119 | tmp.trust = id; | - | ||||||||||||||||||||||||
120 | if (!trtable
| 0 | ||||||||||||||||||||||||
121 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
122 | idx = sk_find(((_STACK*) (1 ? (trtable) : (struct stack_st_X509_TRUST*)0)), ((void*) (1 ? (&tmp) : (X509_TRUST*)0))); | - | ||||||||||||||||||||||||
123 | if (idx == -1
| 0 | ||||||||||||||||||||||||
124 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
125 | return never executed: idx + (sizeof(trstandard)/sizeof(X509_TRUST));return idx + (sizeof(trstandard)/sizeof(X509_TRUST)); never executed: return idx + (sizeof(trstandard)/sizeof(X509_TRUST)); | 0 | ||||||||||||||||||||||||
126 | } | - | ||||||||||||||||||||||||
127 | - | |||||||||||||||||||||||||
128 | int | - | ||||||||||||||||||||||||
129 | X509_TRUST_set(int *t, int trust) | - | ||||||||||||||||||||||||
130 | { | - | ||||||||||||||||||||||||
131 | if (X509_TRUST_get_by_id(trust) == -1
| 0 | ||||||||||||||||||||||||
132 | ERR_put_error(11,(0xfff),(123),__FILE__,181); | - | ||||||||||||||||||||||||
133 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
134 | } | - | ||||||||||||||||||||||||
135 | *t = trust; | - | ||||||||||||||||||||||||
136 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
137 | } | - | ||||||||||||||||||||||||
138 | - | |||||||||||||||||||||||||
139 | int | - | ||||||||||||||||||||||||
140 | X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), | - | ||||||||||||||||||||||||
141 | const char *name, int arg1, void *arg2) | - | ||||||||||||||||||||||||
142 | { | - | ||||||||||||||||||||||||
143 | int idx; | - | ||||||||||||||||||||||||
144 | X509_TRUST *trtmp; | - | ||||||||||||||||||||||||
145 | char *name_dup; | - | ||||||||||||||||||||||||
146 | - | |||||||||||||||||||||||||
147 | - | |||||||||||||||||||||||||
148 | flags &= ~1; | - | ||||||||||||||||||||||||
149 | - | |||||||||||||||||||||||||
150 | flags |= 2; | - | ||||||||||||||||||||||||
151 | - | |||||||||||||||||||||||||
152 | idx = X509_TRUST_get_by_id(id); | - | ||||||||||||||||||||||||
153 | - | |||||||||||||||||||||||||
154 | if (idx == -1
| 0 | ||||||||||||||||||||||||
155 | if (!(trtmp = malloc(sizeof(X509_TRUST)))
| 0 | ||||||||||||||||||||||||
156 | ERR_put_error(11,(0xfff),((1|64)),__FILE__,205); | - | ||||||||||||||||||||||||
157 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
158 | } | - | ||||||||||||||||||||||||
159 | trtmp->flags = 1; | - | ||||||||||||||||||||||||
160 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
161 | trtmp = X509_TRUST_get0(idx); | - | ||||||||||||||||||||||||
162 | if (trtmp ==
| 0 | ||||||||||||||||||||||||
163 | ((void *)0)
| 0 | ||||||||||||||||||||||||
164 | ) { | - | ||||||||||||||||||||||||
165 | ERR_put_error(11,(0xfff),(123),__FILE__,212); | - | ||||||||||||||||||||||||
166 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
167 | } | - | ||||||||||||||||||||||||
168 | } never executed: end of block | 0 | ||||||||||||||||||||||||
169 | - | |||||||||||||||||||||||||
170 | if ((
| 0 | ||||||||||||||||||||||||
171 | (__extension__ (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||
172 | name
| 0 | ||||||||||||||||||||||||
173 | )
| 0 | ||||||||||||||||||||||||
174 | name
| 0 | ||||||||||||||||||||||||
175 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||
176 | name
| 0 | ||||||||||||||||||||||||
177 | ) == 1)
| 0 | ||||||||||||||||||||||||
178 | name
| 0 | ||||||||||||||||||||||||
179 | ))[0] == '\0'
| 0 | ||||||||||||||||||||||||
180 | name
| 0 | ||||||||||||||||||||||||
181 | ) + 1; char *__retval = (char *) malloc (__len); if (__retval != ((void *)0)
never executed: __retval = (char *) memcpy (__retval, name , __len); | 0 | ||||||||||||||||||||||||
182 | name
never executed: __retval = (char *) memcpy (__retval, name , __len); | 0 | ||||||||||||||||||||||||
183 | , __len); __retval; })) : __strdup (
| 0 | ||||||||||||||||||||||||
184 | name
| 0 | ||||||||||||||||||||||||
185 | )))
| 0 | ||||||||||||||||||||||||
186 | ) ==
| 0 | ||||||||||||||||||||||||
187 | ((void *)0)
| 0 | ||||||||||||||||||||||||
188 | ) | - | ||||||||||||||||||||||||
189 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
190 | - | |||||||||||||||||||||||||
191 | - | |||||||||||||||||||||||||
192 | if (trtmp->flags & 2
| 0 | ||||||||||||||||||||||||
193 | free(trtmp->name); never executed: free(trtmp->name); | 0 | ||||||||||||||||||||||||
194 | - | |||||||||||||||||||||||||
195 | trtmp->name = name_dup; | - | ||||||||||||||||||||||||
196 | - | |||||||||||||||||||||||||
197 | trtmp->flags &= 1; | - | ||||||||||||||||||||||||
198 | - | |||||||||||||||||||||||||
199 | trtmp->flags |= flags; | - | ||||||||||||||||||||||||
200 | - | |||||||||||||||||||||||||
201 | trtmp->trust = id; | - | ||||||||||||||||||||||||
202 | trtmp->check_trust = ck; | - | ||||||||||||||||||||||||
203 | trtmp->arg1 = arg1; | - | ||||||||||||||||||||||||
204 | trtmp->arg2 = arg2; | - | ||||||||||||||||||||||||
205 | - | |||||||||||||||||||||||||
206 | - | |||||||||||||||||||||||||
207 | if (idx == -1
| 0 | ||||||||||||||||||||||||
208 | if (trtable ==
| 0 | ||||||||||||||||||||||||
209 | ((void *)0)
| 0 | ||||||||||||||||||||||||
210 | && | - | ||||||||||||||||||||||||
211 | (
| 0 | ||||||||||||||||||||||||
212 | ((void *)0)
| 0 | ||||||||||||||||||||||||
213 | ) | - | ||||||||||||||||||||||||
214 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
215 | if (sk_push(((_STACK*) (1 ? (trtable) : (struct stack_st_X509_TRUST*)0)), ((void*) (1 ? (trtmp) : (X509_TRUST*)0))) == 0
| 0 | ||||||||||||||||||||||||
216 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
217 | } never executed: end of block | 0 | ||||||||||||||||||||||||
218 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
219 | - | |||||||||||||||||||||||||
220 | err: | - | ||||||||||||||||||||||||
221 | free(name_dup); | - | ||||||||||||||||||||||||
222 | if (idx == -1
| 0 | ||||||||||||||||||||||||
223 | free(trtmp); never executed: free(trtmp); | 0 | ||||||||||||||||||||||||
224 | ERR_put_error(11,(0xfff),((1|64)),__FILE__,249); | - | ||||||||||||||||||||||||
225 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
226 | } | - | ||||||||||||||||||||||||
227 | - | |||||||||||||||||||||||||
228 | static void | - | ||||||||||||||||||||||||
229 | trtable_free(X509_TRUST *p) | - | ||||||||||||||||||||||||
230 | { | - | ||||||||||||||||||||||||
231 | if (!p
| 0 | ||||||||||||||||||||||||
232 | return; never executed: return; | 0 | ||||||||||||||||||||||||
233 | if (p->flags & 1
| 0 | ||||||||||||||||||||||||
234 | if (p->flags & 2
| 0 | ||||||||||||||||||||||||
235 | free(p->name); never executed: free(p->name); | 0 | ||||||||||||||||||||||||
236 | free(p); | - | ||||||||||||||||||||||||
237 | } never executed: end of block | 0 | ||||||||||||||||||||||||
238 | } never executed: end of block | 0 | ||||||||||||||||||||||||
239 | - | |||||||||||||||||||||||||
240 | void | - | ||||||||||||||||||||||||
241 | X509_TRUST_cleanup(void) | - | ||||||||||||||||||||||||
242 | { | - | ||||||||||||||||||||||||
243 | unsigned int i; | - | ||||||||||||||||||||||||
244 | - | |||||||||||||||||||||||||
245 | for (i = 0; i < (sizeof(trstandard)/sizeof(X509_TRUST))
| 0 | ||||||||||||||||||||||||
246 | trtable_free(trstandard + i); never executed: trtable_free(trstandard + i); | 0 | ||||||||||||||||||||||||
247 | sk_pop_free(((_STACK*) (1 ? (trtable) : (struct stack_st_X509_TRUST*)0)), ((void (*)(void *)) ((1 ? (trtable_free) : (void (*)(X509_TRUST *))0)))); | - | ||||||||||||||||||||||||
248 | trtable = | - | ||||||||||||||||||||||||
249 | ((void *)0) | - | ||||||||||||||||||||||||
250 | ; | - | ||||||||||||||||||||||||
251 | } never executed: end of block | 0 | ||||||||||||||||||||||||
252 | - | |||||||||||||||||||||||||
253 | int | - | ||||||||||||||||||||||||
254 | X509_TRUST_get_flags(const X509_TRUST *xp) | - | ||||||||||||||||||||||||
255 | { | - | ||||||||||||||||||||||||
256 | return never executed: xp->flags;return xp->flags; never executed: return xp->flags; | 0 | ||||||||||||||||||||||||
257 | } | - | ||||||||||||||||||||||||
258 | - | |||||||||||||||||||||||||
259 | char * | - | ||||||||||||||||||||||||
260 | X509_TRUST_get0_name(const X509_TRUST *xp) | - | ||||||||||||||||||||||||
261 | { | - | ||||||||||||||||||||||||
262 | return never executed: xp->name;return xp->name; never executed: return xp->name; | 0 | ||||||||||||||||||||||||
263 | } | - | ||||||||||||||||||||||||
264 | - | |||||||||||||||||||||||||
265 | int | - | ||||||||||||||||||||||||
266 | X509_TRUST_get_trust(const X509_TRUST *xp) | - | ||||||||||||||||||||||||
267 | { | - | ||||||||||||||||||||||||
268 | return never executed: xp->trust;return xp->trust; never executed: return xp->trust; | 0 | ||||||||||||||||||||||||
269 | } | - | ||||||||||||||||||||||||
270 | - | |||||||||||||||||||||||||
271 | static int | - | ||||||||||||||||||||||||
272 | trust_1oidany(X509_TRUST *trust, X509 *x, int flags) | - | ||||||||||||||||||||||||
273 | { | - | ||||||||||||||||||||||||
274 | if (x->aux
| 0-23 | ||||||||||||||||||||||||
275 | return never executed: obj_trust(trust->arg1, x, flags);return obj_trust(trust->arg1, x, flags); never executed: return obj_trust(trust->arg1, x, flags); | 0 | ||||||||||||||||||||||||
276 | - | |||||||||||||||||||||||||
277 | - | |||||||||||||||||||||||||
278 | - | |||||||||||||||||||||||||
279 | return executed 23 times by 2 tests: trust_compat(trust, x, flags);return trust_compat(trust, x, flags); Executed by:
executed 23 times by 2 tests: return trust_compat(trust, x, flags); Executed by:
| 23 | ||||||||||||||||||||||||
280 | } | - | ||||||||||||||||||||||||
281 | - | |||||||||||||||||||||||||
282 | static int | - | ||||||||||||||||||||||||
283 | trust_1oid(X509_TRUST *trust, X509 *x, int flags) | - | ||||||||||||||||||||||||
284 | { | - | ||||||||||||||||||||||||
285 | if (x->aux
| 0 | ||||||||||||||||||||||||
286 | return never executed: obj_trust(trust->arg1, x, flags);return obj_trust(trust->arg1, x, flags); never executed: return obj_trust(trust->arg1, x, flags); | 0 | ||||||||||||||||||||||||
287 | return never executed: 3;return 3; never executed: return 3; | 0 | ||||||||||||||||||||||||
288 | } | - | ||||||||||||||||||||||||
289 | - | |||||||||||||||||||||||||
290 | static int | - | ||||||||||||||||||||||||
291 | trust_compat(X509_TRUST *trust, X509 *x, int flags) | - | ||||||||||||||||||||||||
292 | { | - | ||||||||||||||||||||||||
293 | X509_check_purpose(x, -1, 0); | - | ||||||||||||||||||||||||
294 | if (x->ex_flags & 0x2000
| 21-36 | ||||||||||||||||||||||||
295 | return executed 36 times by 2 tests: 1;return 1; Executed by:
executed 36 times by 2 tests: return 1; Executed by:
| 36 | ||||||||||||||||||||||||
296 | else | - | ||||||||||||||||||||||||
297 | return executed 21 times by 2 tests: 3;return 3; Executed by:
executed 21 times by 2 tests: return 3; Executed by:
| 21 | ||||||||||||||||||||||||
298 | } | - | ||||||||||||||||||||||||
299 | - | |||||||||||||||||||||||||
300 | static int | - | ||||||||||||||||||||||||
301 | obj_trust(int id, X509 *x, int flags) | - | ||||||||||||||||||||||||
302 | { | - | ||||||||||||||||||||||||
303 | ASN1_OBJECT *obj; | - | ||||||||||||||||||||||||
304 | int i; | - | ||||||||||||||||||||||||
305 | X509_CERT_AUX *ax; | - | ||||||||||||||||||||||||
306 | - | |||||||||||||||||||||||||
307 | ax = x->aux; | - | ||||||||||||||||||||||||
308 | if (!ax
| 0-34 | ||||||||||||||||||||||||
309 | return executed 34 times by 1 test: 3;return 3; Executed by:
executed 34 times by 1 test: return 3; Executed by:
| 34 | ||||||||||||||||||||||||
310 | if (ax->reject
| 0 | ||||||||||||||||||||||||
311 | for (i = 0; i < sk_num(((_STACK*) (1 ? (ax->reject) : (struct stack_st_ASN1_OBJECT*)0)))
| 0 | ||||||||||||||||||||||||
312 | obj = ((ASN1_OBJECT *)sk_value(((_STACK*) (1 ? (ax->reject) : (struct stack_st_ASN1_OBJECT*)0)), (i))); | - | ||||||||||||||||||||||||
313 | if (OBJ_obj2nid(obj) == id
| 0 | ||||||||||||||||||||||||
314 | return never executed: 2;return 2; never executed: return 2; | 0 | ||||||||||||||||||||||||
315 | } never executed: end of block | 0 | ||||||||||||||||||||||||
316 | } never executed: end of block | 0 | ||||||||||||||||||||||||
317 | if (ax->trust
| 0 | ||||||||||||||||||||||||
318 | for (i = 0; i < sk_num(((_STACK*) (1 ? (ax->trust) : (struct stack_st_ASN1_OBJECT*)0)))
| 0 | ||||||||||||||||||||||||
319 | obj = ((ASN1_OBJECT *)sk_value(((_STACK*) (1 ? (ax->trust) : (struct stack_st_ASN1_OBJECT*)0)), (i))); | - | ||||||||||||||||||||||||
320 | if (OBJ_obj2nid(obj) == id
| 0 | ||||||||||||||||||||||||
321 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
322 | } never executed: end of block | 0 | ||||||||||||||||||||||||
323 | } never executed: end of block | 0 | ||||||||||||||||||||||||
324 | return never executed: 3;return 3; never executed: return 3; | 0 | ||||||||||||||||||||||||
325 | } | - | ||||||||||||||||||||||||
Switch to Source code | Preprocessed file |