OpenCoverage

v3_prn.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509v3/v3_prn.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4static int unknown_ext_print(BIO *out, const unsigned char *ext, int extlen,-
5 unsigned long flag, int indent, int supported);-
6-
7-
8-
9void X509V3_EXT_val_prn(BIO *out, struct stack_st_CONF_VALUE *val, int indent,-
10 int ml)-
11{-
12 int i;-
13 CONF_VALUE *nval;-
14 if (!val
!valDescription
TRUEnever evaluated
FALSEevaluated 8662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-8662
15 return;
never executed: return;
0
16 if (!ml
!mlDescription
TRUEevaluated 6261 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2401 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !sk_CONF_VALUE_num(val)
!sk_CONF_VALUE_num(val)Description
TRUEevaluated 562 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1839 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
562-6261
17 BIO_printf(out, "%*s", indent, "");-
18 if (!sk_CONF_VALUE_num(val)
!sk_CONF_VALUE_num(val)Description
TRUEevaluated 624 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6199 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
624-6199
19 BIO_puts(out, "<EMPTY>\n");
executed 624 times by 1 test: BIO_puts(out, "<EMPTY>\n");
Executed by:
  • libcrypto.so.1.1
624
20 }
executed 6823 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6823
21 for (i = 0; i < sk_CONF_VALUE_num(val)
i < sk_CONF_VALUE_num(val)Description
TRUEevaluated 16157 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
8662-16157
22 if (ml
mlDescription
TRUEevaluated 2441 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13716 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2441-13716
23 BIO_printf(out, "%*s", indent, "");
executed 2441 times by 1 test: BIO_printf(out, "%*s", indent, "");
Executed by:
  • libcrypto.so.1.1
2441
24 else if (i > 0
i > 0Description
TRUEevaluated 7517 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6199 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
6199-7517
25 BIO_printf(out, ", ");
executed 7517 times by 1 test: BIO_printf(out, ", ");
Executed by:
  • libcrypto.so.1.1
7517
26 nval = sk_CONF_VALUE_value(val, i);-
27 if (!nval->name
!nval->nameDescription
TRUEevaluated 2367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13790 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2367-13790
28 BIO_puts(out, nval->value);
executed 2367 times by 1 test: BIO_puts(out, nval->value);
Executed by:
  • libcrypto.so.1.1
2367
29 else if (!nval->value
!nval->valueDescription
TRUEevaluated 3247 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10543 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3247-10543
30 BIO_puts(out, nval->name);
executed 3247 times by 1 test: BIO_puts(out, nval->name);
Executed by:
  • libcrypto.so.1.1
3247
31-
32 else-
33 BIO_printf(out, "%s:%s", nval->name, nval->value);
executed 10543 times by 1 test: BIO_printf(out, "%s:%s", nval->name, nval->value);
Executed by:
  • libcrypto.so.1.1
10543
34 if (ml
mlDescription
TRUEevaluated 2441 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13716 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2441-13716
35 BIO_puts(out, "\n");
executed 2441 times by 1 test: BIO_puts(out, "\n");
Executed by:
  • libcrypto.so.1.1
2441
36 }
executed 16157 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
16157
37}
executed 8662 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8662
38-
39-
40-
41int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag,-
42 int indent)-
43{-
44 void *ext_str = -
45 ((void *)0)-
46 ;-
47 char *value = -
48 ((void *)0)-
49 ;-
50 ASN1_OCTET_STRING *extoct;-
51 const unsigned char *p;-
52 int extlen;-
53 const X509V3_EXT_METHOD *method;-
54 struct stack_st_CONF_VALUE *nval = -
55 ((void *)0)-
56 ;-
57 int ok = 1;-
58-
59 extoct = X509_EXTENSION_get_data(ext);-
60 p = ASN1_STRING_get0_data(extoct);-
61 extlen = ASN1_STRING_length(extoct);-
62-
63 if ((
(method = X509...== ((void *)0)Description
TRUEevaluated 13699 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 85245 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
method = X509V3_EXT_get(ext)) ==
(method = X509...== ((void *)0)Description
TRUEevaluated 13699 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 85245 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
13699-85245
64 ((void *)0)
(method = X509...== ((void *)0)Description
TRUEevaluated 13699 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 85245 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
13699-85245
65 )-
66 return
executed 13699 times by 1 test: return unknown_ext_print(out, p, extlen, flag, indent, 0);
Executed by:
  • libcrypto.so.1.1
unknown_ext_print(out, p, extlen, flag, indent, 0);
executed 13699 times by 1 test: return unknown_ext_print(out, p, extlen, flag, indent, 0);
Executed by:
  • libcrypto.so.1.1
13699
67 if (method->it
method->itDescription
TRUEevaluated 78012 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7233 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
7233-78012
68 ext_str = ASN1_item_d2i(
executed 78012 times by 1 test: ext_str = ASN1_item_d2i( ((void *)0) , &p, extlen, (method->it));
Executed by:
  • libcrypto.so.1.1
78012
69 ((void *)0)
executed 78012 times by 1 test: ext_str = ASN1_item_d2i( ((void *)0) , &p, extlen, (method->it));
Executed by:
  • libcrypto.so.1.1
78012
70 , &p, extlen, (method->it));
executed 78012 times by 1 test: ext_str = ASN1_item_d2i( ((void *)0) , &p, extlen, (method->it));
Executed by:
  • libcrypto.so.1.1
78012
71 else-
72 ext_str = method->d2i(
executed 7233 times by 1 test: ext_str = method->d2i( ((void *)0) , &p, extlen);
Executed by:
  • libcrypto.so.1.1
7233
73 ((void *)0)
executed 7233 times by 1 test: ext_str = method->d2i( ((void *)0) , &p, extlen);
Executed by:
  • libcrypto.so.1.1
7233
74 , &p, extlen);
executed 7233 times by 1 test: ext_str = method->d2i( ((void *)0) , &p, extlen);
Executed by:
  • libcrypto.so.1.1
7233
75-
76 if (!ext_str
!ext_strDescription
TRUEevaluated 38372 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46873 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
38372-46873
77 return
executed 38372 times by 1 test: return unknown_ext_print(out, p, extlen, flag, indent, 1);
Executed by:
  • libcrypto.so.1.1
unknown_ext_print(out, p, extlen, flag, indent, 1);
executed 38372 times by 1 test: return unknown_ext_print(out, p, extlen, flag, indent, 1);
Executed by:
  • libcrypto.so.1.1
38372
78-
79 if (method->i2s
method->i2sDescription
TRUEevaluated 4536 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 42337 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4536-42337
80 if ((
(value = metho...== ((void *)0)Description
TRUEevaluated 388 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4148 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
value = method->i2s(method, ext_str)) ==
(value = metho...== ((void *)0)Description
TRUEevaluated 388 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4148 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
388-4148
81 ((void *)0)
(value = metho...== ((void *)0)Description
TRUEevaluated 388 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4148 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
388-4148
82 ) {-
83 ok = 0;-
84 goto
executed 388 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 388 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
388
85 }-
86-
87 BIO_printf(out, "%*s%s", indent, "", value);-
88 }
executed 4148 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (method->i2v
method->i2vDescription
TRUEevaluated 10715 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 31622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4148-31622
89 if ((
(nval = method...== ((void *)0)Description
TRUEevaluated 2053 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
nval = method->i2v(method, ext_str,
(nval = method...== ((void *)0)Description
TRUEevaluated 2053 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2053-8662
90 ((void *)0)
(nval = method...== ((void *)0)Description
TRUEevaluated 2053 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2053-8662
91 )) ==
(nval = method...== ((void *)0)Description
TRUEevaluated 2053 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2053-8662
92 ((void *)0)
(nval = method...== ((void *)0)Description
TRUEevaluated 2053 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2053-8662
93 ) {-
94 ok = 0;-
95 goto
executed 2053 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 2053 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
2053
96 }-
97 X509V3_EXT_val_prn(out, nval, indent,-
98 method->ext_flags & 0x4);-
99 }
executed 8662 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (method->i2r
method->i2rDescription
TRUEevaluated 31622 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-31622
100 if (!method->i2r(method, ext_str, out, indent)
!method->i2r(m..., out, indent)Description
TRUEevaluated 5762 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 25860 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
5762-25860
101 ok = 0;
executed 5762 times by 1 test: ok = 0;
Executed by:
  • libcrypto.so.1.1
5762
102 }
executed 31622 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
31622
103 ok = 0;
never executed: ok = 0;
0
104-
105 err:
code before this statement executed 44432 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
44432
106 sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);-
107 CRYPTO_free(value, __FILE__, 130);-
108 if (method->it
method->itDescription
TRUEevaluated 43268 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3605 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3605-43268
109 ASN1_item_free(ext_str, (method->it));
executed 43268 times by 1 test: ASN1_item_free(ext_str, (method->it));
Executed by:
  • libcrypto.so.1.1
43268
110 else-
111 method->ext_free(ext_str);
executed 3605 times by 1 test: method->ext_free(ext_str);
Executed by:
  • libcrypto.so.1.1
3605
112 return
executed 46873 times by 1 test: return ok;
Executed by:
  • libcrypto.so.1.1
ok;
executed 46873 times by 1 test: return ok;
Executed by:
  • libcrypto.so.1.1
46873
113}-
114-
115int X509V3_extensions_print(BIO *bp, const char *title,-
116 const struct stack_st_X509_EXTENSION *exts,-
117 unsigned long flag, int indent)-
118{-
119 int i, j;-
120-
121 if (sk_X509_EXTENSION_num(exts) <= 0
sk_X509_EXTENS...num(exts) <= 0Description
TRUEevaluated 7323 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4338 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4338-7323
122 return
executed 7323 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 7323 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
7323
123-
124 if (title
titleDescription
TRUEevaluated 4338 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-4338
125 BIO_printf(bp, "%*s%s:\n", indent, "", title);-
126 indent += 4;-
127 }
executed 4338 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4338
128-
129 for (i = 0; i < sk_X509_EXTENSION_num(exts)
i < sk_X509_EX...SION_num(exts)Description
TRUEevaluated 82948 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4338 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
4338-82948
130 ASN1_OBJECT *obj;-
131 X509_EXTENSION *ex;-
132 ex = sk_X509_EXTENSION_value(exts, i);-
133 if (indent
indentDescription
TRUEevaluated 82948 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& BIO_printf(bp, "%*s", indent, "") <= 0
BIO_printf(bp,...dent, "") <= 0Description
TRUEnever evaluated
FALSEevaluated 82948 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-82948
134 return
never executed: return 0;
0;
never executed: return 0;
0
135 obj = X509_EXTENSION_get_object(ex);-
136 i2a_ASN1_OBJECT(bp, obj);-
137 j = X509_EXTENSION_get_critical(ex);-
138 if (BIO_printf(bp, ": %s\n", j ? "critical" : "") <= 0
BIO_printf(bp,...al" : "") <= 0Description
TRUEnever evaluated
FALSEevaluated 82948 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-82948
139 return
never executed: return 0;
0;
never executed: return 0;
0
140 if (!X509V3_EXT_print(bp, ex, flag, indent + 4)
!X509V3_EXT_pr...g, indent + 4)Description
TRUEevaluated 54573 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 28375 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
28375-54573
141 BIO_printf(bp, "%*s", indent + 4, "");-
142 ASN1_STRING_print(bp, X509_EXTENSION_get_data(ex));-
143 }
executed 54573 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
54573
144 if (BIO_write(bp, "\n", 1) <= 0
BIO_write(bp, "\n", 1) <= 0Description
TRUEnever evaluated
FALSEevaluated 82948 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-82948
145 return
never executed: return 0;
0;
never executed: return 0;
0
146 }
executed 82948 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
82948
147 return
executed 4338 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 4338 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
4338
148}-
149-
150static int unknown_ext_print(BIO *out, const unsigned char *ext, int extlen,-
151 unsigned long flag, int indent, int supported)-
152{-
153 switch (flag & (0xfL << 16)) {-
154-
155 case
executed 52071 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
0:
executed 52071 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
52071
156 return
executed 52071 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 52071 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
52071
157-
158 case
never executed: case (1L << 16):
(1L << 16):
never executed: case (1L << 16):
0
159 if (supported
supportedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
160 BIO_printf(out, "%*s<Parse Error>", indent, "");
never executed: BIO_printf(out, "%*s<Parse Error>", indent, "");
0
161 else-
162 BIO_printf(out, "%*s<Not Supported>", indent, "");
never executed: BIO_printf(out, "%*s<Not Supported>", indent, "");
0
163 return
never executed: return 1;
1;
never executed: return 1;
0
164-
165 case
never executed: case (2L << 16):
(2L << 16):
never executed: case (2L << 16):
0
166 return
never executed: return ASN1_parse_dump(out, ext, extlen, indent, -1);
ASN1_parse_dump(out, ext, extlen, indent, -1);
never executed: return ASN1_parse_dump(out, ext, extlen, indent, -1);
0
167 case
never executed: case (3L << 16):
(3L << 16):
never executed: case (3L << 16):
0
168 return
never executed: return BIO_dump_indent(out, (const char *)ext, extlen, indent);
BIO_dump_indent(out, (const char *)ext, extlen, indent);
never executed: return BIO_dump_indent(out, (const char *)ext, extlen, indent);
0
169-
170 default
never executed: default:
:
never executed: default:
0
171 return
never executed: return 1;
1;
never executed: return 1;
0
172 }-
173}-
174-
175-
176int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent)-
177{-
178 BIO *bio_tmp;-
179 int ret;-
180-
181 if ((
(bio_tmp = BIO...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
bio_tmp = BIO_new_fp(fp, 0x00)) ==
(bio_tmp = BIO...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
182 ((void *)0)
(bio_tmp = BIO...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
183 )-
184 return
never executed: return 0;
0;
never executed: return 0;
0
185 ret = X509V3_EXT_print(bio_tmp, ext, flag, indent);-
186 BIO_free(bio_tmp);-
187 return
never executed: return ret;
ret;
never executed: return ret;
0
188}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2