OpenCoverage

ts_rsp_print.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ts/ts_rsp_print.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3struct status_map_st {-
4 int bit;-
5 const char *text;-
6};-
7-
8static int ts_status_map_print(BIO *bio, const struct status_map_st *a,-
9 const ASN1_BIT_STRING *v);-
10static int ts_ACCURACY_print_bio(BIO *bio, const TS_ACCURACY *accuracy);-
11-
12-
13int TS_RESP_print_bio(BIO *bio, TS_RESP *a)-
14{-
15 BIO_printf(bio, "Status info:\n");-
16 TS_STATUS_INFO_print_bio(bio, a->status_info);-
17-
18 BIO_printf(bio, "\nTST info:\n");-
19 if (a->tst_info !=
a->tst_info != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3
20 ((void *)0)
a->tst_info != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3
21 )-
22 TS_TST_INFO_print_bio(bio, a->tst_info);
never executed: TS_TST_INFO_print_bio(bio, a->tst_info);
0
23 else-
24 BIO_printf(bio, "Not included.\n");
executed 3 times by 1 test: BIO_printf(bio, "Not included.\n");
Executed by:
  • libcrypto.so.1.1
3
25-
26 return
executed 3 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 3 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
3
27}-
28-
29int TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a)-
30{-
31 static const char *status_map[] = {-
32 "Granted.",-
33 "Granted with modifications.",-
34 "Rejected.",-
35 "Waiting.",-
36 "Revocation warning.",-
37 "Revoked."-
38 };-
39 static const struct status_map_st failure_map[] = {-
40 {0,-
41 "unrecognized or unsupported algorithm identifier"},-
42 {2,-
43 "transaction not permitted or supported"},-
44 {5,-
45 "the data submitted has the wrong format"},-
46 {14,-
47 "the TSA's time source is not available"},-
48 {15,-
49 "the requested TSA policy is not supported by the TSA"},-
50 {16,-
51 "the requested extension is not supported by the TSA"},-
52 {17,-
53 "the additional information requested could not be understood "-
54 "or is not available"},-
55 {25,-
56 "the request cannot be handled due to system failure"},-
57 {-1, -
58 ((void *)0)-
59 }-
60 };-
61 long status;-
62 int i, lines = 0;-
63-
64 BIO_printf(bio, "Status: ");-
65 status = ASN1_INTEGER_get(a->status);-
66 if (0 <= status
0 <= statusDescription
TRUEevaluated 136 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 35 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& status < (long)(sizeof(status_map)/sizeof((status_map)[0]))
status < (long...atus_map)[0]))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 131 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
5-136
67 BIO_printf(bio, "%s\n", status_map[status]);
executed 5 times by 1 test: BIO_printf(bio, "%s\n", status_map[status]);
Executed by:
  • libcrypto.so.1.1
5
68 else-
69 BIO_printf(bio, "out of bounds\n");
executed 166 times by 1 test: BIO_printf(bio, "out of bounds\n");
Executed by:
  • libcrypto.so.1.1
166
70-
71 BIO_printf(bio, "Status description: ");-
72 for (i = 0; i < sk_ASN1_UTF8STRING_num(a->text)
i < sk_ASN1_UT...G_num(a->text)Description
TRUEevaluated 6183 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 171 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; ++i) {
171-6183
73 if (i > 0
i > 0Description
TRUEevaluated 6031 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 152 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
152-6031
74 BIO_puts(bio, "\t");
executed 6031 times by 1 test: BIO_puts(bio, "\t");
Executed by:
  • libcrypto.so.1.1
6031
75 ASN1_STRING_print_ex(bio, sk_ASN1_UTF8STRING_value(a->text, i), 0);-
76 BIO_puts(bio, "\n");-
77 }
executed 6183 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6183
78 if (i == 0
i == 0Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 152 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
19-152
79 BIO_printf(bio, "unspecified\n");
executed 19 times by 1 test: BIO_printf(bio, "unspecified\n");
Executed by:
  • libcrypto.so.1.1
19
80-
81 BIO_printf(bio, "Failure info: ");-
82 if (a->failure_info !=
a->failure_info != ((void *)0)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 159 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
12-159
83 ((void *)0)
a->failure_info != ((void *)0)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 159 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
12-159
84 )-
85 lines = ts_status_map_print(bio, failure_map, a->failure_info);
executed 12 times by 1 test: lines = ts_status_map_print(bio, failure_map, a->failure_info);
Executed by:
  • libcrypto.so.1.1
12
86 if (lines == 0
lines == 0Description
TRUEevaluated 160 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
11-160
87 BIO_printf(bio, "unspecified");
executed 160 times by 1 test: BIO_printf(bio, "unspecified");
Executed by:
  • libcrypto.so.1.1
160
88 BIO_printf(bio, "\n");-
89-
90 return
executed 171 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 171 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
171
91}-
92-
93static int ts_status_map_print(BIO *bio, const struct status_map_st *a,-
94 const ASN1_BIT_STRING *v)-
95{-
96 int lines = 0;-
97-
98 for (; a->bit >= 0
a->bit >= 0Description
TRUEevaluated 96 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; ++a) {
12-96
99 if (ASN1_BIT_STRING_get_bit(v, a->bit)
ASN1_BIT_STRIN...bit(v, a->bit)Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 62 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
34-62
100 if (++
++lines > 1Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
lines > 1
++lines > 1Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
11-23
101 BIO_printf(bio, ", ");
executed 23 times by 1 test: BIO_printf(bio, ", ");
Executed by:
  • libcrypto.so.1.1
23
102 BIO_printf(bio, "%s", a->text);-
103 }
executed 34 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
34
104 }
executed 96 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
96
105-
106 return
executed 12 times by 1 test: return lines;
Executed by:
  • libcrypto.so.1.1
lines;
executed 12 times by 1 test: return lines;
Executed by:
  • libcrypto.so.1.1
12
107}-
108-
109int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a)-
110{-
111 int v;-
112-
113 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
114 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
115 )-
116 return
never executed: return 0;
0;
never executed: return 0;
0
117-
118 v = ASN1_INTEGER_get(a->version);-
119 BIO_printf(bio, "Version: %d\n", v);-
120-
121 BIO_printf(bio, "Policy OID: ");-
122 TS_OBJ_print_bio(bio, a->policy_id);-
123-
124 TS_MSG_IMPRINT_print_bio(bio, a->msg_imprint);-
125-
126 BIO_printf(bio, "Serial number: ");-
127 if (a->serial ==
a->serial == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
128 ((void *)0)
a->serial == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
129 )-
130 BIO_printf(bio, "unspecified");
never executed: BIO_printf(bio, "unspecified");
0
131 else-
132 TS_ASN1_INTEGER_print_bio(bio, a->serial);
never executed: TS_ASN1_INTEGER_print_bio(bio, a->serial);
0
133 BIO_write(bio, "\n", 1);-
134-
135 BIO_printf(bio, "Time stamp: ");-
136 ASN1_GENERALIZEDTIME_print(bio, a->time);-
137 BIO_write(bio, "\n", 1);-
138-
139 BIO_printf(bio, "Accuracy: ");-
140 if (a->accuracy ==
a->accuracy == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
141 ((void *)0)
a->accuracy == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
142 )-
143 BIO_printf(bio, "unspecified");
never executed: BIO_printf(bio, "unspecified");
0
144 else-
145 ts_ACCURACY_print_bio(bio, a->accuracy);
never executed: ts_ACCURACY_print_bio(bio, a->accuracy);
0
146 BIO_write(bio, "\n", 1);-
147-
148 BIO_printf(bio, "Ordering: %s\n", a->ordering ? "yes" : "no");-
149-
150 BIO_printf(bio, "Nonce: ");-
151 if (a->nonce ==
a->nonce == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
152 ((void *)0)
a->nonce == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
153 )-
154 BIO_printf(bio, "unspecified");
never executed: BIO_printf(bio, "unspecified");
0
155 else-
156 TS_ASN1_INTEGER_print_bio(bio, a->nonce);
never executed: TS_ASN1_INTEGER_print_bio(bio, a->nonce);
0
157 BIO_write(bio, "\n", 1);-
158-
159 BIO_printf(bio, "TSA: ");-
160 if (a->tsa ==
a->tsa == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
161 ((void *)0)
a->tsa == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
162 )-
163 BIO_printf(bio, "unspecified");
never executed: BIO_printf(bio, "unspecified");
0
164 else {-
165 struct stack_st_CONF_VALUE *nval;-
166 if ((
(nval = i2v_GE...((void *)0) ))Description
TRUEnever evaluated
FALSEnever evaluated
nval = i2v_GENERAL_NAME(
(nval = i2v_GE...((void *)0) ))Description
TRUEnever evaluated
FALSEnever evaluated
0
167 ((void *)0)
(nval = i2v_GE...((void *)0) ))Description
TRUEnever evaluated
FALSEnever evaluated
0
168 , a->tsa,
(nval = i2v_GE...((void *)0) ))Description
TRUEnever evaluated
FALSEnever evaluated
0
169 ((void *)0)
(nval = i2v_GE...((void *)0) ))Description
TRUEnever evaluated
FALSEnever evaluated
0
170 ))
(nval = i2v_GE...((void *)0) ))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
171 X509V3_EXT_val_prn(bio, nval, 0, 0);
never executed: X509V3_EXT_val_prn(bio, nval, 0, 0);
0
172 sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);-
173 }
never executed: end of block
0
174 BIO_write(bio, "\n", 1);-
175-
176 TS_ext_print_bio(bio, a->extensions);-
177-
178 return
never executed: return 1;
1;
never executed: return 1;
0
179}-
180-
181static int ts_ACCURACY_print_bio(BIO *bio, const TS_ACCURACY *a)-
182{-
183 if (a->seconds !=
a->seconds != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
184 ((void *)0)
a->seconds != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
185 )-
186 TS_ASN1_INTEGER_print_bio(bio, a->seconds);
never executed: TS_ASN1_INTEGER_print_bio(bio, a->seconds);
0
187 else-
188 BIO_printf(bio, "unspecified");
never executed: BIO_printf(bio, "unspecified");
0
189 BIO_printf(bio, " seconds, ");-
190 if (a->millis !=
a->millis != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
191 ((void *)0)
a->millis != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
192 )-
193 TS_ASN1_INTEGER_print_bio(bio, a->millis);
never executed: TS_ASN1_INTEGER_print_bio(bio, a->millis);
0
194 else-
195 BIO_printf(bio, "unspecified");
never executed: BIO_printf(bio, "unspecified");
0
196 BIO_printf(bio, " millis, ");-
197 if (a->micros !=
a->micros != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
198 ((void *)0)
a->micros != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
199 )-
200 TS_ASN1_INTEGER_print_bio(bio, a->micros);
never executed: TS_ASN1_INTEGER_print_bio(bio, a->micros);
0
201 else-
202 BIO_printf(bio, "unspecified");
never executed: BIO_printf(bio, "unspecified");
0
203 BIO_printf(bio, " micros");-
204-
205 return
never executed: return 1;
1;
never executed: return 1;
0
206}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2