OpenCoverage

a_object.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/a_object.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)-
5{-
6 unsigned char *p, *allocated = -
7 ((void *)0)-
8 ;-
9 int objsize;-
10-
11 if ((
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
a ==
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
12 ((void *)0)
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
13 )
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(a->data == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
a->data ==
(a->data == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
14 ((void *)0)
(a->data == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
15 )
(a->data == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
)
0
16 return
never executed: return 0;
0;
never executed: return 0;
0
17-
18 objsize = ASN1_object_size(0, a->length, 6);-
19 if (pp ==
pp == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
20 ((void *)0)
pp == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
21 || objsize == -1
objsize == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
22 return
never executed: return objsize;
objsize;
never executed: return objsize;
0
23-
24 if (*
*pp == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
pp ==
*pp == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
25 ((void *)0)
*pp == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
26 ) {-
27 if ((
(p = allocated...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
p = allocated = CRYPTO_malloc(objsize, __FILE__, 34)) ==
(p = allocated...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
28 ((void *)0)
(p = allocated...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
29 ) {-
30 ERR_put_error(13,(143),((1|64)),__FILE__,35);-
31 return
never executed: return 0;
0;
never executed: return 0;
0
32 }-
33 }
never executed: end of block
else {
0
34 p = *pp;-
35 }
never executed: end of block
0
36-
37 ASN1_put_object(&p, 0, a->length, 6, 0x00);-
38 memcpy(p, a->data, a->length);-
39-
40-
41-
42-
43-
44 *pp = allocated !=
allocated != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
45 ((void *)0)
allocated != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
46 ? allocated : p + a->length;-
47 return
never executed: return objsize;
objsize;
never executed: return objsize;
0
48}-
49-
50int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)-
51{-
52 int i, first, len = 0, c, use_bn;-
53 char ftmp[24], *tmp = ftmp;-
54 int tmpsize = sizeof(ftmp);-
55 const char *p;-
56 unsigned long l;-
57 BIGNUM *bl = -
58 ((void *)0)-
59 ;-
60-
61 if (num == 0
num == 0Description
TRUEnever evaluated
FALSEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-190
62 return
never executed: return 0;
0;
never executed: return 0;
0
63 else if (num == -1
num == -1Description
TRUEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-190
64 num = strlen(buf);
executed 190 times by 1 test: num = strlen(buf);
Executed by:
  • libcrypto.so.1.1
190
65-
66 p = buf;-
67 c = *(p++);-
68 num--;-
69 if ((
(c >= '0')Description
TRUEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
c >= '0')
(c >= '0')Description
TRUEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(c <= '2')Description
TRUEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
c <= '2')
(c <= '2')Description
TRUEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-190
70 first = c - '0';-
71 }
executed 190 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
190
72 ERR_put_error(13,(100),(122),__FILE__,73);-
73 goto
never executed: goto err;
err;
never executed: goto err;
0
74 }-
75-
76 if (num <= 0
num <= 0Description
TRUEnever evaluated
FALSEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-190
77 ERR_put_error(13,(100),(138),__FILE__,78);-
78 goto
never executed: goto err;
err;
never executed: goto err;
0
79 }-
80 c = *(p++);-
81 num--;-
82 for (;;) {-
83 if (num <= 0
num <= 0Description
TRUEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
190-652
84 break;
executed 190 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
190
85 if ((
(c != '.')Description
TRUEnever evaluated
FALSEevaluated 652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
c != '.')
(c != '.')Description
TRUEnever evaluated
FALSEevaluated 652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(c != ' ')Description
TRUEnever evaluated
FALSEnever evaluated
c != ' ')
(c != ' ')Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-652
86 ERR_put_error(13,(100),(131),__FILE__,87);-
87 goto
never executed: goto err;
err;
never executed: goto err;
0
88 }-
89 l = 0;-
90 use_bn = 0;-
91 for (;;) {-
92 if (num <= 0
num <= 0Description
TRUEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1466 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
190-1466
93 break;
executed 190 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
190
94 num--;-
95 c = *(p++);-
96 if ((
(c == ' ')Description
TRUEnever evaluated
FALSEevaluated 1466 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
c == ' ')
(c == ' ')Description
TRUEnever evaluated
FALSEevaluated 1466 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(c == '.')Description
TRUEevaluated 462 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
c == '.')
(c == '.')Description
TRUEevaluated 462 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1466
97 break;
executed 462 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
462
98 if (!(ossl_ctype_check((c), 0x4))
!(ossl_ctype_check((c), 0x4))Description
TRUEnever evaluated
FALSEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1004
99 ERR_put_error(13,(100),(130),__FILE__,100);-
100 goto
never executed: goto err;
err;
never executed: goto err;
0
101 }-
102 if (!use_bn
!use_bnDescription
TRUEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& l >= ((
l >= (( (0x7ff...) - 80) / 10L)Description
TRUEnever evaluated
FALSEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1004
103 (0x7fffffffffffffffL * 2UL + 1UL)
l >= (( (0x7ff...) - 80) / 10L)Description
TRUEnever evaluated
FALSEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1004
104 - 80) / 10L)
l >= (( (0x7ff...) - 80) / 10L)Description
TRUEnever evaluated
FALSEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1004
105 use_bn = 1;-
106 if (bl ==
bl == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
107 ((void *)0)
bl == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
108 )-
109 bl = BN_new();
never executed: bl = BN_new();
0
110 if (bl ==
bl == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
111 ((void *)0)
bl == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
112 || !BN_set_word(bl, l)
!BN_set_word(bl, l)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
113 goto
never executed: goto err;
err;
never executed: goto err;
0
114 }
never executed: end of block
0
115 if (use_bn
use_bnDescription
TRUEnever evaluated
FALSEevaluated 1004 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1004
116 if (!BN_mul_word(bl, 10L)
!BN_mul_word(bl, 10L)Description
TRUEnever evaluated
FALSEnever evaluated
0
117 || !BN_add_word(bl, c - '0')
!BN_add_word(bl, c - '0')Description
TRUEnever evaluated
FALSEnever evaluated
)
0
118 goto
never executed: goto err;
err;
never executed: goto err;
0
119 }
never executed: end of block
else
0
120 l = l * 10L + (long)(c - '0');
executed 1004 times by 1 test: l = l * 10L + (long)(c - '0');
Executed by:
  • libcrypto.so.1.1
1004
121 }-
122 if (len == 0
len == 0Description
TRUEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 462 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
190-462
123 if ((
(first < 2)Description
TRUEevaluated 102 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 88 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
first < 2)
(first < 2)Description
TRUEevaluated 102 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 88 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(l >= 40)Description
TRUEnever evaluated
FALSEevaluated 102 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
l >= 40)
(l >= 40)Description
TRUEnever evaluated
FALSEevaluated 102 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-102
124 ERR_put_error(13,(100),(147),__FILE__,120)-
125 ;-
126 goto
never executed: goto err;
err;
never executed: goto err;
0
127 }-
128 if (use_bn
use_bnDescription
TRUEnever evaluated
FALSEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-190
129 if (!BN_add_word(bl, first * 40)
!BN_add_word(bl, first * 40)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
130 goto
never executed: goto err;
err;
never executed: goto err;
0
131 }
never executed: end of block
else
0
132 l += (long)first *40;
executed 190 times by 1 test: l += (long)first *40;
Executed by:
  • libcrypto.so.1.1
190
133 }-
134 i = 0;-
135 if (use_bn
use_bnDescription
TRUEnever evaluated
FALSEevaluated 652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-652
136 int blsize;-
137 blsize = BN_num_bits(bl);-
138 blsize = (blsize + 6) / 7;-
139 if (blsize > tmpsize
blsize > tmpsizeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
140 if (tmp != ftmp
tmp != ftmpDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
141 CRYPTO_free(tmp, __FILE__, 136);
never executed: CRYPTO_free(tmp, __FILE__, 136);
0
142 tmpsize = blsize + 32;-
143 tmp = CRYPTO_malloc(tmpsize, __FILE__, 138);-
144 if (tmp ==
tmp == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
145 ((void *)0)
tmp == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
146 )-
147 goto
never executed: goto err;
err;
never executed: goto err;
0
148 }
never executed: end of block
0
149 while (blsize--
blsize--Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
150 unsigned long t = BN_div_word(bl, 0x80L);-
151 if (t == (unsigned long)-1
t == (unsigned long)-1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
152 goto
never executed: goto err;
err;
never executed: goto err;
0
153 tmp[i++] = (unsigned char)t;-
154 }
never executed: end of block
0
155 }
never executed: end of block
else {
0
156-
157 for (;;) {-
158 tmp[i++] = (unsigned char)l & 0x7f;-
159 l >>= 7L;-
160 if (l == 0L
l == 0LDescription
TRUEevaluated 652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 176 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
176-652
161 break;
executed 652 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
652
162 }
executed 176 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
176
163-
164 }
executed 652 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
652
165 if (out !=
out != ((void *)0)Description
TRUEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
326
166 ((void *)0)
out != ((void *)0)Description
TRUEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
326
167 ) {-
168 if (len + i > olen
len + i > olenDescription
TRUEnever evaluated
FALSEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-326
169 ERR_put_error(13,(100),(107),__FILE__,160);-
170 goto
never executed: goto err;
err;
never executed: goto err;
0
171 }-
172 while (--
--i > 0Description
TRUEevaluated 88 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i > 0
--i > 0Description
TRUEevaluated 88 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
88-326
173 out[len++] = tmp[i] | 0x80;
executed 88 times by 1 test: out[len++] = tmp[i] | 0x80;
Executed by:
  • libcrypto.so.1.1
88
174 out[len++] = tmp[0];-
175 }
executed 326 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
326
176 len += i;
executed 326 times by 1 test: len += i;
Executed by:
  • libcrypto.so.1.1
326
177 }-
178 if (tmp != ftmp
tmp != ftmpDescription
TRUEnever evaluated
FALSEevaluated 190 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-190
179 CRYPTO_free(tmp, __FILE__, 170);
never executed: CRYPTO_free(tmp, __FILE__, 170);
0
180 BN_free(bl);-
181 return
executed 190 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
len;
executed 190 times by 1 test: return len;
Executed by:
  • libcrypto.so.1.1
190
182 err:-
183 if (tmp != ftmp
tmp != ftmpDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
184 CRYPTO_free(tmp, __FILE__, 175);
never executed: CRYPTO_free(tmp, __FILE__, 175);
0
185 BN_free(bl);-
186 return
never executed: return 0;
0;
never executed: return 0;
0
187}-
188-
189int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a)-
190{-
191 return
executed 347467 times by 1 test: return OBJ_obj2txt(buf, buf_len, a, 0);
Executed by:
  • libcrypto.so.1.1
OBJ_obj2txt(buf, buf_len, a, 0);
executed 347467 times by 1 test: return OBJ_obj2txt(buf, buf_len, a, 0);
Executed by:
  • libcrypto.so.1.1
347467
192}-
193-
194int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a)-
195{-
196 char buf[80], *p = buf;-
197 int i;-
198-
199 if ((
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 333081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a ==
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 333081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-333081
200 ((void *)0)
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 333081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-333081
201 )
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 333081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(a->data == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 333081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a->data ==
(a->data == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 333081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-333081
202 ((void *)0)
(a->data == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 333081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-333081
203 )
(a->data == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 333081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-333081
204 return
never executed: return BIO_write(bp, "NULL", 4);
BIO_write(bp, "NULL", 4);
never executed: return BIO_write(bp, "NULL", 4);
0
205 i = i2t_ASN1_OBJECT(buf, sizeof(buf), a);-
206 if (i > (int)(sizeof(buf) - 1)
i > (int)(sizeof(buf) - 1)Description
TRUEevaluated 1540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 331541 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1540-331541
207 if ((
(p = CRYPTO_ma...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p = CRYPTO_malloc(i + 1, __FILE__, 194)) ==
(p = CRYPTO_ma...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1540
208 ((void *)0)
(p = CRYPTO_ma...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1540
209 ) {-
210 ERR_put_error(13,(126),((1|64)),__FILE__,195);-
211 return
never executed: return -1;
-1;
never executed: return -1;
0
212 }-
213 i2t_ASN1_OBJECT(p, i + 1, a);-
214 }
executed 1540 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1540
215 if (i <= 0
i <= 0Description
TRUEnever evaluated
FALSEevaluated 333081 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-333081
216 i = BIO_write(bp, "<INVALID>", 9);-
217 i += BIO_dump(bp, (const char *)a->data, a->length);-
218 return
never executed: return i;
i;
never executed: return i;
0
219 }-
220 BIO_write(bp, p, i);-
221 if (p != buf
p != bufDescription
TRUEevaluated 1540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 331541 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1540-331541
222 CRYPTO_free(p, __FILE__, 207);
executed 1540 times by 1 test: CRYPTO_free(p, __FILE__, 207);
Executed by:
  • libcrypto.so.1.1
1540
223 return
executed 333081 times by 1 test: return i;
Executed by:
  • libcrypto.so.1.1
i;
executed 333081 times by 1 test: return i;
Executed by:
  • libcrypto.so.1.1
333081
224}-
225-
226ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,-
227 long length)-
228{-
229 const unsigned char *p;-
230 long len;-
231 int tag, xclass;-
232 int inf, i;-
233 ASN1_OBJECT *ret = -
234 ((void *)0)-
235 ;-
236 p = *pp;-
237 inf = ASN1_get_object(&p, &len, &tag, &xclass, length);-
238 if (inf & 0x80
inf & 0x80Description
TRUEevaluated 609 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 231476 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
609-231476
239 i = 102;-
240 goto
executed 609 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 609 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
609
241 }-
242-
243 if (tag != 6
tag != 6Description
TRUEnever evaluated
FALSEevaluated 231476 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-231476
244 i = 116;-
245 goto
never executed: goto err;
err;
never executed: goto err;
0
246 }-
247 ret = c2i_ASN1_OBJECT(a, &p, len);-
248 if (ret
retDescription
TRUEevaluated 223102 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8374 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
8374-223102
249 *
executed 223102 times by 1 test: *pp = p;
Executed by:
  • libcrypto.so.1.1
pp = p;
executed 223102 times by 1 test: *pp = p;
Executed by:
  • libcrypto.so.1.1
223102
250 return
executed 231476 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 231476 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
231476
251 err:-
252 ERR_put_error(13,(147),(i),__FILE__,235);-
253 return
executed 609 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 609 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
609
254 ((void *)0)
executed 609 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
609
255 ;
executed 609 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
609
256}-
257-
258ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,-
259 long len)-
260{-
261 ASN1_OBJECT *ret = -
262 ((void *)0)-
263 , tobj;-
264 const unsigned char *p;-
265 unsigned char *data;-
266 int i, length;-
267-
268-
269-
270-
271-
272-
273 if (len <= 0
len <= 0Description
TRUEevaluated 1396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 896178 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| len > 0x7fffffff
len > 0x7fffffffDescription
TRUEnever evaluated
FALSEevaluated 896178 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| pp ==
pp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 896178 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-896178
274 ((void *)0)
pp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 896178 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-896178
275 || (
(p = *pp) == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 896178 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p = *pp) ==
(p = *pp) == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 896178 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-896178
276 ((void *)0)
(p = *pp) == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 896178 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-896178
277 ||-
278 p[len - 1] & 0x80
p[len - 1] & 0x80Description
TRUEevaluated 8788 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 887390 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8788-887390
279 ERR_put_error(13,(196),(216),__FILE__,254);-
280 return
executed 10184 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 10184 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
10184
281 ((void *)0)
executed 10184 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
10184
282 ;
executed 10184 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
10184
283 }-
284-
285 length = (int)len;-
286-
287-
288-
289-
290 tobj.nid = 0;-
291 tobj.data = p;-
292 tobj.length = length;-
293 tobj.flags = 0;-
294 i = OBJ_obj2nid(&tobj);-
295 if (i != 0
i != 0Description
TRUEevaluated 577097 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 310293 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
310293-577097
296-
297-
298-
299-
300-
301 ret = OBJ_nid2obj(i);-
302 if (a
aDescription
TRUEevaluated 577097 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-577097
303 ASN1_OBJECT_free(*a);-
304 *a = ret;-
305 }
executed 577097 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
577097
306 *pp += len;-
307 return
executed 577097 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 577097 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
577097
308 }-
309 for (i = 0; i < length
i < lengthDescription
TRUEevaluated 914259 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 307734 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++, p++) {
307734-914259
310 if (*
*p == 0x80Description
TRUEevaluated 54593 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 859666 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p == 0x80
*p == 0x80Description
TRUEevaluated 54593 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 859666 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (!i
!iDescription
TRUEevaluated 1005 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53588 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !(p[-1] & 0x80)
!(p[-1] & 0x80)Description
TRUEevaluated 1554 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 52034 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)) {
1005-859666
311 ERR_put_error(13,(196),(216),__FILE__,284);-
312 return
executed 2559 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 2559 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
2559
313 ((void *)0)
executed 2559 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
2559
314 ;
executed 2559 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
2559
315 }-
316 }
executed 911700 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
911700
317-
318-
319-
320-
321-
322 if ((
(a == ((void *)0) )Description
TRUEevaluated 95 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 307639 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a ==
(a == ((void *)0) )Description
TRUEevaluated 95 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 307639 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
95-307639
323 ((void *)0)
(a == ((void *)0) )Description
TRUEevaluated 95 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 307639 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
95-307639
324 )
(a == ((void *)0) )Description
TRUEevaluated 95 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 307639 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| ((*
((*a) == ((void *)0) )Description
TRUEevaluated 93181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 214458 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a) ==
((*a) == ((void *)0) )Description
TRUEevaluated 93181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 214458 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
95-307639
325 ((void *)0)
((*a) == ((void *)0) )Description
TRUEevaluated 93181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 214458 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
93181-214458
326 )
((*a) == ((void *)0) )Description
TRUEevaluated 93181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 214458 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
93181-214458
327 !((*a)->flags & 0x01)
!((*a)->flags & 0x01)Description
TRUEevaluated 211594 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2864 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2864-211594
328 if ((
(ret = ASN1_OB...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 304870 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret = ASN1_OBJECT_new()) ==
(ret = ASN1_OB...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 304870 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-304870
329 ((void *)0)
(ret = ASN1_OB...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 304870 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-304870
330 )-
331 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
332 ((void *)0)
never executed: return ((void *)0) ;
0
333 ;
never executed: return ((void *)0) ;
0
334 }
executed 304870 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
304870
335 ret = (*a);
executed 2864 times by 1 test: ret = (*a);
Executed by:
  • libcrypto.so.1.1
2864
336-
337 p = *pp;-
338-
339 data = (unsigned char *)ret->data;-
340 ret->data = -
341 ((void *)0)-
342 ;-
343-
344 if ((
(data == ((void *)0) )Description
TRUEevaluated 304870 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2864 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
data ==
(data == ((void *)0) )Description
TRUEevaluated 304870 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2864 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2864-304870
345 ((void *)0)
(data == ((void *)0) )Description
TRUEevaluated 304870 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2864 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2864-304870
346 )
(data == ((void *)0) )Description
TRUEevaluated 304870 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2864 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(ret->length < length)Description
TRUEevaluated 815 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2049 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret->length < length)
(ret->length < length)Description
TRUEevaluated 815 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2049 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
815-304870
347 ret->length = 0;-
348 CRYPTO_free(data, __FILE__, 307);-
349 data = CRYPTO_malloc(length, __FILE__, 308);-
350 if (data ==
data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 305685 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-305685
351 ((void *)0)
data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 305685 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-305685
352 ) {-
353 i = (1|64);-
354 goto
never executed: goto err;
err;
never executed: goto err;
0
355 }-
356 ret->flags |= 0x08;-
357 }
executed 305685 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
305685
358 memcpy(data, p, length);-
359-
360 ret->data = data;-
361 ret->length = length;-
362 ret->sn = -
363 ((void *)0)-
364 ;-
365 ret->ln = -
366 ((void *)0)-
367 ;-
368-
369 p += length;-
370-
371 if (a !=
a != ((void *)0)Description
TRUEevaluated 307639 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 95 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
95-307639
372 ((void *)0)
a != ((void *)0)Description
TRUEevaluated 307639 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 95 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
95-307639
373 )-
374 (*
executed 307639 times by 1 test: (*a) = ret;
Executed by:
  • libcrypto.so.1.1
a) = ret;
executed 307639 times by 1 test: (*a) = ret;
Executed by:
  • libcrypto.so.1.1
307639
375 *pp = p;-
376 return
executed 307734 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 307734 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
307734
377 err:-
378 ERR_put_error(13,(196),(i),__FILE__,329);-
379 if ((
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
a ==
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
380 ((void *)0)
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
381 )
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
|| (*
(*a != ret)Description
TRUEnever evaluated
FALSEnever evaluated
a != ret)
(*a != ret)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
382 ASN1_OBJECT_free(ret);
never executed: ASN1_OBJECT_free(ret);
0
383 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
384 ((void *)0)
never executed: return ((void *)0) ;
0
385 ;
never executed: return ((void *)0) ;
0
386}-
387-
388ASN1_OBJECT *ASN1_OBJECT_new(void)-
389{-
390 ASN1_OBJECT *ret;-
391-
392 ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 339);-
393 if (ret ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 357727 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-357727
394 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 357727 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-357727
395 ) {-
396 ERR_put_error(13,(123),((1|64)),__FILE__,341);-
397 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
398 ((void *)0)
never executed: return ((void *)0) ;
0
399 ;
never executed: return ((void *)0) ;
0
400 }-
401 ret->flags = 0x01;-
402 return
executed 357727 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 357727 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
357727
403}-
404-
405void ASN1_OBJECT_free(ASN1_OBJECT *a)-
406{-
407 if (a ==
a == ((void *)0)Description
TRUEevaluated 397533 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1603245 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
397533-1603245
408 ((void *)0)
a == ((void *)0)Description
TRUEevaluated 397533 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1603245 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
397533-1603245
409 )-
410 return;
executed 397533 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
397533
411 if (a->flags & 0x04
a->flags & 0x04Description
TRUEevaluated 52857 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1550388 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
52857-1550388
412-
413-
414-
415 CRYPTO_free((void*)a->sn, __FILE__, 356);-
416 CRYPTO_free((void*)a->ln, __FILE__, 357);-
417-
418 a->sn = a->ln = -
419 ((void *)0)-
420 ;-
421 }
executed 52857 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
52857
422 if (a->flags & 0x08
a->flags & 0x08Description
TRUEevaluated 357727 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1245518 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
357727-1245518
423 CRYPTO_free((void*)a->data, __FILE__, 362);-
424 a->data = -
425 ((void *)0)-
426 ;-
427 a->length = 0;-
428 }
executed 357727 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
357727
429 if (a->flags & 0x01
a->flags & 0x01Description
TRUEevaluated 357727 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1245518 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
357727-1245518
430 CRYPTO_free(a, __FILE__, 367);
executed 357727 times by 1 test: CRYPTO_free(a, __FILE__, 367);
Executed by:
  • libcrypto.so.1.1
357727
431}
executed 1603245 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1603245
432-
433ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,-
434 const char *sn, const char *ln)-
435{-
436 ASN1_OBJECT o;-
437-
438 o.sn = sn;-
439 o.ln = ln;-
440 o.data = data;-
441 o.nid = nid;-
442 o.length = len;-
443 o.flags = 0x01 | 0x04 |-
444 0x08;-
445 return
never executed: return OBJ_dup(&o);
OBJ_dup(&o);
never executed: return OBJ_dup(&o);
0
446}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2