Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/t_x509.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | int X509_print_fp(FILE *fp, X509 *x) | - | ||||||||||||
5 | { | - | ||||||||||||
6 | return never executed: X509_print_ex_fp(fp, x, 0, 0);return X509_print_ex_fp(fp, x, 0, 0); never executed: return X509_print_ex_fp(fp, x, 0, 0); | 0 | ||||||||||||
7 | } | - | ||||||||||||
8 | - | |||||||||||||
9 | int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, | - | ||||||||||||
10 | unsigned long cflag) | - | ||||||||||||
11 | { | - | ||||||||||||
12 | BIO *b; | - | ||||||||||||
13 | int ret; | - | ||||||||||||
14 | - | |||||||||||||
15 | if ((
| 0 | ||||||||||||
16 | ((void *)0)
| 0 | ||||||||||||
17 | ) { | - | ||||||||||||
18 | ERR_put_error(11,(118),(7),__FILE__,32); | - | ||||||||||||
19 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
20 | } | - | ||||||||||||
21 | BIO_ctrl(b,106,0x00,(char *)(fp)); | - | ||||||||||||
22 | ret = X509_print_ex(b, x, nmflag, cflag); | - | ||||||||||||
23 | BIO_free(b); | - | ||||||||||||
24 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||
25 | } | - | ||||||||||||
26 | - | |||||||||||||
27 | - | |||||||||||||
28 | int X509_print(BIO *bp, X509 *x) | - | ||||||||||||
29 | { | - | ||||||||||||
30 | return executed 1470 times by 1 test: X509_print_ex(bp, x, 0, 0);return X509_print_ex(bp, x, 0, 0); Executed by:
executed 1470 times by 1 test: return X509_print_ex(bp, x, 0, 0); Executed by:
| 1470 | ||||||||||||
31 | } | - | ||||||||||||
32 | - | |||||||||||||
33 | int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, | - | ||||||||||||
34 | unsigned long cflag) | - | ||||||||||||
35 | { | - | ||||||||||||
36 | long l; | - | ||||||||||||
37 | int ret = 0, i; | - | ||||||||||||
38 | char *m = | - | ||||||||||||
39 | ((void *)0) | - | ||||||||||||
40 | , mlch = ' '; | - | ||||||||||||
41 | int nmindent = 0; | - | ||||||||||||
42 | ASN1_INTEGER *bs; | - | ||||||||||||
43 | EVP_PKEY *pkey = | - | ||||||||||||
44 | ((void *)0) | - | ||||||||||||
45 | ; | - | ||||||||||||
46 | const char *neg; | - | ||||||||||||
47 | - | |||||||||||||
48 | if ((
| 2-1489 | ||||||||||||
49 | mlch = '\n'; | - | ||||||||||||
50 | nmindent = 12; | - | ||||||||||||
51 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||
52 | - | |||||||||||||
53 | if (nmflags == 0
| 21-1470 | ||||||||||||
54 | nmindent = 16; executed 1470 times by 1 test: nmindent = 16; Executed by:
| 1470 | ||||||||||||
55 | - | |||||||||||||
56 | if (!(cflag & 1L)
| 2-1489 | ||||||||||||
57 | if (BIO_write(bp, "Certificate:\n", 13) <= 0
| 0-1489 | ||||||||||||
58 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
59 | if (BIO_write(bp, " Data:\n", 10) <= 0
| 0-1489 | ||||||||||||
60 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
61 | } executed 1489 times by 1 test: end of block Executed by:
| 1489 | ||||||||||||
62 | if (!(cflag & (1L << 1))
| 2-1489 | ||||||||||||
63 | l = X509_get_version(x); | - | ||||||||||||
64 | if (l >= 0
| 11-1476 | ||||||||||||
65 | if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, (unsigned long)l) <= 0
| 0-1465 | ||||||||||||
66 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
67 | } executed 1465 times by 1 test: else {end of block Executed by:
| 1465 | ||||||||||||
68 | if (BIO_printf(bp, "%8sVersion: Unknown (%ld)\n", "", l) <= 0
| 0-24 | ||||||||||||
69 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
70 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||
71 | } | - | ||||||||||||
72 | if (!(cflag & (1L << 2))
| 0-1491 | ||||||||||||
73 | - | |||||||||||||
74 | if (BIO_write(bp, " Serial Number:", 22) <= 0
| 0-1491 | ||||||||||||
75 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
76 | - | |||||||||||||
77 | bs = X509_get_serialNumber(x); | - | ||||||||||||
78 | if (bs->length <= (int)sizeof(long)
| 188-1303 | ||||||||||||
79 | ERR_set_mark(); | - | ||||||||||||
80 | l = ASN1_INTEGER_get(bs); | - | ||||||||||||
81 | ERR_pop_to_mark(); | - | ||||||||||||
82 | } executed 1303 times by 1 test: else {end of block Executed by:
| 1303 | ||||||||||||
83 | l = -1; | - | ||||||||||||
84 | } executed 188 times by 1 test: end of block Executed by:
| 188 | ||||||||||||
85 | if (l != -1
| 326-1165 | ||||||||||||
86 | unsigned long ul; | - | ||||||||||||
87 | if (bs->type == (2 | 0x100)
| 267-898 | ||||||||||||
88 | ul = 0 - (unsigned long)l; | - | ||||||||||||
89 | neg = "-"; | - | ||||||||||||
90 | } executed 267 times by 1 test: else {end of block Executed by:
| 267 | ||||||||||||
91 | ul = l; | - | ||||||||||||
92 | neg = ""; | - | ||||||||||||
93 | } executed 898 times by 1 test: end of block Executed by:
| 898 | ||||||||||||
94 | if (BIO_printf(bp, " %s%lu (%s0x%lx)\n", neg, ul, neg, ul) <= 0
| 0-1165 | ||||||||||||
95 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
96 | } executed 1165 times by 1 test: else {end of block Executed by:
| 1165 | ||||||||||||
97 | neg = (
| 54-272 | ||||||||||||
98 | if (BIO_printf(bp, "\n%12s%s", "", neg) <= 0
| 0-326 | ||||||||||||
99 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
100 | - | |||||||||||||
101 | for (i = 0; i < bs->length
| 326-5278 | ||||||||||||
102 | if (BIO_printf(bp, "%02x%c", bs->data[i],
| 0-5278 | ||||||||||||
103 | ((i + 1 == bs->length) ? '\n' : ':')) <= 0
| 0-5278 | ||||||||||||
104 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
105 | } executed 5278 times by 1 test: end of block Executed by:
| 5278 | ||||||||||||
106 | } executed 326 times by 1 test: end of block Executed by:
| 326 | ||||||||||||
107 | - | |||||||||||||
108 | } | - | ||||||||||||
109 | - | |||||||||||||
110 | if (!(cflag & (1L << 3))
| 2-1489 | ||||||||||||
111 | const X509_ALGOR *tsig_alg = X509_get0_tbs_sigalg(x); | - | ||||||||||||
112 | - | |||||||||||||
113 | if (BIO_puts(bp, " ") <= 0
| 0-1489 | ||||||||||||
114 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
115 | if (X509_signature_print(bp, tsig_alg,
| 0-1489 | ||||||||||||
116 | ((void *)0)
| 0-1489 | ||||||||||||
117 | ) <= 0
| 0-1489 | ||||||||||||
118 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
119 | } executed 1489 times by 1 test: end of block Executed by:
| 1489 | ||||||||||||
120 | - | |||||||||||||
121 | if (!(cflag & (1L << 4))
| 2-1489 | ||||||||||||
122 | if (BIO_printf(bp, " Issuer:%c", mlch) <= 0
| 0-1489 | ||||||||||||
123 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
124 | if (X509_NAME_print_ex(bp, X509_get_issuer_name(x), nmindent, nmflags)
| 0-1489 | ||||||||||||
125 | < 0
| 0-1489 | ||||||||||||
126 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
127 | if (BIO_write(bp, "\n", 1) <= 0
| 0-1489 | ||||||||||||
128 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
129 | } executed 1489 times by 1 test: end of block Executed by:
| 1489 | ||||||||||||
130 | if (!(cflag & (1L << 5))
| 0-1491 | ||||||||||||
131 | if (BIO_write(bp, " Validity\n", 17) <= 0
| 0-1491 | ||||||||||||
132 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
133 | if (BIO_write(bp, " Not Before: ", 24) <= 0
| 0-1491 | ||||||||||||
134 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
135 | if (!ASN1_TIME_print(bp, X509_get0_notBefore(x))
| 140-1351 | ||||||||||||
136 | goto executed 140 times by 1 test: err;goto err; Executed by:
executed 140 times by 1 test: goto err; Executed by:
| 140 | ||||||||||||
137 | if (BIO_write(bp, "\n Not After : ", 25) <= 0
| 0-1351 | ||||||||||||
138 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
139 | if (!ASN1_TIME_print(bp, X509_get0_notAfter(x))
| 5-1346 | ||||||||||||
140 | goto executed 5 times by 1 test: err;goto err; Executed by:
executed 5 times by 1 test: goto err; Executed by:
| 5 | ||||||||||||
141 | if (BIO_write(bp, "\n", 1) <= 0
| 0-1346 | ||||||||||||
142 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
143 | } executed 1346 times by 1 test: end of block Executed by:
| 1346 | ||||||||||||
144 | if (!(cflag & (1L << 6))
| 0-1346 | ||||||||||||
145 | if (BIO_printf(bp, " Subject:%c", mlch) <= 0
| 0-1346 | ||||||||||||
146 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
147 | if (X509_NAME_print_ex
| 0-1346 | ||||||||||||
148 | (bp, X509_get_subject_name(x), nmindent, nmflags) < 0
| 0-1346 | ||||||||||||
149 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
150 | if (BIO_write(bp, "\n", 1) <= 0
| 0-1346 | ||||||||||||
151 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
152 | } executed 1346 times by 1 test: end of block Executed by:
| 1346 | ||||||||||||
153 | if (!(cflag & (1L << 7))
| 2-1344 | ||||||||||||
154 | X509_PUBKEY *xpkey = X509_get_X509_PUBKEY(x); | - | ||||||||||||
155 | ASN1_OBJECT *xpoid; | - | ||||||||||||
156 | X509_PUBKEY_get0_param(&xpoid, | - | ||||||||||||
157 | ((void *)0) | - | ||||||||||||
158 | , | - | ||||||||||||
159 | ((void *)0) | - | ||||||||||||
160 | , | - | ||||||||||||
161 | ((void *)0) | - | ||||||||||||
162 | , xpkey); | - | ||||||||||||
163 | if (BIO_write(bp, " Subject Public Key Info:\n", 33) <= 0
| 0-1344 | ||||||||||||
164 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
165 | if (BIO_printf(bp, "%12sPublic Key Algorithm: ", "") <= 0
| 0-1344 | ||||||||||||
166 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
167 | if (i2a_ASN1_OBJECT(bp, xpoid) <= 0
| 0-1344 | ||||||||||||
168 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
169 | if (BIO_puts(bp, "\n") <= 0
| 0-1344 | ||||||||||||
170 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
171 | - | |||||||||||||
172 | pkey = X509_get0_pubkey(x); | - | ||||||||||||
173 | if (pkey ==
| 241-1103 | ||||||||||||
174 | ((void *)0)
| 241-1103 | ||||||||||||
175 | ) { | - | ||||||||||||
176 | BIO_printf(bp, "%12sUnable to load Public Key\n", ""); | - | ||||||||||||
177 | ERR_print_errors(bp); | - | ||||||||||||
178 | } executed 1103 times by 1 test: else {end of block Executed by:
| 1103 | ||||||||||||
179 | EVP_PKEY_print_public(bp, pkey, 16, | - | ||||||||||||
180 | ((void *)0) | - | ||||||||||||
181 | ); | - | ||||||||||||
182 | } executed 241 times by 1 test: end of block Executed by:
| 241 | ||||||||||||
183 | } | - | ||||||||||||
184 | - | |||||||||||||
185 | if (!(cflag & (1L << 12))
| 0-1346 | ||||||||||||
186 | const ASN1_BIT_STRING *iuid, *suid; | - | ||||||||||||
187 | X509_get0_uids(x, &iuid, &suid); | - | ||||||||||||
188 | if (iuid !=
| 18-1328 | ||||||||||||
189 | ((void *)0)
| 18-1328 | ||||||||||||
190 | ) { | - | ||||||||||||
191 | if (BIO_printf(bp, "%8sIssuer Unique ID: ", "") <= 0
| 0-18 | ||||||||||||
192 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
193 | if (!X509_signature_dump(bp, iuid, 12)
| 0-18 | ||||||||||||
194 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
195 | } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||||||||
196 | if (suid !=
| 16-1330 | ||||||||||||
197 | ((void *)0)
| 16-1330 | ||||||||||||
198 | ) { | - | ||||||||||||
199 | if (BIO_printf(bp, "%8sSubject Unique ID: ", "") <= 0
| 0-16 | ||||||||||||
200 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
201 | if (!X509_signature_dump(bp, suid, 12)
| 0-16 | ||||||||||||
202 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
203 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||||||||
204 | } executed 1346 times by 1 test: end of block Executed by:
| 1346 | ||||||||||||
205 | - | |||||||||||||
206 | if (!(cflag & (1L << 8))
| 0-1346 | ||||||||||||
207 | X509V3_extensions_print(bp, "X509v3 extensions", executed 1346 times by 1 test: X509V3_extensions_print(bp, "X509v3 extensions", X509_get0_extensions(x), cflag, 8); Executed by:
| 1346 | ||||||||||||
208 | X509_get0_extensions(x), cflag, 8); executed 1346 times by 1 test: X509V3_extensions_print(bp, "X509v3 extensions", X509_get0_extensions(x), cflag, 8); Executed by:
| 1346 | ||||||||||||
209 | - | |||||||||||||
210 | if (!(cflag & (1L << 9))
| 2-1344 | ||||||||||||
211 | const X509_ALGOR *sig_alg; | - | ||||||||||||
212 | const ASN1_BIT_STRING *sig; | - | ||||||||||||
213 | X509_get0_signature(&sig, &sig_alg, x); | - | ||||||||||||
214 | if (X509_signature_print(bp, sig_alg, sig) <= 0
| 0-1344 | ||||||||||||
215 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
216 | } executed 1344 times by 1 test: end of block Executed by:
| 1344 | ||||||||||||
217 | if (!(cflag & (1L << 10))
| 0-1346 | ||||||||||||
218 | if (!X509_aux_print(bp, x, 0)
| 0-1346 | ||||||||||||
219 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
220 | } executed 1346 times by 1 test: end of block Executed by:
| 1346 | ||||||||||||
221 | ret = 1; | - | ||||||||||||
222 | err: code before this statement executed 1346 times by 1 test: err: Executed by:
| 1346 | ||||||||||||
223 | CRYPTO_free(m, __FILE__, 217); | - | ||||||||||||
224 | return executed 1491 times by 1 test: ret;return ret; Executed by:
executed 1491 times by 1 test: return ret; Executed by:
| 1491 | ||||||||||||
225 | } | - | ||||||||||||
226 | - | |||||||||||||
227 | int X509_ocspid_print(BIO *bp, X509 *x) | - | ||||||||||||
228 | { | - | ||||||||||||
229 | unsigned char *der = | - | ||||||||||||
230 | ((void *)0) | - | ||||||||||||
231 | ; | - | ||||||||||||
232 | unsigned char *dertmp; | - | ||||||||||||
233 | int derlen; | - | ||||||||||||
234 | int i; | - | ||||||||||||
235 | unsigned char SHA1md[20]; | - | ||||||||||||
236 | ASN1_BIT_STRING *keybstr; | - | ||||||||||||
237 | X509_NAME *subj; | - | ||||||||||||
238 | - | |||||||||||||
239 | - | |||||||||||||
240 | - | |||||||||||||
241 | - | |||||||||||||
242 | if (BIO_printf(bp, " Subject OCSP hash: ") <= 0
| 0 | ||||||||||||
243 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
244 | subj = X509_get_subject_name(x); | - | ||||||||||||
245 | derlen = i2d_X509_NAME(subj, | - | ||||||||||||
246 | ((void *)0) | - | ||||||||||||
247 | ); | - | ||||||||||||
248 | if ((
| 0 | ||||||||||||
249 | ((void *)0)
| 0 | ||||||||||||
250 | ) | - | ||||||||||||
251 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
252 | i2d_X509_NAME(subj, &dertmp); | - | ||||||||||||
253 | - | |||||||||||||
254 | if (!EVP_Digest(der, derlen, SHA1md,
| 0 | ||||||||||||
255 | ((void *)0)
| 0 | ||||||||||||
256 | , EVP_sha1(),
| 0 | ||||||||||||
257 | ((void *)0)
| 0 | ||||||||||||
258 | )
| 0 | ||||||||||||
259 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
260 | for (i = 0; i < 20
| 0 | ||||||||||||
261 | if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0
| 0 | ||||||||||||
262 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
263 | } never executed: end of block | 0 | ||||||||||||
264 | CRYPTO_free(der, __FILE__, 248); | - | ||||||||||||
265 | der = | - | ||||||||||||
266 | ((void *)0) | - | ||||||||||||
267 | ; | - | ||||||||||||
268 | - | |||||||||||||
269 | - | |||||||||||||
270 | - | |||||||||||||
271 | - | |||||||||||||
272 | if (BIO_printf(bp, "\n Public key OCSP hash: ") <= 0
| 0 | ||||||||||||
273 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
274 | - | |||||||||||||
275 | keybstr = X509_get0_pubkey_bitstr(x); | - | ||||||||||||
276 | - | |||||||||||||
277 | if (keybstr ==
| 0 | ||||||||||||
278 | ((void *)0)
| 0 | ||||||||||||
279 | ) | - | ||||||||||||
280 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
281 | - | |||||||||||||
282 | if (!EVP_Digest(ASN1_STRING_get0_data(keybstr),
| 0 | ||||||||||||
283 | ASN1_STRING_length(keybstr), SHA1md,
| 0 | ||||||||||||
284 | ((void *)0)
| 0 | ||||||||||||
285 | , EVP_sha1(),
| 0 | ||||||||||||
286 |
| 0 | ||||||||||||
287 | ((void *)0)
| 0 | ||||||||||||
288 | )
| 0 | ||||||||||||
289 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
290 | for (i = 0; i < 20
| 0 | ||||||||||||
291 | if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0
| 0 | ||||||||||||
292 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
293 | } never executed: end of block | 0 | ||||||||||||
294 | BIO_printf(bp, "\n"); | - | ||||||||||||
295 | - | |||||||||||||
296 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||
297 | err: | - | ||||||||||||
298 | CRYPTO_free(der, __FILE__, 274); | - | ||||||||||||
299 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
300 | } | - | ||||||||||||
301 | - | |||||||||||||
302 | int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) | - | ||||||||||||
303 | { | - | ||||||||||||
304 | const unsigned char *s; | - | ||||||||||||
305 | int i, n; | - | ||||||||||||
306 | - | |||||||||||||
307 | n = sig->length; | - | ||||||||||||
308 | s = sig->data; | - | ||||||||||||
309 | for (i = 0; i < n
| 3201-122440 | ||||||||||||
310 | if ((
| 7556-114884 | ||||||||||||
311 | if (BIO_write(bp, "\n", 1) <= 0
| 0-7556 | ||||||||||||
312 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
313 | if (BIO_indent(bp, indent, indent) <= 0
| 0-7556 | ||||||||||||
314 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
315 | } executed 7556 times by 1 test: end of block Executed by:
| 7556 | ||||||||||||
316 | if (BIO_printf(bp, "%02x%s", s[i], ((i + 1) == n) ? "" : ":") <= 0
| 0-122440 | ||||||||||||
317 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
318 | } executed 122440 times by 1 test: end of block Executed by:
| 122440 | ||||||||||||
319 | if (BIO_write(bp, "\n", 1) != 1
| 0-3201 | ||||||||||||
320 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
321 | - | |||||||||||||
322 | return executed 3201 times by 1 test: 1;return 1; Executed by:
executed 3201 times by 1 test: return 1; Executed by:
| 3201 | ||||||||||||
323 | } | - | ||||||||||||
324 | - | |||||||||||||
325 | int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, | - | ||||||||||||
326 | const ASN1_STRING *sig) | - | ||||||||||||
327 | { | - | ||||||||||||
328 | int sig_nid; | - | ||||||||||||
329 | if (BIO_puts(bp, " Signature Algorithm: ") <= 0
| 0-6516 | ||||||||||||
330 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
331 | if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0
| 0-6516 | ||||||||||||
332 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
333 | - | |||||||||||||
334 | sig_nid = OBJ_obj2nid(sigalg->algorithm); | - | ||||||||||||
335 | if (sig_nid != 0
| 1674-4842 | ||||||||||||
336 | int pkey_nid, dig_nid; | - | ||||||||||||
337 | const EVP_PKEY_ASN1_METHOD *ameth; | - | ||||||||||||
338 | if (OBJ_find_sigid_algs(sig_nid, &dig_nid, &pkey_nid)
| 624-1050 | ||||||||||||
339 | ameth = EVP_PKEY_asn1_find( | - | ||||||||||||
340 | ((void *)0) | - | ||||||||||||
341 | , pkey_nid); | - | ||||||||||||
342 | if (ameth
| 10-1040 | ||||||||||||
343 | return executed 968 times by 1 test: ameth->sig_print(bp, sigalg, sig, 9, 0);return ameth->sig_print(bp, sigalg, sig, 9, 0); Executed by:
executed 968 times by 1 test: return ameth->sig_print(bp, sigalg, sig, 9, 0); Executed by:
| 968 | ||||||||||||
344 | } executed 82 times by 1 test: end of block Executed by:
| 82 | ||||||||||||
345 | } executed 706 times by 1 test: end of block Executed by:
| 706 | ||||||||||||
346 | if (sig
| 2688-2860 | ||||||||||||
347 | return executed 2688 times by 1 test: X509_signature_dump(bp, sig, 9);return X509_signature_dump(bp, sig, 9); Executed by:
executed 2688 times by 1 test: return X509_signature_dump(bp, sig, 9); Executed by:
| 2688 | ||||||||||||
348 | else if (BIO_puts(bp, "\n") <= 0
| 0-2860 | ||||||||||||
349 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
350 | return executed 2860 times by 1 test: 1;return 1; Executed by:
executed 2860 times by 1 test: return 1; Executed by:
| 2860 | ||||||||||||
351 | } | - | ||||||||||||
352 | - | |||||||||||||
353 | int X509_aux_print(BIO *out, X509 *x, int indent) | - | ||||||||||||
354 | { | - | ||||||||||||
355 | char oidstr[80], first; | - | ||||||||||||
356 | struct stack_st_ASN1_OBJECT *trust, *reject; | - | ||||||||||||
357 | const unsigned char *alias, *keyid; | - | ||||||||||||
358 | int keyidlen; | - | ||||||||||||
359 | int i; | - | ||||||||||||
360 | if (X509_trusted(x) == 0
| 0-1346 | ||||||||||||
361 | return executed 1346 times by 1 test: 1;return 1; Executed by:
executed 1346 times by 1 test: return 1; Executed by:
| 1346 | ||||||||||||
362 | trust = X509_get0_trust_objects(x); | - | ||||||||||||
363 | reject = X509_get0_reject_objects(x); | - | ||||||||||||
364 | if (trust
| 0 | ||||||||||||
365 | first = 1; | - | ||||||||||||
366 | BIO_printf(out, "%*sTrusted Uses:\n%*s", indent, "", indent + 2, ""); | - | ||||||||||||
367 | for (i = 0; i < sk_ASN1_OBJECT_num(trust)
| 0 | ||||||||||||
368 | if (!first
| 0 | ||||||||||||
369 | BIO_puts(out, ", "); never executed: BIO_puts(out, ", "); | 0 | ||||||||||||
370 | else | - | ||||||||||||
371 | first = 0; never executed: first = 0; | 0 | ||||||||||||
372 | OBJ_obj2txt(oidstr, sizeof(oidstr), | - | ||||||||||||
373 | sk_ASN1_OBJECT_value(trust, i), 0); | - | ||||||||||||
374 | BIO_puts(out, oidstr); | - | ||||||||||||
375 | } never executed: end of block | 0 | ||||||||||||
376 | BIO_puts(out, "\n"); | - | ||||||||||||
377 | } never executed: elseend of block | 0 | ||||||||||||
378 | BIO_printf(out, "%*sNo Trusted Uses.\n", indent, ""); never executed: BIO_printf(out, "%*sNo Trusted Uses.\n", indent, ""); | 0 | ||||||||||||
379 | if (reject
| 0 | ||||||||||||
380 | first = 1; | - | ||||||||||||
381 | BIO_printf(out, "%*sRejected Uses:\n%*s", indent, "", indent + 2, ""); | - | ||||||||||||
382 | for (i = 0; i < sk_ASN1_OBJECT_num(reject)
| 0 | ||||||||||||
383 | if (!first
| 0 | ||||||||||||
384 | BIO_puts(out, ", "); never executed: BIO_puts(out, ", "); | 0 | ||||||||||||
385 | else | - | ||||||||||||
386 | first = 0; never executed: first = 0; | 0 | ||||||||||||
387 | OBJ_obj2txt(oidstr, sizeof(oidstr), | - | ||||||||||||
388 | sk_ASN1_OBJECT_value(reject, i), 0); | - | ||||||||||||
389 | BIO_puts(out, oidstr); | - | ||||||||||||
390 | } never executed: end of block | 0 | ||||||||||||
391 | BIO_puts(out, "\n"); | - | ||||||||||||
392 | } never executed: elseend of block | 0 | ||||||||||||
393 | BIO_printf(out, "%*sNo Rejected Uses.\n", indent, ""); never executed: BIO_printf(out, "%*sNo Rejected Uses.\n", indent, ""); | 0 | ||||||||||||
394 | alias = X509_alias_get0(x, | - | ||||||||||||
395 | ((void *)0) | - | ||||||||||||
396 | ); | - | ||||||||||||
397 | if (alias
| 0 | ||||||||||||
398 | BIO_printf(out, "%*sAlias: %s\n", indent, "", alias); never executed: BIO_printf(out, "%*sAlias: %s\n", indent, "", alias); | 0 | ||||||||||||
399 | keyid = X509_keyid_get0(x, &keyidlen); | - | ||||||||||||
400 | if (keyid
| 0 | ||||||||||||
401 | BIO_printf(out, "%*sKey Id: ", indent, ""); | - | ||||||||||||
402 | for (i = 0; i < keyidlen
| 0 | ||||||||||||
403 | BIO_printf(out, "%s%02X", i ? ":" : "", keyid[i]); never executed: BIO_printf(out, "%s%02X", i ? ":" : "", keyid[i]); | 0 | ||||||||||||
404 | BIO_write(out, "\n", 1); | - | ||||||||||||
405 | } never executed: end of block | 0 | ||||||||||||
406 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||
407 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |