OpenCoverage

t_x509.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/t_x509.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4int X509_print_fp(FILE *fp, X509 *x)-
5{-
6 return
never executed: return X509_print_ex_fp(fp, x, 0, 0);
X509_print_ex_fp(fp, x, 0, 0);
never executed: return X509_print_ex_fp(fp, x, 0, 0);
0
7}-
8-
9int 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 ((
(b = BIO_new(B...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
b = BIO_new(BIO_s_file())) ==
(b = BIO_new(B...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
16 ((void *)0)
(b = BIO_new(B...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
17 ) {-
18 ERR_put_error(11,(118),(7),__FILE__,32);-
19 return
never executed: return 0;
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: return ret;
ret;
never executed: return ret;
0
25}-
26-
27-
28int X509_print(BIO *bp, X509 *x)-
29{-
30 return
executed 1470 times by 1 test: return X509_print_ex(bp, x, 0, 0);
Executed by:
  • libcrypto.so.1.1
X509_print_ex(bp, x, 0, 0);
executed 1470 times by 1 test: return X509_print_ex(bp, x, 0, 0);
Executed by:
  • libcrypto.so.1.1
1470
31}-
32-
33int 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 ((
(nmflags & (0x...) == (4 << 16)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
nmflags & (0xf << 16)) == (4 << 16)
(nmflags & (0x...) == (4 << 16)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-1489
49 mlch = '\n';-
50 nmindent = 12;-
51 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
52-
53 if (nmflags == 0
nmflags == 0Description
TRUEevaluated 1470 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
21-1470
54 nmindent = 16;
executed 1470 times by 1 test: nmindent = 16;
Executed by:
  • libcrypto.so.1.1
1470
55-
56 if (!(cflag & 1L)
!(cflag & 1L)Description
TRUEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-1489
57 if (BIO_write(bp, "Certificate:\n", 13) <= 0
BIO_write(bp, ...:\n", 13) <= 0Description
TRUEnever evaluated
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1489
58 goto
never executed: goto err;
err;
never executed: goto err;
0
59 if (BIO_write(bp, " Data:\n", 10) <= 0
BIO_write(bp, ...:\n", 10) <= 0Description
TRUEnever evaluated
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1489
60 goto
never executed: goto err;
err;
never executed: goto err;
0
61 }
executed 1489 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1489
62 if (!(cflag & (1L << 1))
!(cflag & (1L << 1))Description
TRUEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-1489
63 l = X509_get_version(x);-
64 if (l >= 0
l >= 0Description
TRUEevaluated 1476 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& l <= 2
l <= 2Description
TRUEevaluated 1465 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
11-1476
65 if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, (unsigned long)l) <= 0
BIO_printf(bp,...d long)l) <= 0Description
TRUEnever evaluated
FALSEevaluated 1465 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1465
66 goto
never executed: goto err;
err;
never executed: goto err;
0
67 }
executed 1465 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
1465
68 if (BIO_printf(bp, "%8sVersion: Unknown (%ld)\n", "", l) <= 0
BIO_printf(bp,...", "", l) <= 0Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-24
69 goto
never executed: goto err;
err;
never executed: goto err;
0
70 }
executed 24 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
24
71 }-
72 if (!(cflag & (1L << 2))
!(cflag & (1L << 2))Description
TRUEevaluated 1491 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1491
73-
74 if (BIO_write(bp, " Serial Number:", 22) <= 0
BIO_write(bp, ...er:", 22) <= 0Description
TRUEnever evaluated
FALSEevaluated 1491 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1491
75 goto
never executed: goto err;
err;
never executed: goto err;
0
76-
77 bs = X509_get_serialNumber(x);-
78 if (bs->length <= (int)sizeof(long)
bs->length <= ...t)sizeof(long)Description
TRUEevaluated 1303 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 188 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
188-1303
79 ERR_set_mark();-
80 l = ASN1_INTEGER_get(bs);-
81 ERR_pop_to_mark();-
82 }
executed 1303 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
1303
83 l = -1;-
84 }
executed 188 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
188
85 if (l != -1
l != -1Description
TRUEevaluated 1165 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
326-1165
86 unsigned long ul;-
87 if (bs->type == (2 | 0x100)
bs->type == (2 | 0x100)Description
TRUEevaluated 267 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 898 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
267-898
88 ul = 0 - (unsigned long)l;-
89 neg = "-";-
90 }
executed 267 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
267
91 ul = l;-
92 neg = "";-
93 }
executed 898 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
898
94 if (BIO_printf(bp, " %s%lu (%s0x%lx)\n", neg, ul, neg, ul) <= 0
BIO_printf(bp,... neg, ul) <= 0Description
TRUEnever evaluated
FALSEevaluated 1165 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1165
95 goto
never executed: goto err;
err;
never executed: goto err;
0
96 }
executed 1165 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
1165
97 neg = (
(bs->type == (2 | 0x100))Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 272 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bs->type == (2 | 0x100))
(bs->type == (2 | 0x100))Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 272 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? " (Negative)" : "";
54-272
98 if (BIO_printf(bp, "\n%12s%s", "", neg) <= 0
BIO_printf(bp,... "", neg) <= 0Description
TRUEnever evaluated
FALSEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-326
99 goto
never executed: goto err;
err;
never executed: goto err;
0
100-
101 for (i = 0; i < bs->length
i < bs->lengthDescription
TRUEevaluated 5278 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
326-5278
102 if (BIO_printf(bp, "%02x%c", bs->data[i],
BIO_printf(bp,...' : ':')) <= 0Description
TRUEnever evaluated
FALSEevaluated 5278 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5278
103 ((i + 1 == bs->length) ? '\n' : ':')) <= 0
BIO_printf(bp,...' : ':')) <= 0Description
TRUEnever evaluated
FALSEevaluated 5278 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5278
104 goto
never executed: goto err;
err;
never executed: goto err;
0
105 }
executed 5278 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5278
106 }
executed 326 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
326
107-
108 }-
109-
110 if (!(cflag & (1L << 3))
!(cflag & (1L << 3))Description
TRUEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-1489
111 const X509_ALGOR *tsig_alg = X509_get0_tbs_sigalg(x);-
112-
113 if (BIO_puts(bp, " ") <= 0
BIO_puts(bp, " ") <= 0Description
TRUEnever evaluated
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1489
114 goto
never executed: goto err;
err;
never executed: goto err;
0
115 if (X509_signature_print(bp, tsig_alg,
X509_signature...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1489
116 ((void *)0)
X509_signature...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1489
117 ) <= 0
X509_signature...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1489
118 goto
never executed: goto err;
err;
never executed: goto err;
0
119 }
executed 1489 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1489
120-
121 if (!(cflag & (1L << 4))
!(cflag & (1L << 4))Description
TRUEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-1489
122 if (BIO_printf(bp, " Issuer:%c", mlch) <= 0
BIO_printf(bp,...c", mlch) <= 0Description
TRUEnever evaluated
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1489
123 goto
never executed: goto err;
err;
never executed: goto err;
0
124 if (X509_NAME_print_ex(bp, X509_get_issuer_name(x), nmindent, nmflags)
X509_NAME_prin..., nmflags) < 0Description
TRUEnever evaluated
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1489
125 < 0
X509_NAME_prin..., nmflags) < 0Description
TRUEnever evaluated
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1489
126 goto
never executed: goto err;
err;
never executed: goto err;
0
127 if (BIO_write(bp, "\n", 1) <= 0
BIO_write(bp, "\n", 1) <= 0Description
TRUEnever evaluated
FALSEevaluated 1489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1489
128 goto
never executed: goto err;
err;
never executed: goto err;
0
129 }
executed 1489 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1489
130 if (!(cflag & (1L << 5))
!(cflag & (1L << 5))Description
TRUEevaluated 1491 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1491
131 if (BIO_write(bp, " Validity\n", 17) <= 0
BIO_write(bp, ...y\n", 17) <= 0Description
TRUEnever evaluated
FALSEevaluated 1491 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1491
132 goto
never executed: goto err;
err;
never executed: goto err;
0
133 if (BIO_write(bp, " Not Before: ", 24) <= 0
BIO_write(bp, ...e: ", 24) <= 0Description
TRUEnever evaluated
FALSEevaluated 1491 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1491
134 goto
never executed: goto err;
err;
never executed: goto err;
0
135 if (!ASN1_TIME_print(bp, X509_get0_notBefore(x))
!ASN1_TIME_pri..._notBefore(x))Description
TRUEevaluated 140 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1351 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
140-1351
136 goto
executed 140 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 140 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
140
137 if (BIO_write(bp, "\n Not After : ", 25) <= 0
BIO_write(bp, ... : ", 25) <= 0Description
TRUEnever evaluated
FALSEevaluated 1351 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1351
138 goto
never executed: goto err;
err;
never executed: goto err;
0
139 if (!ASN1_TIME_print(bp, X509_get0_notAfter(x))
!ASN1_TIME_pri...0_notAfter(x))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
5-1346
140 goto
executed 5 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 5 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
5
141 if (BIO_write(bp, "\n", 1) <= 0
BIO_write(bp, "\n", 1) <= 0Description
TRUEnever evaluated
FALSEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1346
142 goto
never executed: goto err;
err;
never executed: goto err;
0
143 }
executed 1346 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1346
144 if (!(cflag & (1L << 6))
!(cflag & (1L << 6))Description
TRUEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1346
145 if (BIO_printf(bp, " Subject:%c", mlch) <= 0
BIO_printf(bp,...c", mlch) <= 0Description
TRUEnever evaluated
FALSEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1346
146 goto
never executed: goto err;
err;
never executed: goto err;
0
147 if (X509_NAME_print_ex
X509_NAME_prin..., nmflags) < 0Description
TRUEnever evaluated
FALSEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1346
148 (bp, X509_get_subject_name(x), nmindent, nmflags) < 0
X509_NAME_prin..., nmflags) < 0Description
TRUEnever evaluated
FALSEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1346
149 goto
never executed: goto err;
err;
never executed: goto err;
0
150 if (BIO_write(bp, "\n", 1) <= 0
BIO_write(bp, "\n", 1) <= 0Description
TRUEnever evaluated
FALSEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1346
151 goto
never executed: goto err;
err;
never executed: goto err;
0
152 }
executed 1346 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1346
153 if (!(cflag & (1L << 7))
!(cflag & (1L << 7))Description
TRUEevaluated 1344 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
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
BIO_write(bp, ...:\n", 33) <= 0Description
TRUEnever evaluated
FALSEevaluated 1344 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1344
164 goto
never executed: goto err;
err;
never executed: goto err;
0
165 if (BIO_printf(bp, "%12sPublic Key Algorithm: ", "") <= 0
BIO_printf(bp,...m: ", "") <= 0Description
TRUEnever evaluated
FALSEevaluated 1344 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1344
166 goto
never executed: goto err;
err;
never executed: goto err;
0
167 if (i2a_ASN1_OBJECT(bp, xpoid) <= 0
i2a_ASN1_OBJEC...p, xpoid) <= 0Description
TRUEnever evaluated
FALSEevaluated 1344 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1344
168 goto
never executed: goto err;
err;
never executed: goto err;
0
169 if (BIO_puts(bp, "\n") <= 0
BIO_puts(bp, "\n") <= 0Description
TRUEnever evaluated
FALSEevaluated 1344 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1344
170 goto
never executed: goto err;
err;
never executed: goto err;
0
171-
172 pkey = X509_get0_pubkey(x);-
173 if (pkey ==
pkey == ((void *)0)Description
TRUEevaluated 1103 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 241 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
241-1103
174 ((void *)0)
pkey == ((void *)0)Description
TRUEevaluated 1103 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 241 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
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: end of block
Executed by:
  • libcrypto.so.1.1
else {
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:
  • libcrypto.so.1.1
241
183 }-
184-
185 if (!(cflag & (1L << 12))
!(cflag & (1L << 12))Description
TRUEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1346
186 const ASN1_BIT_STRING *iuid, *suid;-
187 X509_get0_uids(x, &iuid, &suid);-
188 if (iuid !=
iuid != ((void *)0)Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1328 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
18-1328
189 ((void *)0)
iuid != ((void *)0)Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1328 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
18-1328
190 ) {-
191 if (BIO_printf(bp, "%8sIssuer Unique ID: ", "") <= 0
BIO_printf(bp,...D: ", "") <= 0Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-18
192 goto
never executed: goto err;
err;
never executed: goto err;
0
193 if (!X509_signature_dump(bp, iuid, 12)
!X509_signatur...(bp, iuid, 12)Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-18
194 goto
never executed: goto err;
err;
never executed: goto err;
0
195 }
executed 18 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
18
196 if (suid !=
suid != ((void *)0)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1330 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
16-1330
197 ((void *)0)
suid != ((void *)0)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1330 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
16-1330
198 ) {-
199 if (BIO_printf(bp, "%8sSubject Unique ID: ", "") <= 0
BIO_printf(bp,...D: ", "") <= 0Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-16
200 goto
never executed: goto err;
err;
never executed: goto err;
0
201 if (!X509_signature_dump(bp, suid, 12)
!X509_signatur...(bp, suid, 12)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-16
202 goto
never executed: goto err;
err;
never executed: goto err;
0
203 }
executed 16 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
16
204 }
executed 1346 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1346
205-
206 if (!(cflag & (1L << 8))
!(cflag & (1L << 8))Description
TRUEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
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:
  • libcrypto.so.1.1
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:
  • libcrypto.so.1.1
1346
209-
210 if (!(cflag & (1L << 9))
!(cflag & (1L << 9))Description
TRUEevaluated 1344 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
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
X509_signature...alg, sig) <= 0Description
TRUEnever evaluated
FALSEevaluated 1344 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1344
215 goto
never executed: goto err;
err;
never executed: goto err;
0
216 }
executed 1344 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1344
217 if (!(cflag & (1L << 10))
!(cflag & (1L << 10))Description
TRUEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1346
218 if (!X509_aux_print(bp, x, 0)
!X509_aux_print(bp, x, 0)Description
TRUEnever evaluated
FALSEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1346
219 goto
never executed: goto err;
err;
never executed: goto err;
0
220 }
executed 1346 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1346
221 ret = 1;-
222 err:
code before this statement executed 1346 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
1346
223 CRYPTO_free(m, __FILE__, 217);-
224 return
executed 1491 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 1491 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
1491
225}-
226-
227int 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
BIO_printf(bp,... hash: ") <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
243 goto
never executed: goto err;
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 ((
(der = dertmp ...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
der = dertmp = CRYPTO_malloc(derlen, __FILE__, 238)) ==
(der = dertmp ...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
249 ((void *)0)
(der = dertmp ...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
250 )-
251 goto
never executed: goto err;
err;
never executed: goto err;
0
252 i2d_X509_NAME(subj, &dertmp);-
253-
254 if (!EVP_Digest(der, derlen, SHA1md,
!EVP_Digest(de... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
255 ((void *)0)
!EVP_Digest(de... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
256 , EVP_sha1(),
!EVP_Digest(de... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
257 ((void *)0)
!EVP_Digest(de... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
258 )
!EVP_Digest(de... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
)
0
259 goto
never executed: goto err;
err;
never executed: goto err;
0
260 for (i = 0; i < 20
i < 20Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
261 if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0
BIO_printf(bp,...HA1md[i]) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
262 goto
never executed: goto err;
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
BIO_printf(bp,... hash: ") <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
273 goto
never executed: goto err;
err;
never executed: goto err;
0
274-
275 keybstr = X509_get0_pubkey_bitstr(x);-
276-
277 if (keybstr ==
keybstr == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
278 ((void *)0)
keybstr == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
279 )-
280 goto
never executed: goto err;
err;
never executed: goto err;
0
281-
282 if (!EVP_Digest(ASN1_STRING_get0_data(keybstr),
!EVP_Digest(AS... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
283 ASN1_STRING_length(keybstr), SHA1md,
!EVP_Digest(AS... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
284 ((void *)0)
!EVP_Digest(AS... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
285 , EVP_sha1(),
!EVP_Digest(AS... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
286
!EVP_Digest(AS... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
287 ((void *)0)
!EVP_Digest(AS... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
288 )
!EVP_Digest(AS... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
)
0
289 goto
never executed: goto err;
err;
never executed: goto err;
0
290 for (i = 0; i < 20
i < 20Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
291 if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0
BIO_printf(bp,...HA1md[i]) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
292 goto
never executed: goto err;
err;
never executed: goto err;
0
293 }
never executed: end of block
0
294 BIO_printf(bp, "\n");-
295-
296 return
never executed: return 1;
1;
never executed: return 1;
0
297 err:-
298 CRYPTO_free(der, __FILE__, 274);-
299 return
never executed: return 0;
0;
never executed: return 0;
0
300}-
301-
302int 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
i < nDescription
TRUEevaluated 122440 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3201 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
3201-122440
310 if ((
(i % 18) == 0Description
TRUEevaluated 7556 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 114884 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i % 18) == 0
(i % 18) == 0Description
TRUEevaluated 7556 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 114884 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
7556-114884
311 if (BIO_write(bp, "\n", 1) <= 0
BIO_write(bp, "\n", 1) <= 0Description
TRUEnever evaluated
FALSEevaluated 7556 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-7556
312 return
never executed: return 0;
0;
never executed: return 0;
0
313 if (BIO_indent(bp, indent, indent) <= 0
BIO_indent(bp,..., indent) <= 0Description
TRUEnever evaluated
FALSEevaluated 7556 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-7556
314 return
never executed: return 0;
0;
never executed: return 0;
0
315 }
executed 7556 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7556
316 if (BIO_printf(bp, "%02x%s", s[i], ((i + 1) == n) ? "" : ":") <= 0
BIO_printf(bp,..."" : ":") <= 0Description
TRUEnever evaluated
FALSEevaluated 122440 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-122440
317 return
never executed: return 0;
0;
never executed: return 0;
0
318 }
executed 122440 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
122440
319 if (BIO_write(bp, "\n", 1) != 1
BIO_write(bp, "\n", 1) != 1Description
TRUEnever evaluated
FALSEevaluated 3201 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3201
320 return
never executed: return 0;
0;
never executed: return 0;
0
321-
322 return
executed 3201 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 3201 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
3201
323}-
324-
325int 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
BIO_puts(bp, "...rithm: ") <= 0Description
TRUEnever evaluated
FALSEevaluated 6516 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6516
330 return
never executed: return 0;
0;
never executed: return 0;
0
331 if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0
i2a_ASN1_OBJEC...lgorithm) <= 0Description
TRUEnever evaluated
FALSEevaluated 6516 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6516
332 return
never executed: return 0;
0;
never executed: return 0;
0
333-
334 sig_nid = OBJ_obj2nid(sigalg->algorithm);-
335 if (sig_nid != 0
sig_nid != 0Description
TRUEevaluated 1674 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4842 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
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)
OBJ_find_sigid...id, &pkey_nid)Description
TRUEevaluated 1050 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 624 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
624-1050
339 ameth = EVP_PKEY_asn1_find(-
340 ((void *)0)-
341 , pkey_nid);-
342 if (ameth
amethDescription
TRUEevaluated 1040 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& ameth->sig_print
ameth->sig_printDescription
TRUEevaluated 968 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 72 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
10-1040
343 return
executed 968 times by 1 test: return ameth->sig_print(bp, sigalg, sig, 9, 0);
Executed by:
  • libcrypto.so.1.1
ameth->sig_print(bp, sigalg, sig, 9, 0);
executed 968 times by 1 test: return ameth->sig_print(bp, sigalg, sig, 9, 0);
Executed by:
  • libcrypto.so.1.1
968
344 }
executed 82 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
82
345 }
executed 706 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
706
346 if (sig
sigDescription
TRUEevaluated 2688 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2860 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2688-2860
347 return
executed 2688 times by 1 test: return X509_signature_dump(bp, sig, 9);
Executed by:
  • libcrypto.so.1.1
X509_signature_dump(bp, sig, 9);
executed 2688 times by 1 test: return X509_signature_dump(bp, sig, 9);
Executed by:
  • libcrypto.so.1.1
2688
348 else if (BIO_puts(bp, "\n") <= 0
BIO_puts(bp, "\n") <= 0Description
TRUEnever evaluated
FALSEevaluated 2860 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2860
349 return
never executed: return 0;
0;
never executed: return 0;
0
350 return
executed 2860 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2860 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2860
351}-
352-
353int 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
X509_trusted(x) == 0Description
TRUEevaluated 1346 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-1346
361 return
executed 1346 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1346 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1346
362 trust = X509_get0_trust_objects(x);-
363 reject = X509_get0_reject_objects(x);-
364 if (trust
trustDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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)
i < sk_ASN1_OBJECT_num(trust)Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
368 if (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
)
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: end of block
else
0
378 BIO_printf(out, "%*sNo Trusted Uses.\n", indent, "");
never executed: BIO_printf(out, "%*sNo Trusted Uses.\n", indent, "");
0
379 if (reject
rejectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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)
i < sk_ASN1_OBJECT_num(reject)Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
383 if (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
)
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: end of block
else
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
aliasDescription
TRUEnever evaluated
FALSEnever evaluated
)
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
keyidDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
401 BIO_printf(out, "%*sKey Id: ", indent, "");-
402 for (i = 0; i < keyidlen
i < keyidlenDescription
TRUEnever evaluated
FALSEnever evaluated
; i++)
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: return 1;
1;
never executed: return 1;
0
407}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2