OpenCoverage

ct_oct.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ct/ct_oct.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len)-
5{-
6 size_t siglen;-
7 size_t len_remaining = len;-
8 const unsigned char *p;-
9-
10 if (sct->version != SCT_VERSION_V1
sct->version != SCT_VERSION_V1Description
TRUEnever evaluated
FALSEevaluated 3007 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-3007
11 ERR_put_error(50,(112),(103),__FILE__,31);-
12 return
never executed: return -1;
-1;
never executed: return -1;
0
13 }-
14-
15-
16-
17-
18-
19-
20-
21 if (len <= 4
len <= 4Description
TRUEevaluated 475 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2532 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
475-2532
22 ERR_put_error(50,(112),(107),__FILE__,42);-
23 return
executed 475 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 475 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
475
24 }-
25-
26 p = *in;-
27-
28 sct->hash_alg = *p++;-
29 sct->sig_alg = *p++;-
30 if (SCT_get_signature_nid(sct) == 0
SCT_get_signat..._nid(sct) == 0Description
TRUEevaluated 97 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2435 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
97-2435
31 ERR_put_error(50,(112),(107),__FILE__,51);-
32 return
executed 97 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 97 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
97
33 }-
34-
35 ((siglen=(((unsigned int)((p)[0]))<< 8)| (((unsigned int)((p)[1])) )),p+=2);-
36 len_remaining -= (p - *in);-
37 if (siglen > len_remaining
siglen > len_remainingDescription
TRUEevaluated 73 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2362 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
73-2362
38 ERR_put_error(50,(112),(107),__FILE__,58);-
39 return
executed 73 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 73 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
73
40 }-
41-
42 if (SCT_set1_signature(sct, p, siglen) != 1
SCT_set1_signa..., siglen) != 1Description
TRUEnever evaluated
FALSEevaluated 2362 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2362
43 return
never executed: return -1;
-1;
never executed: return -1;
0
44 len_remaining -= siglen;-
45 *in = p + siglen;-
46-
47 return
executed 2362 times by 1 test: return len - len_remaining;
Executed by:
  • libcrypto.so.1.1
len - len_remaining;
executed 2362 times by 1 test: return len - len_remaining;
Executed by:
  • libcrypto.so.1.1
2362
48}-
49-
50SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len)-
51{-
52 SCT *sct = -
53 ((void *)0)-
54 ;-
55 const unsigned char *p;-
56-
57 if (len == 0
len == 0Description
TRUEnever evaluated
FALSEevaluated 14202 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| len > 65535
len > 65535Description
TRUEnever evaluated
FALSEevaluated 14202 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-14202
58 ERR_put_error(50,(110),(104),__FILE__,76);-
59 goto
never executed: goto err;
err;
never executed: goto err;
0
60 }-
61-
62 if ((
(sct = SCT_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14202 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
sct = SCT_new()) ==
(sct = SCT_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14202 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14202
63 ((void *)0)
(sct = SCT_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14202 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14202
64 )-
65 goto
never executed: goto err;
err;
never executed: goto err;
0
66-
67 p = *in;-
68-
69 sct->version = *p;-
70 if (sct->version == SCT_VERSION_V1
sct->version == SCT_VERSION_V1Description
TRUEevaluated 3365 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10837 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3365-10837
71 int sig_len;-
72 size_t len2;-
73 if (len < 43
len < 43Description
TRUEevaluated 267 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
267-3098
74 ERR_put_error(50,(110),(104),__FILE__,99);-
75 goto
executed 267 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 267 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
267
76 }-
77 len -= 43;-
78 p++;-
79 sct->log_id = CRYPTO_memdup((p), 32, __FILE__, 104);-
80 if (sct->log_id ==
sct->log_id == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3098
81 ((void *)0)
sct->log_id == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3098
82 )-
83 goto
never executed: goto err;
err;
never executed: goto err;
0
84 sct->log_id_len = 32;-
85 p += 32;-
86-
87 (sct->timestamp =((uint64_t)(*((p)++)))<<56, sct->timestamp|=((uint64_t)(*((p)++)))<<48, sct->timestamp|=((uint64_t)(*((p)++)))<<40, sct->timestamp|=((uint64_t)(*((p)++)))<<32, sct->timestamp|=((uint64_t)(*((p)++)))<<24, sct->timestamp|=((uint64_t)(*((p)++)))<<16, sct->timestamp|=((uint64_t)(*((p)++)))<< 8, sct->timestamp|=((uint64_t)(*((p)++))));-
88-
89 ((len2=(((unsigned int)((p)[0]))<< 8)| (((unsigned int)((p)[1])) )),p+=2);-
90 if (len < len2
len < len2Description
TRUEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3006 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
92-3006
91 ERR_put_error(50,(110),(104),__FILE__,114);-
92 goto
executed 92 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 92 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
92
93 }-
94 if (len2 > 0
len2 > 0Description
TRUEevaluated 597 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2409 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
597-2409
95 sct->ext = CRYPTO_memdup((p), len2, __FILE__, 118);-
96 if (sct->ext ==
sct->ext == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 597 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-597
97 ((void *)0)
sct->ext == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 597 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-597
98 )-
99 goto
never executed: goto err;
err;
never executed: goto err;
0
100 }
executed 597 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
597
101 sct->ext_len = len2;-
102 p += len2;-
103 len -= len2;-
104-
105 sig_len = o2i_SCT_signature(sct, &p, len);-
106 if (sig_len <= 0
sig_len <= 0Description
TRUEevaluated 645 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2361 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
645-2361
107 ERR_put_error(50,(110),(104),__FILE__,128);-
108 goto
executed 645 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 645 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
645
109 }-
110 len -= sig_len;-
111 *in = p + len;-
112 }
executed 2361 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
2361
113-
114 sct->sct = CRYPTO_memdup((p), len, __FILE__, 135);-
115 if (sct->sct ==
sct->sct == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10837 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10837
116 ((void *)0)
sct->sct == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10837 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10837
117 )-
118 goto
never executed: goto err;
err;
never executed: goto err;
0
119 sct->sct_len = len;-
120 *in = p + len;-
121 }
executed 10837 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
10837
122-
123 if (psct !=
psct != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13198 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13198
124 ((void *)0)
psct != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13198 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13198
125 ) {-
126 SCT_free(*psct);-
127 *psct = sct;-
128 }
never executed: end of block
0
129-
130 return
executed 13198 times by 1 test: return sct;
Executed by:
  • libcrypto.so.1.1
sct;
executed 13198 times by 1 test: return sct;
Executed by:
  • libcrypto.so.1.1
13198
131err:-
132 SCT_free(sct);-
133 return
executed 1004 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 1004 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
1004
134 ((void *)0)
executed 1004 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
1004
135 ;
executed 1004 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
1004
136}-
137-
138int i2o_SCT_signature(const SCT *sct, unsigned char **out)-
139{-
140 size_t len;-
141 unsigned char *p = -
142 ((void *)0)-
143 , *pstart = -
144 ((void *)0)-
145 ;-
146-
147 if (!SCT_signature_is_complete(sct)
!SCT_signature..._complete(sct)Description
TRUEnever evaluated
FALSEevaluated 549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-549
148 ERR_put_error(50,(109),(107),__FILE__,159);-
149 goto
never executed: goto err;
err;
never executed: goto err;
0
150 }-
151-
152 if (sct->version != SCT_VERSION_V1
sct->version != SCT_VERSION_V1Description
TRUEnever evaluated
FALSEevaluated 549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-549
153 ERR_put_error(50,(109),(103),__FILE__,164);-
154 goto
never executed: goto err;
err;
never executed: goto err;
0
155 }-
156-
157-
158-
159-
160-
161-
162 len = 4 + sct->sig_len;-
163-
164 if (out !=
out != ((void *)0)Description
TRUEevaluated 549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-549
165 ((void *)0)
out != ((void *)0)Description
TRUEevaluated 549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-549
166 ) {-
167 if (*
*out != ((void *)0)Description
TRUEevaluated 549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
out !=
*out != ((void *)0)Description
TRUEevaluated 549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-549
168 ((void *)0)
*out != ((void *)0)Description
TRUEevaluated 549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-549
169 ) {-
170 p = *out;-
171 *out += len;-
172 }
executed 549 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
549
173 pstart = p = CRYPTO_malloc(len, __FILE__, 180);-
174 if (p ==
p == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
175 ((void *)0)
p == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
176 ) {-
177 ERR_put_error(50,(109),((1|64)),__FILE__,182);-
178 goto
never executed: goto err;
err;
never executed: goto err;
0
179 }-
180 *out = p;-
181 }
never executed: end of block
0
182-
183 *p++ = sct->hash_alg;-
184 *p++ = sct->sig_alg;-
185 ((p[0]=(unsigned char)(((sct->sig_len)>> 8)&0xff), p[1]=(unsigned char)(((sct->sig_len) )&0xff)),p+=2);-
186 memcpy(p, sct->sig, sct->sig_len);-
187 }
executed 549 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
549
188-
189 return
executed 549 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
len;
executed 549 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
549
190err:-
191 CRYPTO_free(pstart, __FILE__, 196);-
192 return
never executed: return -1;
-1;
never executed: return -1;
0
193}-
194-
195int i2o_SCT(const SCT *sct, unsigned char **out)-
196{-
197 size_t len;-
198 unsigned char *p = -
199 ((void *)0)-
200 , *pstart = -
201 ((void *)0)-
202 ;-
203-
204 if (!SCT_is_complete(sct)
!SCT_is_complete(sct)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9985 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
20-9985
205 ERR_put_error(50,(107),(106),__FILE__,206);-
206 goto
executed 20 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 20 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
20
207 }-
208-
209-
210-
211-
212-
213-
214 if (sct->version == SCT_VERSION_V1
sct->version == SCT_VERSION_V1Description
TRUEevaluated 1125 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8860 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1125-8860
215 len = 43 + sct->ext_len + 4 + sct->sig_len;
executed 1125 times by 1 test: len = 43 + sct->ext_len + 4 + sct->sig_len;
Executed by:
  • libcrypto.so.1.1
1125
216 else-
217 len = sct->sct_len;
executed 8860 times by 1 test: len = sct->sct_len;
Executed by:
  • libcrypto.so.1.1
8860
218-
219 if (out ==
out == ((void *)0)Description
TRUEevaluated 5035 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4950-5035
220 ((void *)0)
out == ((void *)0)Description
TRUEevaluated 5035 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4950-5035
221 )-
222 return
executed 5035 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
len;
executed 5035 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
5035
223-
224 if (*
*out != ((void *)0)Description
TRUEevaluated 4950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
out !=
*out != ((void *)0)Description
TRUEevaluated 4950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-4950
225 ((void *)0)
*out != ((void *)0)Description
TRUEevaluated 4950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-4950
226 ) {-
227 p = *out;-
228 *out += len;-
229 }
executed 4950 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
4950
230 pstart = p = CRYPTO_malloc(len, __FILE__, 227);-
231 if (p ==
p == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
232 ((void *)0)
p == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
233 ) {-
234 ERR_put_error(50,(107),((1|64)),__FILE__,229);-
235 goto
never executed: goto err;
err;
never executed: goto err;
0
236 }-
237 *out = p;-
238 }
never executed: end of block
0
239-
240 if (sct->version == SCT_VERSION_V1
sct->version == SCT_VERSION_V1Description
TRUEevaluated 549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4401 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
549-4401
241 *p++ = sct->version;-
242 memcpy(p, sct->log_id, 32);-
243 p += 32;-
244 (*((p)++)=(unsigned char)(((sct->timestamp)>>56)&0xff), *((p)++)=(unsigned char)(((sct->timestamp)>>48)&0xff), *((p)++)=(unsigned char)(((sct->timestamp)>>40)&0xff), *((p)++)=(unsigned char)(((sct->timestamp)>>32)&0xff), *((p)++)=(unsigned char)(((sct->timestamp)>>24)&0xff), *((p)++)=(unsigned char)(((sct->timestamp)>>16)&0xff), *((p)++)=(unsigned char)(((sct->timestamp)>> 8)&0xff), *((p)++)=(unsigned char)(((sct->timestamp) )&0xff));-
245 ((p[0]=(unsigned char)(((sct->ext_len)>> 8)&0xff), p[1]=(unsigned char)(((sct->ext_len) )&0xff)),p+=2);-
246 if (sct->ext_len > 0
sct->ext_len > 0Description
TRUEevaluated 89 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 460 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
89-460
247 memcpy(p, sct->ext, sct->ext_len);-
248 p += sct->ext_len;-
249 }
executed 89 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
89
250 if (i2o_SCT_signature(sct, &p) <= 0
i2o_SCT_signat...(sct, &p) <= 0Description
TRUEnever evaluated
FALSEevaluated 549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-549
251 goto
never executed: goto err;
err;
never executed: goto err;
0
252 }
executed 549 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
549
253 memcpy(p, sct->sct, len);-
254 }
executed 4401 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4401
255-
256 return
executed 4950 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
len;
executed 4950 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
4950
257err:-
258 CRYPTO_free(pstart, __FILE__, 253);-
259 return
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
20
260}-
261-
262struct stack_st_SCT *o2i_SCT_LIST(struct stack_st_SCT **a, const unsigned char **pp,-
263 size_t len)-
264{-
265 struct stack_st_SCT *sk = -
266 ((void *)0)-
267 ;-
268 size_t list_len, sct_len;-
269-
270 if (len < 2
len < 2Description
TRUEevaluated 410 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5121 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| len > 65535
len > 65535Description
TRUEnever evaluated
FALSEevaluated 5121 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5121
271 ERR_put_error(50,(111),(105),__FILE__,264);-
272 return
executed 410 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 410 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
410
273 ((void *)0)
executed 410 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
410
274 ;
executed 410 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
410
275 }-
276-
277 ((list_len=(((unsigned int)((*pp)[0]))<< 8)| (((unsigned int)((*pp)[1])) )),*pp+=2);-
278 if (list_len != len - 2
list_len != len - 2Description
TRUEevaluated 428 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4693 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
428-4693
279 ERR_put_error(50,(111),(105),__FILE__,270);-
280 return
executed 428 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 428 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
428
281 ((void *)0)
executed 428 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
428
282 ;
executed 428 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
428
283 }-
284-
285 if (a ==
a == ((void *)0)Description
TRUEevaluated 4692 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-4692
286 ((void *)0)
a == ((void *)0)Description
TRUEevaluated 4692 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-4692
287 || *
*a == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
a ==
*a == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
288 ((void *)0)
*a == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
289 ) {-
290 sk = sk_SCT_new_null();-
291 if (sk ==
sk == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4693 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4693
292 ((void *)0)
sk == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4693 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4693
293 )-
294 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
295 ((void *)0)
never executed: return ((void *)0) ;
0
296 ;
never executed: return ((void *)0) ;
0
297 }
executed 4693 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
4693
298 SCT *sct;-
299-
300-
301 sk = *a;-
302 while ((
(sct = sk_SCT_...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
sct = sk_SCT_pop(sk)) !=
(sct = sk_SCT_...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
303 ((void *)0)
(sct = sk_SCT_...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
304 )-
305 SCT_free(sct);
never executed: SCT_free(sct);
0
306 }
never executed: end of block
0
307-
308 while (list_len > 0
list_len > 0Description
TRUEevaluated 15150 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2741 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2741-15150
309 SCT *sct;-
310-
311 if (list_len < 2
list_len < 2Description
TRUEevaluated 395 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14755 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
395-14755
312 ERR_put_error(50,(111),(105),__FILE__,291);-
313 goto
executed 395 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 395 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
395
314 }-
315 ((sct_len=(((unsigned int)((*pp)[0]))<< 8)| (((unsigned int)((*pp)[1])) )),*pp+=2);-
316 list_len -= 2;-
317-
318 if (sct_len == 0
sct_len == 0Description
TRUEevaluated 134 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14621 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| sct_len > list_len
sct_len > list_lenDescription
TRUEevaluated 419 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14202 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
134-14621
319 ERR_put_error(50,(111),(105),__FILE__,298);-
320 goto
executed 553 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 553 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
553
321 }-
322 list_len -= sct_len;-
323-
324 if ((
(sct = o2i_SCT...== ((void *)0)Description
TRUEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13198 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
sct = o2i_SCT(
(sct = o2i_SCT...== ((void *)0)Description
TRUEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13198 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1004-13198
325 ((void *)0)
(sct = o2i_SCT...== ((void *)0)Description
TRUEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13198 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1004-13198
326 , pp, sct_len)) ==
(sct = o2i_SCT...== ((void *)0)Description
TRUEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13198 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1004-13198
327 ((void *)0)
(sct = o2i_SCT...== ((void *)0)Description
TRUEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13198 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1004-13198
328 )-
329 goto
executed 1004 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1004 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1004
330 if (!sk_SCT_push(sk, sct)
!sk_SCT_push(sk, sct)Description
TRUEnever evaluated
FALSEevaluated 13198 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-13198
331 SCT_free(sct);-
332 goto
never executed: goto err;
err;
never executed: goto err;
0
333 }-
334 }
executed 13198 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
13198
335-
336 if (a !=
a != ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2740 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-2740
337 ((void *)0)
a != ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2740 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-2740
338 && *
*a == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
a ==
*a == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
339 ((void *)0)
*a == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
340 )-
341 *
executed 1 time by 1 test: *a = sk;
Executed by:
  • libcrypto.so.1.1
a = sk;
executed 1 time by 1 test: *a = sk;
Executed by:
  • libcrypto.so.1.1
1
342 return
executed 2741 times by 1 test: return sk;
Executed by:
  • libcrypto.so.1.1
sk;
executed 2741 times by 1 test: return sk;
Executed by:
  • libcrypto.so.1.1
2741
343-
344 err:-
345 if (a ==
a == ((void *)0)Description
TRUEevaluated 1952 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1952
346 ((void *)0)
a == ((void *)0)Description
TRUEevaluated 1952 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1952
347 || *
*a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
a ==
*a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
348 ((void *)0)
*a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
349 )-
350 SCT_LIST_free(sk);
executed 1952 times by 1 test: SCT_LIST_free(sk);
Executed by:
  • libcrypto.so.1.1
1952
351 return
executed 1952 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 1952 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
1952
352 ((void *)0)
executed 1952 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
1952
353 ;
executed 1952 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
1952
354}-
355-
356int i2o_SCT_LIST(const struct stack_st_SCT *a, unsigned char **pp)-
357{-
358 int len, sct_len, i, is_pp_new = 0;-
359 size_t len2;-
360 unsigned char *p = -
361 ((void *)0)-
362 , *p2;-
363-
364 if (pp !=
pp != ((void *)0)Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
104
365 ((void *)0)
pp != ((void *)0)Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
104
366 ) {-
367 if (*
*pp == ((void *)0)Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
pp ==
*pp == ((void *)0)Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-104
368 ((void *)0)
*pp == ((void *)0)Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-104
369 ) {-
370 if ((
(len = i2o_SCT... *)0) )) == -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
len = i2o_SCT_LIST(a,
(len = i2o_SCT... *)0) )) == -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
20-84
371 ((void *)0)
(len = i2o_SCT... *)0) )) == -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
20-84
372 )) == -1
(len = i2o_SCT... *)0) )) == -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
20-84
373 ERR_put_error(50,(108),(105),__FILE__,330);-
374 return
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
20
375 }-
376 if ((*
(*pp = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pp = CRYPTO_malloc(len, __FILE__, 333)) ==
(*pp = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-84
377 ((void *)0)
(*pp = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-84
378 ) {-
379 ERR_put_error(50,(108),((1|64)),__FILE__,334);-
380 return
never executed: return -1;
-1;
never executed: return -1;
0
381 }-
382 is_pp_new = 1;-
383 }
executed 84 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
84
384 p = *pp + 2;-
385 }
executed 84 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
84
386-
387 len2 = 2;-
388 for (i = 0; i < sk_SCT_num(a)
i < sk_SCT_num(a)Description
TRUEevaluated 10005 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 168 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
168-10005
389 if (pp !=
pp != ((void *)0)Description
TRUEevaluated 4950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5055 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4950-5055
390 ((void *)0)
pp != ((void *)0)Description
TRUEevaluated 4950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5055 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4950-5055
391 ) {-
392 p2 = p;-
393 p += 2;-
394 if ((
(sct_len = i2o...i), &p)) == -1Description
TRUEnever evaluated
FALSEevaluated 4950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
sct_len = i2o_SCT(sk_SCT_value(a, i), &p)) == -1
(sct_len = i2o...i), &p)) == -1Description
TRUEnever evaluated
FALSEevaluated 4950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4950
395 goto
never executed: goto err;
err;
never executed: goto err;
0
396 ((p2[0]=(unsigned char)(((sct_len)>> 8)&0xff), p2[1]=(unsigned char)(((sct_len) )&0xff)),p2+=2);-
397 }
executed 4950 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
4950
398 if ((
(sct_len = i2o... *)0) )) == -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5035 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
sct_len = i2o_SCT(sk_SCT_value(a, i),
(sct_len = i2o... *)0) )) == -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5035 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
20-5035
399 ((void *)0)
(sct_len = i2o... *)0) )) == -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5035 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
20-5035
400 )) == -1
(sct_len = i2o... *)0) )) == -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5035 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
20-5035
401 goto
executed 20 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 20 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
20
402 }
executed 5035 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5035
403 len2 += 2 + sct_len;-
404 }
executed 9985 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
9985
405-
406 if (len2 > 65535
len2 > 65535Description
TRUEnever evaluated
FALSEevaluated 168 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-168
407 goto
never executed: goto err;
err;
never executed: goto err;
0
408-
409 if (pp !=
pp != ((void *)0)Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
84
410 ((void *)0)
pp != ((void *)0)Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
84
411 ) {-
412 p = *pp;-
413 ((p[0]=(unsigned char)(((len2 - 2)>> 8)&0xff), p[1]=(unsigned char)(((len2 - 2) )&0xff)),p+=2);-
414 if (!is_pp_new
!is_pp_newDescription
TRUEnever evaluated
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-84
415 *
never executed: *pp += len2;
pp += len2;
never executed: *pp += len2;
0
416 }
executed 84 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
84
417 return
executed 168 times by 1 test: return len2;
Executed by:
  • libcrypto.so.1.1
len2;
executed 168 times by 1 test: return len2;
Executed by:
  • libcrypto.so.1.1
168
418-
419 err:-
420 if (is_pp_new
is_pp_newDescription
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-20
421 CRYPTO_free(*pp, __FILE__, 370);-
422 *pp = -
423 ((void *)0)-
424 ;-
425 }
never executed: end of block
0
426 return
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
20
427}-
428-
429struct stack_st_SCT *d2i_SCT_LIST(struct stack_st_SCT **a, const unsigned char **pp,-
430 long len)-
431{-
432 ASN1_OCTET_STRING *oct = -
433 ((void *)0)-
434 ;-
435 struct stack_st_SCT *sk = -
436 ((void *)0)-
437 ;-
438 const unsigned char *p;-
439-
440 p = *pp;-
441 if (d2i_ASN1_OCTET_STRING(&oct, &p, len) ==
d2i_ASN1_OCTET...== ((void *)0)Description
TRUEevaluated 959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5528 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
959-5528
442 ((void *)0)
d2i_ASN1_OCTET...== ((void *)0)Description
TRUEevaluated 959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5528 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
959-5528
443 )-
444 return
executed 959 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 959 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
959
445 ((void *)0)
executed 959 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
959
446 ;
executed 959 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
959
447-
448 p = oct->data;-
449 if ((
(sk = o2i_SCT_...!= ((void *)0)Description
TRUEevaluated 2739 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2789 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
sk = o2i_SCT_LIST(a, &p, oct->length)) !=
(sk = o2i_SCT_...!= ((void *)0)Description
TRUEevaluated 2739 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2789 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2739-2789
450 ((void *)0)
(sk = o2i_SCT_...!= ((void *)0)Description
TRUEevaluated 2739 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2789 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2739-2789
451 )-
452 *
executed 2739 times by 1 test: *pp += len;
Executed by:
  • libcrypto.so.1.1
pp += len;
executed 2739 times by 1 test: *pp += len;
Executed by:
  • libcrypto.so.1.1
2739
453-
454 ASN1_OCTET_STRING_free(oct);-
455 return
executed 5528 times by 1 test: return sk;
Executed by:
  • libcrypto.so.1.1
sk;
executed 5528 times by 1 test: return sk;
Executed by:
  • libcrypto.so.1.1
5528
456}-
457-
458int i2d_SCT_LIST(const struct stack_st_SCT *a, unsigned char **out)-
459{-
460 ASN1_OCTET_STRING oct;-
461 int len;-
462-
463 oct.data = -
464 ((void *)0)-
465 ;-
466 if ((
(oct.length = ...t.data)) == -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 83 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
oct.length = i2o_SCT_LIST(a, &oct.data)) == -1
(oct.length = ...t.data)) == -1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 83 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
20-83
467 return
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
20
468-
469 len = i2d_ASN1_OCTET_STRING(&oct, out);-
470 CRYPTO_free(oct.data, __FILE__, 405);-
471 return
executed 83 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
len;
executed 83 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
83
472}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2