OpenCoverage

x_crl.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/x_crl.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2static int X509_REVOKED_cmp(const X509_REVOKED *const *a,-
3 const X509_REVOKED *const *b);-
4static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp);-
5-
6static const ASN1_TEMPLATE X509_REVOKED_seq_tt[] = {-
7 { ((0x1 << 12)), (0), -
8 __builtin_offsetof (-
9 X509_REVOKED-
10 , -
11 serialNumber-
12 )-
13 , "serialNumber", (&(ASN1_INTEGER_it)) },-
14 { (0), (0), -
15 __builtin_offsetof (-
16 X509_REVOKED-
17 , -
18 revocationDate-
19 )-
20 , "revocationDate", (&(ASN1_TIME_it)) },-
21 { ((0x2 << 1)|(0x1)), (0), -
22 __builtin_offsetof (-
23 X509_REVOKED-
24 , -
25 extensions-
26 )-
27 , "extensions", (&(X509_EXTENSION_it)) }-
28} ; const ASN1_ITEM X509_REVOKED_it = { 0x1, 16, X509_REVOKED_seq_tt, sizeof(X509_REVOKED_seq_tt) / sizeof(ASN1_TEMPLATE), -
29 ((void *)0)-
30 , sizeof(X509_REVOKED), "X509_REVOKED" };-
31-
32static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r);-
33static int def_crl_lookup(X509_CRL *crl,-
34 X509_REVOKED **ret, ASN1_INTEGER *serial,-
35 X509_NAME *issuer);-
36-
37static X509_CRL_METHOD int_crl_meth = {-
38 0,-
39 0, 0,-
40 def_crl_lookup,-
41 def_crl_verify-
42};-
43-
44static const X509_CRL_METHOD *default_crl_method = &int_crl_meth;-
45-
46-
47-
48-
49-
50-
51static int crl_inf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,-
52 void *exarg)-
53{-
54 X509_CRL_INFO *a = (X509_CRL_INFO *)*pval;-
55-
56 if (!a
!aDescription
TRUEevaluated 2962 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 233918 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !a->revoked
!a->revokedDescription
TRUEevaluated 228338 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5580 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2962-233918
57 return
executed 231300 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 231300 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
231300
58 switch (operation) {-
59-
60-
61-
62-
63 case
executed 2745 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
5:
executed 2745 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
2745
64 (void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp);-
65 break;
executed 2745 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
2745
66 }-
67 return
executed 5580 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 5580 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
5580
68}-
69-
70-
71static const ASN1_AUX X509_CRL_INFO_aux = {-
72((void *)0)-
73, 2, 0, 0, crl_inf_cb, -
74__builtin_offsetof (-
75X509_CRL_INFO-
76, -
77enc-
78)-
79}; static const ASN1_TEMPLATE X509_CRL_INFO_seq_tt[] = {-
80 { ((0x1)), (0), -
81 __builtin_offsetof (-
82 X509_CRL_INFO-
83 , -
84 version-
85 )-
86 , "version", (&(ASN1_INTEGER_it)) },-
87 { ((0x1 << 12)), (0), -
88 __builtin_offsetof (-
89 X509_CRL_INFO-
90 , -
91 sig_alg-
92 )-
93 , "sig_alg", (&(X509_ALGOR_it)) },-
94 { (0), (0), -
95 __builtin_offsetof (-
96 X509_CRL_INFO-
97 , -
98 issuer-
99 )-
100 , "issuer", (&(X509_NAME_it)) },-
101 { (0), (0), -
102 __builtin_offsetof (-
103 X509_CRL_INFO-
104 , -
105 lastUpdate-
106 )-
107 , "lastUpdate", (&(ASN1_TIME_it)) },-
108 { ((0x1)), (0), -
109 __builtin_offsetof (-
110 X509_CRL_INFO-
111 , -
112 nextUpdate-
113 )-
114 , "nextUpdate", (&(ASN1_TIME_it)) },-
115 { ((0x2 << 1)|(0x1)), (0), -
116 __builtin_offsetof (-
117 X509_CRL_INFO-
118 , -
119 revoked-
120 )-
121 , "revoked", (&(X509_REVOKED_it)) },-
122 { (((0x2 << 3)|(0x2<<6)) | ((0x2 << 1)|(0x1))), (0), -
123 __builtin_offsetof (-
124 X509_CRL_INFO-
125 , -
126 extensions-
127 )-
128 , "extensions", (&(X509_EXTENSION_it)) }-
129} ; const ASN1_ITEM X509_CRL_INFO_it = { 0x1, 16, X509_CRL_INFO_seq_tt, sizeof(X509_CRL_INFO_seq_tt) / sizeof(ASN1_TEMPLATE), &X509_CRL_INFO_aux, sizeof(X509_CRL_INFO), "X509_CRL_INFO" };-
130-
131-
132-
133-
134-
135-
136static int crl_set_issuers(X509_CRL *crl)-
137{-
138-
139 int i, j;-
140 GENERAL_NAMES *gens, *gtmp;-
141 struct stack_st_X509_REVOKED *revoked;-
142-
143 revoked = X509_CRL_get_REVOKED(crl);-
144-
145 gens = -
146 ((void *)0)-
147 ;-
148 for (i = 0; i < sk_X509_REVOKED_num(revoked)
i < sk_X509_RE...D_num(revoked)Description
TRUEevaluated 14717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32581 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
14717-32581
149 X509_REVOKED *rev = sk_X509_REVOKED_value(revoked, i);-
150 struct stack_st_X509_EXTENSION *exts;-
151 ASN1_ENUMERATED *reason;-
152 X509_EXTENSION *ext;-
153 gtmp = X509_REVOKED_get_ext_d2i(rev,-
154 771, &j, -
155 ((void *)0)-
156 );-
157 if (!gtmp
!gtmpDescription
TRUEevaluated 13740 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 977 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(j != -1)Description
TRUEevaluated 1281 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12459 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
j != -1)
(j != -1)Description
TRUEevaluated 1281 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12459 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
977-13740
158 crl->flags |= 0x80;-
159 return
executed 1281 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1281 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1281
160 }-
161-
162 if (gtmp
gtmpDescription
TRUEevaluated 977 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12459 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
977-12459
163 gens = gtmp;-
164 if (!crl->issuers
!crl->issuersDescription
TRUEevaluated 163 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 814 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
163-814
165 crl->issuers = sk_GENERAL_NAMES_new_null();-
166 if (!crl->issuers
!crl->issuersDescription
TRUEnever evaluated
FALSEevaluated 163 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-163
167 return
never executed: return 0;
0;
never executed: return 0;
0
168 }
executed 163 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
163
169 if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)
!sk_GENERAL_NA...issuers, gtmp)Description
TRUEnever evaluated
FALSEevaluated 977 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-977
170 return
never executed: return 0;
0;
never executed: return 0;
0
171 }
executed 977 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
977
172 rev->issuer = gens;-
173-
174 reason = X509_REVOKED_get_ext_d2i(rev, 141, &j, -
175 ((void *)0)-
176 );-
177 if (!reason
!reasonDescription
TRUEevaluated 10059 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(j != -1)Description
TRUEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9567 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
j != -1)
(j != -1)Description
TRUEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9567 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
492-10059
178 crl->flags |= 0x80;-
179 return
executed 492 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 492 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
492
180 }-
181-
182 if (reason
reasonDescription
TRUEevaluated 3377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9567 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3377-9567
183 rev->reason = ASN1_ENUMERATED_get(reason);-
184 ASN1_ENUMERATED_free(reason);-
185 }
executed 3377 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
3377
186 rev->reason = -1;
executed 9567 times by 1 test: rev->reason = -1;
Executed by:
  • libcrypto.so.1.1
9567
187-
188-
189-
190 exts = rev->extensions;-
191-
192 for (j = 0; j < sk_X509_EXTENSION_num(exts)
j < sk_X509_EX...SION_num(exts)Description
TRUEevaluated 5909 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10689 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
5909-10689
193 ext = sk_X509_EXTENSION_value(exts, j);-
194 if (X509_EXTENSION_get_critical(ext)
X509_EXTENSION..._critical(ext)Description
TRUEevaluated 2949 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2960 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2949-2960
195 if (OBJ_obj2nid(X509_EXTENSION_get_object(ext)) == 771
OBJ_obj2nid(X5...t(ext)) == 771Description
TRUEevaluated 694 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2255 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
694-2255
196 continue;
executed 694 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
694
197 crl->flags |= 0x200;-
198 break;
executed 2255 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
2255
199 }-
200 }
executed 2960 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2960
201-
202 }
executed 12944 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
12944
203-
204 return
executed 32581 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 32581 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
32581
205-
206}-
207-
208-
209-
210-
211-
212static int crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,-
213 void *exarg)-
214{-
215 X509_CRL *crl = (X509_CRL *)*pval;-
216 struct stack_st_X509_EXTENSION *exts;-
217 X509_EXTENSION *ext;-
218 int idx;-
219-
220 switch (operation) {-
221 case
executed 38050 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 38050 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
38050
222 crl->idp = -
223 ((void *)0)-
224 ;-
225 crl->akid = -
226 ((void *)0)-
227 ;-
228 crl->flags = 0;-
229 crl->idp_flags = 0;-
230 crl->idp_reasons = 0x807f;-
231 crl->meth = default_crl_method;-
232 crl->meth_data = -
233 ((void *)0)-
234 ;-
235 crl->issuers = -
236 ((void *)0)-
237 ;-
238 crl->crl_number = -
239 ((void *)0)-
240 ;-
241 crl->base_crl_number = -
242 ((void *)0)-
243 ;-
244 break;
executed 38050 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
38050
245-
246 case
executed 34354 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
5:
executed 34354 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
34354
247 X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, -
248 ((void *)0)-
249 );-
250 crl->idp = X509_CRL_get_ext_d2i(crl,-
251 770, -
252 ((void *)0)-
253 ,-
254 -
255 ((void *)0)-
256 );-
257 if (crl->idp
crl->idpDescription
TRUEevaluated 9609 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 24745 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
9609-24745
258 setup_idp(crl, crl->idp);
executed 9609 times by 1 test: setup_idp(crl, crl->idp);
Executed by:
  • libcrypto.so.1.1
9609
259-
260 crl->akid = X509_CRL_get_ext_d2i(crl,-
261 90, -
262 ((void *)0)-
263 ,-
264 -
265 ((void *)0)-
266 );-
267-
268 crl->crl_number = X509_CRL_get_ext_d2i(crl,-
269 88, -
270 ((void *)0)-
271 , -
272 ((void *)0)-
273 );-
274-
275 crl->base_crl_number = X509_CRL_get_ext_d2i(crl,-
276 140, -
277 ((void *)0)-
278 ,-
279 -
280 ((void *)0)-
281 );-
282-
283 if (crl->base_crl_number
crl->base_crl_numberDescription
TRUEevaluated 883 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 33471 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !crl->crl_number
!crl->crl_numberDescription
TRUEevaluated 398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 485 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
398-33471
284 crl->flags |= 0x80;
executed 398 times by 1 test: crl->flags |= 0x80;
Executed by:
  • libcrypto.so.1.1
398
285 exts = crl->crl.extensions;-
286-
287 for (idx = 0; idx < sk_X509_EXTENSION_num(exts)
idx < sk_X509_...SION_num(exts)Description
TRUEevaluated 69211 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 33868 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; idx++) {
33868-69211
288 int nid;-
289 ext = sk_X509_EXTENSION_value(exts, idx);-
290 nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext));-
291 if (nid == 857
nid == 857Description
TRUEevaluated 2728 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 66483 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2728-66483
292 crl->flags |= 0x1000;
executed 2728 times by 1 test: crl->flags |= 0x1000;
Executed by:
  • libcrypto.so.1.1
2728
293 if (X509_EXTENSION_get_critical(ext)
X509_EXTENSION..._critical(ext)Description
TRUEevaluated 3094 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 66117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3094-66117
294-
295 if ((
(nid == 770)Description
TRUEevaluated 1190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1904 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
nid == 770)
(nid == 770)Description
TRUEevaluated 1190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1904 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1190-1904
296 || (
(nid == 90)Description
TRUEevaluated 836 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1068 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
nid == 90)
(nid == 90)Description
TRUEevaluated 836 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1068 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
836-1068
297 || (
(nid == 140)Description
TRUEevaluated 582 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 486 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
nid == 140)
(nid == 140)Description
TRUEevaluated 582 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 486 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
486-582
298 continue;
executed 2608 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
2608
299 crl->flags |= 0x200;-
300 break;
executed 486 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
486
301 }-
302 }
executed 66117 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
66117
303-
304 if (!crl_set_issuers(crl)
!crl_set_issuers(crl)Description
TRUEnever evaluated
FALSEevaluated 34354 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-34354
305 return
never executed: return 0;
0;
never executed: return 0;
0
306-
307 if (crl->meth->crl_init
crl->meth->crl_initDescription
TRUEnever evaluated
FALSEevaluated 34354 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-34354
308 if (crl->meth->crl_init(crl) == 0
crl->meth->crl_init(crl) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
309 return
never executed: return 0;
0;
never executed: return 0;
0
310 }
never executed: end of block
0
311-
312 crl->flags |= 0x100;-
313 break;
executed 34354 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
34354
314-
315 case
executed 38050 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
3:
executed 38050 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
38050
316 if (crl->meth->crl_free
crl->meth->crl_freeDescription
TRUEnever evaluated
FALSEevaluated 38050 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-38050
317 if (!crl->meth->crl_free(crl)
!crl->meth->crl_free(crl)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
318 return
never executed: return 0;
0;
never executed: return 0;
0
319 }
never executed: end of block
0
320 AUTHORITY_KEYID_free(crl->akid);-
321 ISSUING_DIST_POINT_free(crl->idp);-
322 ASN1_INTEGER_free(crl->crl_number);-
323 ASN1_INTEGER_free(crl->base_crl_number);-
324 sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);-
325 break;
executed 38050 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
38050
326 }-
327 return
executed 333946 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 333946 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
333946
328}-
329-
330-
331-
332static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp)-
333{-
334 int idp_only = 0;-
335-
336 crl->idp_flags |= 0x1;-
337 if (idp->onlyuser > 0
idp->onlyuser > 0Description
TRUEevaluated 398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9211 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
398-9211
338 idp_only++;-
339 crl->idp_flags |= 0x4;-
340 }
executed 398 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
398
341 if (idp->onlyCA > 0
idp->onlyCA > 0Description
TRUEevaluated 390 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9219 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
390-9219
342 idp_only++;-
343 crl->idp_flags |= 0x8;-
344 }
executed 390 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
390
345 if (idp->onlyattr > 0
idp->onlyattr > 0Description
TRUEevaluated 401 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9208 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
401-9208
346 idp_only++;-
347 crl->idp_flags |= 0x10;-
348 }
executed 401 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
401
349-
350 if (idp_only > 1
idp_only > 1Description
TRUEevaluated 398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9211 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
398-9211
351 crl->idp_flags |= 0x2;
executed 398 times by 1 test: crl->idp_flags |= 0x2;
Executed by:
  • libcrypto.so.1.1
398
352-
353 if (idp->indirectCRL > 0
idp->indirectCRL > 0Description
TRUEevaluated 399 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9210 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
399-9210
354 crl->idp_flags |= 0x20;
executed 399 times by 1 test: crl->idp_flags |= 0x20;
Executed by:
  • libcrypto.so.1.1
399
355-
356 if (idp->onlysomereasons
idp->onlysomereasonsDescription
TRUEevaluated 1042 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8567 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1042-8567
357 crl->idp_flags |= 0x40;-
358 if (idp->onlysomereasons->length > 0
idp->onlysomer...ns->length > 0Description
TRUEevaluated 653 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 389 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
389-653
359 crl->idp_reasons = idp->onlysomereasons->data[0];
executed 653 times by 1 test: crl->idp_reasons = idp->onlysomereasons->data[0];
Executed by:
  • libcrypto.so.1.1
653
360 if (idp->onlysomereasons->length > 1
idp->onlysomer...ns->length > 1Description
TRUEevaluated 390 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
390-652
361 crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8);
executed 390 times by 1 test: crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8);
Executed by:
  • libcrypto.so.1.1
390
362 crl->idp_reasons &= 0x807f;-
363 }
executed 1042 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1042
364-
365 DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl));-
366}
executed 9609 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
9609
367-
368static const ASN1_AUX X509_CRL_aux = {-
369((void *)0)-
370, 1, -
371__builtin_offsetof (-
372X509_CRL-
373, -
374references-
375)-
376, -
377__builtin_offsetof (-
378X509_CRL-
379, -
380lock-
381)-
382, crl_cb, 0}; static const ASN1_TEMPLATE X509_CRL_seq_tt[] = {-
383 { ((0x1 << 12)), (0), -
384 __builtin_offsetof (-
385 X509_CRL-
386 , -
387 crl-
388 )-
389 , "crl", (&(X509_CRL_INFO_it)) },-
390 { ((0x1 << 12)), (0), -
391 __builtin_offsetof (-
392 X509_CRL-
393 , -
394 sig_alg-
395 )-
396 , "sig_alg", (&(X509_ALGOR_it)) },-
397 { ((0x1 << 12)), (0), -
398 __builtin_offsetof (-
399 X509_CRL-
400 , -
401 signature-
402 )-
403 , "signature", (&(ASN1_BIT_STRING_it)) }-
404} ; const ASN1_ITEM X509_CRL_it = { 0x1, 16, X509_CRL_seq_tt, sizeof(X509_CRL_seq_tt) / sizeof(ASN1_TEMPLATE), &X509_CRL_aux, sizeof(X509_CRL), "X509_CRL" };-
405-
406X509_REVOKED *d2i_X509_REVOKED(X509_REVOKED **a, const unsigned char **in, long len) { return
never executed: return (X509_REVOKED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_REVOKED_it)));
(X509_REVOKED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_REVOKED_it)));
never executed: return (X509_REVOKED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_REVOKED_it)));
} int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **out) { return
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_REVOKED_it)));
ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_REVOKED_it)));
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_REVOKED_it)));
} X509_REVOKED *X509_REVOKED_new(void) { return
never executed: return (X509_REVOKED *)ASN1_item_new((&(X509_REVOKED_it)));
(X509_REVOKED *)ASN1_item_new((&(X509_REVOKED_it)));
never executed: return (X509_REVOKED *)ASN1_item_new((&(X509_REVOKED_it)));
} void X509_REVOKED_free(X509_REVOKED *a) { ASN1_item_free((ASN1_VALUE *)a, (&(X509_REVOKED_it))); }
never executed: end of block
0
407-
408X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *x) { return
never executed: return ASN1_item_dup((&(X509_REVOKED_it)), x);
ASN1_item_dup((&(X509_REVOKED_it)), x);
never executed: return ASN1_item_dup((&(X509_REVOKED_it)), x);
}
0
409-
410X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len) { return
never executed: return (X509_CRL_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_INFO_it)));
(X509_CRL_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_INFO_it)));
never executed: return (X509_CRL_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_INFO_it)));
} int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **out) { return
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_INFO_it)));
ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_INFO_it)));
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_INFO_it)));
} X509_CRL_INFO *X509_CRL_INFO_new(void) { return
never executed: return (X509_CRL_INFO *)ASN1_item_new((&(X509_CRL_INFO_it)));
(X509_CRL_INFO *)ASN1_item_new((&(X509_CRL_INFO_it)));
never executed: return (X509_CRL_INFO *)ASN1_item_new((&(X509_CRL_INFO_it)));
} void X509_CRL_INFO_free(X509_CRL_INFO *a) { ASN1_item_free((ASN1_VALUE *)a, (&(X509_CRL_INFO_it))); }
never executed: end of block
0
411-
412X509_CRL *d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len) { return
executed 2076 times by 1 test: return (X509_CRL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_it)));
Executed by:
  • libcrypto.so.1.1
(X509_CRL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_it)));
executed 2076 times by 1 test: return (X509_CRL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_it)));
Executed by:
  • libcrypto.so.1.1
} int i2d_X509_CRL(X509_CRL *a, unsigned char **out) { return
executed 1846 times by 1 test: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_it)));
Executed by:
  • libcrypto.so.1.1
ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_it)));
executed 1846 times by 1 test: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_it)));
Executed by:
  • libcrypto.so.1.1
} X509_CRL *X509_CRL_new(void) { return
never executed: return (X509_CRL *)ASN1_item_new((&(X509_CRL_it)));
(X509_CRL *)ASN1_item_new((&(X509_CRL_it)));
never executed: return (X509_CRL *)ASN1_item_new((&(X509_CRL_it)));
} void X509_CRL_free(X509_CRL *a) { ASN1_item_free((ASN1_VALUE *)a, (&(X509_CRL_it))); }
executed 3617 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
0-3617
413-
414X509_CRL * X509_CRL_dup(X509_CRL *x) { return
never executed: return ASN1_item_dup((&(X509_CRL_it)), x);
ASN1_item_dup((&(X509_CRL_it)), x);
never executed: return ASN1_item_dup((&(X509_CRL_it)), x);
}
0
415-
416static int X509_REVOKED_cmp(const X509_REVOKED *const *a,-
417 const X509_REVOKED *const *b)-
418{-
419 return
executed 1 time by 1 test: return (ASN1_STRING_cmp((ASN1_STRING *)&(*a)->serialNumber, (ASN1_STRING *)&(*b)->serialNumber));
Executed by:
  • libcrypto.so.1.1
(ASN1_STRING_cmp((ASN1_STRING *)&(*a)->serialNumber,
executed 1 time by 1 test: return (ASN1_STRING_cmp((ASN1_STRING *)&(*a)->serialNumber, (ASN1_STRING *)&(*b)->serialNumber));
Executed by:
  • libcrypto.so.1.1
1
420 (ASN1_STRING *)&(*b)->serialNumber));
executed 1 time by 1 test: return (ASN1_STRING_cmp((ASN1_STRING *)&(*a)->serialNumber, (ASN1_STRING *)&(*b)->serialNumber));
Executed by:
  • libcrypto.so.1.1
1
421}-
422-
423int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev)-
424{-
425 X509_CRL_INFO *inf;-
426-
427 inf = &crl->crl;-
428 if (inf->revoked ==
inf->revoked == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
429 ((void *)0)
inf->revoked == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
430 )-
431 inf->revoked = sk_X509_REVOKED_new(X509_REVOKED_cmp);
never executed: inf->revoked = sk_X509_REVOKED_new(X509_REVOKED_cmp);
0
432 if (inf->revoked ==
inf->revoked == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
433 ((void *)0)
inf->revoked == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
434 || !sk_X509_REVOKED_push(inf->revoked, rev)
!sk_X509_REVOK...>revoked, rev)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
435 ERR_put_error(13,(169),((1|64)),__FILE__,317);-
436 return
never executed: return 0;
0;
never executed: return 0;
0
437 }-
438 inf->enc.modified = 1;-
439 return
never executed: return 1;
1;
never executed: return 1;
0
440}-
441-
442int X509_CRL_verify(X509_CRL *crl, EVP_PKEY *r)-
443{-
444 if (crl->meth->crl_verify
crl->meth->crl_verifyDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-5
445 return
executed 5 times by 1 test: return crl->meth->crl_verify(crl, r);
Executed by:
  • libcrypto.so.1.1
crl->meth->crl_verify(crl, r);
executed 5 times by 1 test: return crl->meth->crl_verify(crl, r);
Executed by:
  • libcrypto.so.1.1
5
446 return
never executed: return 0;
0;
never executed: return 0;
0
447}-
448-
449int X509_CRL_get0_by_serial(X509_CRL *crl,-
450 X509_REVOKED **ret, ASN1_INTEGER *serial)-
451{-
452 if (crl->meth->crl_lookup
crl->meth->crl_lookupDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
453 return
never executed: return crl->meth->crl_lookup(crl, ret, serial, ((void *)0) );
crl->meth->crl_lookup(crl, ret, serial,
never executed: return crl->meth->crl_lookup(crl, ret, serial, ((void *)0) );
0
454 ((void *)0)
never executed: return crl->meth->crl_lookup(crl, ret, serial, ((void *)0) );
0
455 );
never executed: return crl->meth->crl_lookup(crl, ret, serial, ((void *)0) );
0
456 return
never executed: return 0;
0;
never executed: return 0;
0
457}-
458-
459int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x)-
460{-
461 if (crl->meth->crl_lookup
crl->meth->crl_lookupDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-3
462 return
executed 3 times by 1 test: return crl->meth->crl_lookup(crl, ret, X509_get_serialNumber(x), X509_get_issuer_name(x));
Executed by:
  • libcrypto.so.1.1
crl->meth->crl_lookup(crl, ret,
executed 3 times by 1 test: return crl->meth->crl_lookup(crl, ret, X509_get_serialNumber(x), X509_get_issuer_name(x));
Executed by:
  • libcrypto.so.1.1
3
463 X509_get_serialNumber(x),
executed 3 times by 1 test: return crl->meth->crl_lookup(crl, ret, X509_get_serialNumber(x), X509_get_issuer_name(x));
Executed by:
  • libcrypto.so.1.1
3
464 X509_get_issuer_name(x));
executed 3 times by 1 test: return crl->meth->crl_lookup(crl, ret, X509_get_serialNumber(x), X509_get_issuer_name(x));
Executed by:
  • libcrypto.so.1.1
3
465 return
never executed: return 0;
0;
never executed: return 0;
0
466}-
467-
468static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r)-
469{-
470 return
executed 5 times by 1 test: return (ASN1_item_verify((&(X509_CRL_INFO_it)), &crl->sig_alg, &crl->signature, &crl->crl, r));
Executed by:
  • libcrypto.so.1.1
(ASN1_item_verify((&(X509_CRL_INFO_it)),
executed 5 times by 1 test: return (ASN1_item_verify((&(X509_CRL_INFO_it)), &crl->sig_alg, &crl->signature, &crl->crl, r));
Executed by:
  • libcrypto.so.1.1
5
471 &crl->sig_alg, &crl->signature, &crl->crl, r));
executed 5 times by 1 test: return (ASN1_item_verify((&(X509_CRL_INFO_it)), &crl->sig_alg, &crl->signature, &crl->crl, r));
Executed by:
  • libcrypto.so.1.1
5
472}-
473-
474static int crl_revoked_issuer_match(X509_CRL *crl, X509_NAME *nm,-
475 X509_REVOKED *rev)-
476{-
477 int i;-
478-
479 if (!rev->issuer
!rev->issuerDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1
480 if (!nm
!nmDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
481 return
never executed: return 1;
1;
never executed: return 1;
0
482 if (!X509_NAME_cmp(nm, X509_CRL_get_issuer(crl))
!X509_NAME_cmp...t_issuer(crl))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-1
483 return
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1
484 return
never executed: return 0;
0;
never executed: return 0;
0
485 }-
486-
487 if (!nm
!nmDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
488 nm = X509_CRL_get_issuer(crl);
never executed: nm = X509_CRL_get_issuer(crl);
0
489-
490 for (i = 0; i < sk_GENERAL_NAME_num(rev->issuer)
i < sk_GENERAL...m(rev->issuer)Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
491 GENERAL_NAME *gen = sk_GENERAL_NAME_value(rev->issuer, i);-
492 if (gen->type != 4
gen->type != 4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
493 continue;
never executed: continue;
0
494 if (!X509_NAME_cmp(nm, gen->d.directoryName)
!X509_NAME_cmp...directoryName)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
495 return
never executed: return 1;
1;
never executed: return 1;
0
496 }
never executed: end of block
0
497 return
never executed: return 0;
0;
never executed: return 0;
0
498-
499}-
500-
501static int def_crl_lookup(X509_CRL *crl,-
502 X509_REVOKED **ret, ASN1_INTEGER *serial,-
503 X509_NAME *issuer)-
504{-
505 X509_REVOKED rtmp, *rev;-
506 int idx, num;-
507-
508 if (crl->crl.revoked ==
crl->crl.revok...== ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-2
509 ((void *)0)
crl->crl.revok...== ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-2
510 )-
511 return
executed 2 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 2 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
2
512-
513-
514-
515-
516-
517 if (!sk_X509_REVOKED_is_sorted(crl->crl.revoked)
!sk_X509_REVOK...->crl.revoked)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1
518 CRYPTO_THREAD_write_lock(crl->lock);-
519 sk_X509_REVOKED_sort(crl->crl.revoked);-
520 CRYPTO_THREAD_unlock(crl->lock);-
521 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
522 rtmp.serialNumber = *serial;-
523 idx = sk_X509_REVOKED_find(crl->crl.revoked, &rtmp);-
524 if (idx < 0
idx < 0Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
525 return
never executed: return 0;
0;
never executed: return 0;
0
526-
527 for (num = sk_X509_REVOKED_num(crl->crl.revoked); idx < num
idx < numDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
; idx++) {
0-1
528 rev = sk_X509_REVOKED_value(crl->crl.revoked, idx);-
529 if (ASN1_INTEGER_cmp(&rev->serialNumber, serial)
ASN1_INTEGER_c...umber, serial)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
530 return
never executed: return 0;
0;
never executed: return 0;
0
531 if (crl_revoked_issuer_match(crl, issuer, rev)
crl_revoked_is..., issuer, rev)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1
532 if (ret
retDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-1
533 *
executed 1 time by 1 test: *ret = rev;
Executed by:
  • libcrypto.so.1.1
ret = rev;
executed 1 time by 1 test: *ret = rev;
Executed by:
  • libcrypto.so.1.1
1
534 if (rev->reason == 8
rev->reason == 8Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
535 return
never executed: return 2;
2;
never executed: return 2;
0
536 return
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1
537 }-
538 }
never executed: end of block
0
539 return
never executed: return 0;
0;
never executed: return 0;
0
540}-
541-
542void X509_CRL_set_default_method(const X509_CRL_METHOD *meth)-
543{-
544 if (meth ==
meth == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
545 ((void *)0)
meth == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
546 )-
547 default_crl_method = &int_crl_meth;
never executed: default_crl_method = &int_crl_meth;
0
548 else-
549 default_crl_method = meth;
never executed: default_crl_method = meth;
0
550}-
551-
552X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl),-
553 int (*crl_free) (X509_CRL *crl),-
554 int (*crl_lookup) (X509_CRL *crl,-
555 X509_REVOKED **ret,-
556 ASN1_INTEGER *ser,-
557 X509_NAME *issuer),-
558 int (*crl_verify) (X509_CRL *crl,-
559 EVP_PKEY *pk))-
560{-
561 X509_CRL_METHOD *m = CRYPTO_malloc(sizeof(*m), __FILE__, 437);-
562-
563 if (m ==
m == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
564 ((void *)0)
m == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
565 ) {-
566 ERR_put_error(11,(154),((1|64)),__FILE__,440);-
567 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
568 ((void *)0)
never executed: return ((void *)0) ;
0
569 ;
never executed: return ((void *)0) ;
0
570 }-
571 m->crl_init = crl_init;-
572 m->crl_free = crl_free;-
573 m->crl_lookup = crl_lookup;-
574 m->crl_verify = crl_verify;-
575 m->flags = 1;-
576 return
never executed: return m;
m;
never executed: return m;
0
577}-
578-
579void X509_CRL_METHOD_free(X509_CRL_METHOD *m)-
580{-
581 if (m ==
m == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
582 ((void *)0)
m == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
583 || !(m->flags & 1)
!(m->flags & 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
584 return;
never executed: return;
0
585 CRYPTO_free(m, __FILE__, 455);-
586}
never executed: end of block
0
587-
588void X509_CRL_set_meth_data(X509_CRL *crl, void *dat)-
589{-
590 crl->meth_data = dat;-
591}
never executed: end of block
0
592-
593void *X509_CRL_get_meth_data(X509_CRL *crl)-
594{-
595 return
never executed: return crl->meth_data;
crl->meth_data;
never executed: return crl->meth_data;
0
596}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2