OpenCoverage

v3_ocsp.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ocsp/v3_ocsp.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7static int i2r_ocsp_crlid(const X509V3_EXT_METHOD *method, void *nonce,-
8 BIO *out, int indent);-
9static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *nonce,-
10 BIO *out, int indent);-
11static int i2r_object(const X509V3_EXT_METHOD *method, void *obj, BIO *out,-
12 int indent);-
13-
14static void *ocsp_nonce_new(void);-
15static int i2d_ocsp_nonce(void *a, unsigned char **pp);-
16static void *d2i_ocsp_nonce(void *a, const unsigned char **pp, long length);-
17static void ocsp_nonce_free(void *a);-
18static int i2r_ocsp_nonce(const X509V3_EXT_METHOD *method, void *nonce,-
19 BIO *out, int indent);-
20-
21static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method,-
22 void *nocheck, BIO *out, int indent);-
23static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method,-
24 X509V3_CTX *ctx, const char *str);-
25static int i2r_ocsp_serviceloc(const X509V3_EXT_METHOD *method, void *in,-
26 BIO *bp, int ind);-
27-
28const X509V3_EXT_METHOD v3_ocsp_crlid = {-
29 367, 0, (&(OCSP_CRLID_it)),-
30 0, 0, 0, 0,-
31 0, 0,-
32 0, 0,-
33 i2r_ocsp_crlid, 0,-
34 -
35 ((void *)0)-
36-
37};-
38-
39const X509V3_EXT_METHOD v3_ocsp_acutoff = {-
40 370, 0, (&(ASN1_GENERALIZEDTIME_it)),-
41 0, 0, 0, 0,-
42 0, 0,-
43 0, 0,-
44 i2r_ocsp_acutoff, 0,-
45 -
46 ((void *)0)-
47-
48};-
49-
50const X509V3_EXT_METHOD v3_crl_invdate = {-
51 142, 0, (&(ASN1_GENERALIZEDTIME_it)),-
52 0, 0, 0, 0,-
53 0, 0,-
54 0, 0,-
55 i2r_ocsp_acutoff, 0,-
56 -
57 ((void *)0)-
58-
59};-
60-
61const X509V3_EXT_METHOD v3_crl_hold = {-
62 430, 0, (&(ASN1_OBJECT_it)),-
63 0, 0, 0, 0,-
64 0, 0,-
65 0, 0,-
66 i2r_object, 0,-
67 -
68 ((void *)0)-
69-
70};-
71-
72const X509V3_EXT_METHOD v3_ocsp_nonce = {-
73 366, 0, -
74 ((void *)0)-
75 ,-
76 ocsp_nonce_new,-
77 ocsp_nonce_free,-
78 d2i_ocsp_nonce,-
79 i2d_ocsp_nonce,-
80 0, 0,-
81 0, 0,-
82 i2r_ocsp_nonce, 0,-
83 -
84 ((void *)0)-
85-
86};-
87-
88const X509V3_EXT_METHOD v3_ocsp_nocheck = {-
89 369, 0, (&(ASN1_NULL_it)),-
90 0, 0, 0, 0,-
91 0, s2i_ocsp_nocheck,-
92 0, 0,-
93 i2r_ocsp_nocheck, 0,-
94 -
95 ((void *)0)-
96-
97};-
98-
99const X509V3_EXT_METHOD v3_ocsp_serviceloc = {-
100 371, 0, (&(OCSP_SERVICELOC_it)),-
101 0, 0, 0, 0,-
102 0, 0,-
103 0, 0,-
104 i2r_ocsp_serviceloc, 0,-
105 -
106 ((void *)0)-
107-
108};-
109-
110static int i2r_ocsp_crlid(const X509V3_EXT_METHOD *method, void *in, BIO *bp,-
111 int ind)-
112{-
113 OCSP_CRLID *a = in;-
114 if (a->crlUrl
a->crlUrlDescription
TRUEnever evaluated
FALSEevaluated 831 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-831
115 if (BIO_printf(bp, "%*scrlUrl: ", ind, "") <= 0
BIO_printf(bp,... ind, "") <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
116 goto
never executed: goto err;
err;
never executed: goto err;
0
117 if (!ASN1_STRING_print(bp, (ASN1_STRING *)a->crlUrl)
!ASN1_STRING_p...G *)a->crlUrl)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
118 goto
never executed: goto err;
err;
never executed: goto err;
0
119 if (BIO_write(bp, "\n", 1) <= 0
BIO_write(bp, "\n", 1) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
120 goto
never executed: goto err;
err;
never executed: goto err;
0
121 }
never executed: end of block
0
122 if (a->crlNum
a->crlNumDescription
TRUEnever evaluated
FALSEevaluated 831 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-831
123 if (BIO_printf(bp, "%*scrlNum: ", ind, "") <= 0
BIO_printf(bp,... ind, "") <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
124 goto
never executed: goto err;
err;
never executed: goto err;
0
125 if (i2a_ASN1_INTEGER(bp, a->crlNum) <= 0
i2a_ASN1_INTEG...->crlNum) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
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
FALSEnever evaluated
)
0
128 goto
never executed: goto err;
err;
never executed: goto err;
0
129 }
never executed: end of block
0
130 if (a->crlTime
a->crlTimeDescription
TRUEnever evaluated
FALSEevaluated 831 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-831
131 if (BIO_printf(bp, "%*scrlTime: ", ind, "") <= 0
BIO_printf(bp,... ind, "") <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
132 goto
never executed: goto err;
err;
never executed: goto err;
0
133 if (!ASN1_GENERALIZEDTIME_print(bp, a->crlTime)
!ASN1_GENERALI...p, a->crlTime)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
134 goto
never executed: goto err;
err;
never executed: goto err;
0
135 if (BIO_write(bp, "\n", 1) <= 0
BIO_write(bp, "\n", 1) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
136 goto
never executed: goto err;
err;
never executed: goto err;
0
137 }
never executed: end of block
0
138 return
executed 831 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 831 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
831
139 err:-
140 return
never executed: return 0;
0;
never executed: return 0;
0
141}-
142-
143static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *cutoff,-
144 BIO *bp, int ind)-
145{-
146 if (BIO_printf(bp, "%*s", ind, "") <= 0
BIO_printf(bp,... ind, "") <= 0Description
TRUEnever evaluated
FALSEevaluated 5264 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5264
147 return
never executed: return 0;
0;
never executed: return 0;
0
148 if (!ASN1_GENERALIZEDTIME_print(bp, cutoff)
!ASN1_GENERALI...nt(bp, cutoff)Description
TRUEevaluated 4179 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1085 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1085-4179
149 return
executed 4179 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 4179 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
4179
150 return
executed 1085 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1085 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1085
151}-
152-
153static int i2r_object(const X509V3_EXT_METHOD *method, void *oid, BIO *bp,-
154 int ind)-
155{-
156 if (BIO_printf(bp, "%*s", ind, "") <= 0
BIO_printf(bp,... ind, "") <= 0Description
TRUEnever evaluated
FALSEevaluated 270 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-270
157 return
never executed: return 0;
0;
never executed: return 0;
0
158 if (i2a_ASN1_OBJECT(bp, oid) <= 0
i2a_ASN1_OBJECT(bp, oid) <= 0Description
TRUEnever evaluated
FALSEevaluated 270 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-270
159 return
never executed: return 0;
0;
never executed: return 0;
0
160 return
executed 270 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 270 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
270
161}-
162-
163-
164-
165-
166-
167-
168static void *ocsp_nonce_new(void)-
169{-
170 return
never executed: return ASN1_OCTET_STRING_new();
ASN1_OCTET_STRING_new();
never executed: return ASN1_OCTET_STRING_new();
0
171}-
172-
173static int i2d_ocsp_nonce(void *a, unsigned char **pp)-
174{-
175 ASN1_OCTET_STRING *os = a;-
176 if (pp
ppDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
177 memcpy(*pp, os->data, os->length);-
178 *pp += os->length;-
179 }
never executed: end of block
0
180 return
never executed: return os->length;
os->length;
never executed: return os->length;
0
181}-
182-
183static void *d2i_ocsp_nonce(void *a, const unsigned char **pp, long length)-
184{-
185 ASN1_OCTET_STRING *os, **pos;-
186 pos = a;-
187 if (pos ==
pos == ((void *)0)Description
TRUEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-978
188 ((void *)0)
pos == ((void *)0)Description
TRUEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-978
189 || *
*pos == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
pos ==
*pos == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
190 ((void *)0)
*pos == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
191 ) {-
192 os = ASN1_OCTET_STRING_new();-
193 if (os ==
os == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-978
194 ((void *)0)
os == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-978
195 )-
196 goto
never executed: goto err;
err;
never executed: goto err;
0
197 }
executed 978 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
978
198 os = *pos;-
199 }
never executed: end of block
0
200 if (!ASN1_OCTET_STRING_set(os, *pp, length)
!ASN1_OCTET_ST..., *pp, length)Description
TRUEnever evaluated
FALSEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-978
201 goto
never executed: goto err;
err;
never executed: goto err;
0
202-
203 *pp += length;-
204-
205 if (pos
posDescription
TRUEnever evaluated
FALSEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-978
206 *
never executed: *pos = os;
pos = os;
never executed: *pos = os;
0
207 return
executed 978 times by 1 test: return os;
Executed by:
  • libcrypto.so.1.1
os;
executed 978 times by 1 test: return os;
Executed by:
  • libcrypto.so.1.1
978
208-
209 err:-
210 if ((
(pos == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
pos ==
(pos == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
211 ((void *)0)
(pos == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
212 )
(pos == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
|| (*
(*pos != os)Description
TRUEnever evaluated
FALSEnever evaluated
pos != os)
(*pos != os)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
213 ASN1_OCTET_STRING_free(os);
never executed: ASN1_OCTET_STRING_free(os);
0
214 ERR_put_error(39,(102),((1|64)),__FILE__,206);-
215 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
216 ((void *)0)
never executed: return ((void *)0) ;
0
217 ;
never executed: return ((void *)0) ;
0
218}-
219-
220static void ocsp_nonce_free(void *a)-
221{-
222 ASN1_OCTET_STRING_free(a);-
223}
executed 978 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
978
224-
225static int i2r_ocsp_nonce(const X509V3_EXT_METHOD *method, void *nonce,-
226 BIO *out, int indent)-
227{-
228 if (BIO_printf(out, "%*s", indent, "") <= 0
BIO_printf(out...dent, "") <= 0Description
TRUEnever evaluated
FALSEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-978
229 return
never executed: return 0;
0;
never executed: return 0;
0
230 if (i2a_ASN1_STRING(out, nonce, 4) <= 0
i2a_ASN1_STRIN...nonce, 4) <= 0Description
TRUEnever evaluated
FALSEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-978
231 return
never executed: return 0;
0;
never executed: return 0;
0
232 return
executed 978 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 978 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
978
233}-
234-
235-
236-
237static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, void *nocheck,-
238 BIO *out, int indent)-
239{-
240 return
executed 390 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 390 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
390
241}-
242-
243static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method,-
244 X509V3_CTX *ctx, const char *str)-
245{-
246 return
never executed: return ASN1_NULL_new();
ASN1_NULL_new();
never executed: return ASN1_NULL_new();
0
247}-
248-
249static int i2r_ocsp_serviceloc(const X509V3_EXT_METHOD *method, void *in,-
250 BIO *bp, int ind)-
251{-
252 int i;-
253 OCSP_SERVICELOC *a = in;-
254 ACCESS_DESCRIPTION *ad;-
255-
256 if (BIO_printf(bp, "%*sIssuer: ", ind, "") <= 0
BIO_printf(bp,... ind, "") <= 0Description
TRUEnever evaluated
FALSEevaluated 1972 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1972
257 goto
never executed: goto err;
err;
never executed: goto err;
0
258 if (X509_NAME_print_ex(bp, a->issuer, 0, ((1 | 2 | 4 | 0x10 | 0x100 | 0x200) | 8 | (2 << 16) | (1 << 23) | 0)) <= 0
X509_NAME_prin...23) | 0)) <= 0Description
TRUEevaluated 1562 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 410 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
410-1562
259 goto
executed 1562 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1562 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1562
260 for (i = 0; i < sk_ACCESS_DESCRIPTION_num(a->locator)
i < sk_ACCESS_...um(a->locator)Description
TRUEnever evaluated
FALSEevaluated 410 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
0-410
261 ad = sk_ACCESS_DESCRIPTION_value(a->locator, i);-
262 if (BIO_printf(bp, "\n%*s", (2 * ind), "") <= 0
BIO_printf(bp,...ind), "") <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
263 goto
never executed: goto err;
err;
never executed: goto err;
0
264 if (i2a_ASN1_OBJECT(bp, ad->method) <= 0
i2a_ASN1_OBJEC...->method) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
265 goto
never executed: goto err;
err;
never executed: goto err;
0
266 if (BIO_puts(bp, " - ") <= 0
BIO_puts(bp, " - ") <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
267 goto
never executed: goto err;
err;
never executed: goto err;
0
268 if (GENERAL_NAME_print(bp, ad->location) <= 0
GENERAL_NAME_p...location) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
269 goto
never executed: goto err;
err;
never executed: goto err;
0
270 }
never executed: end of block
0
271 return
executed 410 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 410 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
410
272 err:-
273 return
executed 1562 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1562 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
1562
274}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2