OpenCoverage

a_int.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/a_int.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x)-
4{-
5 return
executed 41 times by 1 test: return ASN1_STRING_dup(x);
Executed by:
  • libcrypto.so.1.1
ASN1_STRING_dup(x);
executed 41 times by 1 test: return ASN1_STRING_dup(x);
Executed by:
  • libcrypto.so.1.1
41
6}-
7-
8int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y)-
9{-
10 int neg, ret;-
11-
12 neg = x->type & 0x100;-
13 if (neg != (y->type & 0x100)
neg != (y->type & 0x100)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 319 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
6-319
14 if (neg
negDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3
15 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
16 else-
17 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
18 }-
19-
20 ret = ASN1_STRING_cmp(x, y);-
21-
22 if (neg
negDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 316 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3-316
23 return
executed 3 times by 1 test: return -ret;
Executed by:
  • libcrypto.so.1.1
-ret;
executed 3 times by 1 test: return -ret;
Executed by:
  • libcrypto.so.1.1
3
24 else-
25 return
executed 316 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 316 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
316
26}-
27static void twos_complement(unsigned char *dst, const unsigned char *src,-
28 size_t len, unsigned char pad)-
29{-
30 unsigned int carry = pad & 1;-
31-
32-
33 dst += len;-
34 src += len;-
35-
36 while (len-- != 0
len-- != 0Description
TRUEevaluated 1668979 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 242080 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
242080-1668979
37 *(--dst) = (unsigned char)(carry += *(--src) ^ pad);-
38 carry >>= 8;-
39 }
executed 1668979 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1668979
40}
executed 242080 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
242080
41-
42static size_t i2c_ibuf(const unsigned char *b, size_t blen, int neg,-
43 unsigned char **pp)-
44{-
45 unsigned int pad = 0;-
46 size_t ret, i;-
47 unsigned char *p, pb = 0;-
48-
49 if (b !=
b != ((void *)0)Description
TRUEevaluated 256127 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-256127
50 ((void *)0)
b != ((void *)0)Description
TRUEevaluated 256127 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-256127
51 && blen
blenDescription
TRUEevaluated 256126 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-256126
52 ret = blen;-
53 i = b[0];-
54 if (!neg
!negDescription
TRUEevaluated 198059 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 58067 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(i > 127)Description
TRUEevaluated 15700 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 182359 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i > 127)
(i > 127)Description
TRUEevaluated 15700 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 182359 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
15700-198059
55 pad = 1;-
56 pb = 0;-
57 }
executed 15700 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (neg
negDescription
TRUEevaluated 58067 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 182359 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
15700-182359
58 pb = 0xFF;-
59 if (i > 128
i > 128Description
TRUEevaluated 8692 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 49375 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8692-49375
60 pad = 1;-
61 }
executed 8692 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (i == 128
i == 128Description
TRUEevaluated 32483 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16892 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8692-32483
62-
63-
64-
65-
66 for (pad = 0, i = 1; i < blen
i < blenDescription
TRUEevaluated 1032271 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32483 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
32483-1032271
67 pad |= b[i];
executed 1032271 times by 1 test: pad |= b[i];
Executed by:
  • libcrypto.so.1.1
1032271
68 pb = pad != 0
pad != 0Description
TRUEevaluated 21648 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10835 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 0xffU : 0;
10835-21648
69 pad = pb & 1;-
70 }
executed 32483 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
32483
71 }
executed 58067 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
58067
72 ret += pad;-
73 }
executed 256126 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
256126
74 ret = 1;-
75 blen = 0;-
76 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
77-
78 if (pp ==
pp == ((void *)0)Description
TRUEevaluated 109033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 147094 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
109033-147094
79 ((void *)0)
pp == ((void *)0)Description
TRUEevaluated 109033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 147094 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
109033-147094
80 || (
(p = *pp) == ((void *)0)Description
TRUEevaluated 104442 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 42652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p = *pp) ==
(p = *pp) == ((void *)0)Description
TRUEevaluated 104442 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 42652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
42652-104442
81 ((void *)0)
(p = *pp) == ((void *)0)Description
TRUEevaluated 104442 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 42652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
42652-104442
82 )-
83 return
executed 213475 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 213475 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
213475
84-
85-
86-
87-
88-
89-
90 *p = pb;-
91 p += pad;-
92-
93 twos_complement(p, b, blen, pb);-
94-
95 *pp += ret;-
96 return
executed 42652 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 42652 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
42652
97}-
98-
99-
100-
101-
102-
103-
104-
105static size_t c2i_ibuf(unsigned char *b, int *pneg,-
106 const unsigned char *p, size_t plen)-
107{-
108 int neg, pad;-
109-
110 if (plen == 0
plen == 0Description
TRUEevaluated 4801 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 619073 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4801-619073
111 ERR_put_error(13,(226),(222),__FILE__,154);-
112 return
executed 4801 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 4801 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
4801
113 }-
114 neg = p[0] & 0x80;-
115 if (pneg
pnegDescription
TRUEevaluated 308110 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 310963 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
308110-310963
116 *
executed 308110 times by 1 test: *pneg = neg;
Executed by:
  • libcrypto.so.1.1
pneg = neg;
executed 308110 times by 1 test: *pneg = neg;
Executed by:
  • libcrypto.so.1.1
308110
117-
118 if (plen == 1
plen == 1Description
TRUEevaluated 217364 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 401709 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
217364-401709
119 if (b !=
b != ((void *)0)Description
TRUEevaluated 108682 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 108682 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
108682
120 ((void *)0)
b != ((void *)0)Description
TRUEevaluated 108682 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 108682 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
108682
121 ) {-
122 if (neg
negDescription
TRUEevaluated 21152 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 87530 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
21152-87530
123 b[0] = (p[0] ^ 0xFF) + 1;
executed 21152 times by 1 test: b[0] = (p[0] ^ 0xFF) + 1;
Executed by:
  • libcrypto.so.1.1
21152
124 else-
125 b[0] = p[0];
executed 87530 times by 1 test: b[0] = p[0];
Executed by:
  • libcrypto.so.1.1
87530
126 }-
127 return
executed 217364 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 217364 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
217364
128 }-
129-
130 pad = 0;-
131 if (p[0] == 0
p[0] == 0Description
TRUEevaluated 34506 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 367203 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
34506-367203
132 pad = 1;-
133 }
executed 34506 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (p[0] == 0xFF
p[0] == 0xFFDescription
TRUEevaluated 17549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 349654 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
17549-349654
134 size_t i;-
135-
136-
137-
138-
139-
140 for (pad = 0, i = 1; i < plen
i < plenDescription
TRUEevaluated 379365 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 17549 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++)
17549-379365
141 pad |= p[i];
executed 379365 times by 1 test: pad |= p[i];
Executed by:
  • libcrypto.so.1.1
379365
142 pad = pad != 0
pad != 0Description
TRUEevaluated 14365 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3184 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 1 : 0;
3184-14365
143 }
executed 17549 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
17549
144-
145 if (pad
padDescription
TRUEevaluated 48871 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 352838 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(neg == (p[1] & 0x80))Description
TRUEevaluated 2513 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46358 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
neg == (p[1] & 0x80))
(neg == (p[1] & 0x80))Description
TRUEevaluated 2513 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46358 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2513-352838
146 ERR_put_error(13,(226),(221),__FILE__,187);-
147 return
executed 2513 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 2513 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
2513
148 }-
149-
150-
151 p += pad;-
152 plen -= pad;-
153-
154 if (b !=
b != ((void *)0)Description
TRUEevaluated 199428 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 199768 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
199428-199768
155 ((void *)0)
b != ((void *)0)Description
TRUEevaluated 199428 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 199768 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
199428-199768
156 )-
157 twos_complement(b, p, plen, neg ? 0xffU : 0);
executed 199428 times by 1 test: twos_complement(b, p, plen, neg ? 0xffU : 0);
Executed by:
  • libcrypto.so.1.1
199428
158-
159 return
executed 399196 times by 1 test: return plen;
Executed by:
  • libcrypto.so.1.1
plen;
executed 399196 times by 1 test: return plen;
Executed by:
  • libcrypto.so.1.1
399196
160}-
161-
162int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)-
163{-
164 return
executed 127207 times by 1 test: return i2c_ibuf(a->data, a->length, a->type & 0x100, pp);
Executed by:
  • libcrypto.so.1.1
i2c_ibuf(a->data, a->length, a->type & 0x100, pp);
executed 127207 times by 1 test: return i2c_ibuf(a->data, a->length, a->type & 0x100, pp);
Executed by:
  • libcrypto.so.1.1
127207
165}-
166-
167-
168static int asn1_get_uint64(uint64_t *pr, const unsigned char *b, size_t blen)-
169{-
170 size_t i;-
171 uint64_t r;-
172-
173 if (blen > sizeof(*pr)
blen > sizeof(*pr)Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 62789 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
30-62789
174 ERR_put_error(13,(225),(223),__FILE__,213);-
175 return
executed 30 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 30 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
30
176 }-
177 if (b ==
b == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 62789 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-62789
178 ((void *)0)
b == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 62789 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-62789
179 )-
180 return
never executed: return 0;
0;
never executed: return 0;
0
181 for (r = 0, i = 0; i < blen
i < blenDescription
TRUEevaluated 108187 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 62789 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
62789-108187
182 r <<= 8;-
183 r |= b[i];-
184 }
executed 108187 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
108187
185 *pr = r;-
186 return
executed 62789 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 62789 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
62789
187}-
188-
189-
190-
191-
192-
193-
194static size_t asn1_put_uint64(unsigned char b[sizeof(uint64_t)], uint64_t r)-
195{-
196 size_t off = sizeof(uint64_t);-
197-
198 do {-
199 b[--off] = (unsigned char)r;-
200 }
executed 255170 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
while (r >>= 8
r >>= 8Description
TRUEevaluated 125419 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 129751 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
);
125419-255170
201-
202 return
executed 129751 times by 1 test: return off;
Executed by:
  • libcrypto.so.1.1
off;
executed 129751 times by 1 test: return off;
Executed by:
  • libcrypto.so.1.1
129751
203}-
204static int asn1_get_int64(int64_t *pr, const unsigned char *b, size_t blen,-
205 int neg)-
206{-
207 uint64_t r;-
208 if (asn1_get_uint64(&r, b, blen) == 0
asn1_get_uint6... b, blen) == 0Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20421 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
30-20421
209 return
executed 30 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 30 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
30
210 if (neg
negDescription
TRUEevaluated 2587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 17834 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2587-17834
211 if (r <=
r <= (9223372036854775807L)Description
TRUEevaluated 1385 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1202 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1202-1385
212 (9223372036854775807L)
r <= (9223372036854775807L)Description
TRUEevaluated 1385 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1202 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1202-1385
213 ) {-
214-
215-
216 *pr = -(int64_t)r;-
217 }
executed 1385 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (r == ((uint64_t)
r == ((uint64_...54775807L) )))Description
TRUEevaluated 587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 615 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
587-1385
218 (9223372036854775807L)
r == ((uint64_...54775807L) )))Description
TRUEevaluated 587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 615 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
587-615
219 + (-(
r == ((uint64_...54775807L) )))Description
TRUEevaluated 587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 615 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
587-615
220 (-9223372036854775807L -1)
r == ((uint64_...54775807L) )))Description
TRUEevaluated 587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 615 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
587-615
221 +
r == ((uint64_...54775807L) )))Description
TRUEevaluated 587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 615 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
587-615
222 (9223372036854775807L)
r == ((uint64_...54775807L) )))Description
TRUEevaluated 587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 615 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
587-615
223 )))
r == ((uint64_...54775807L) )))Description
TRUEevaluated 587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 615 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
587-615
224-
225-
226 *pr = (int64_t)(0 - r);-
227 }
executed 587 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
587
228 ERR_put_error(13,(224),(224),__FILE__,265);-
229 return
executed 615 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 615 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
615
230 }-
231 } else {-
232 if (r <=
r <= (9223372036854775807L)Description
TRUEevaluated 17121 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 713 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
713-17121
233 (9223372036854775807L)
r <= (9223372036854775807L)Description
TRUEevaluated 17121 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 713 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
713-17121
234 ) {-
235 *pr = (int64_t)r;-
236 }
executed 17121 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
17121
237 ERR_put_error(13,(224),(223),__FILE__,272);-
238 return
executed 713 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 713 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
713
239 }-
240 }-
241 return
executed 19093 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 19093 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
19093
242}-
243-
244-
245ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,-
246 long len)-
247{-
248 ASN1_INTEGER *ret = -
249 ((void *)0)-
250 ;-
251 size_t r;-
252 int neg;-
253-
254 r = c2i_ibuf(-
255 ((void *)0)-
256 , -
257 ((void *)0)-
258 , *pp, len);-
259-
260 if (r == 0
r == 0Description
TRUEevaluated 7184 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
7184-265742
261 return
executed 7184 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 7184 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
7184
262 ((void *)0)
executed 7184 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
7184
263 ;
executed 7184 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
7184
264-
265 if ((
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a ==
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-265742
266 ((void *)0)
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-265742
267 )
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| ((*
((*a) == ((void *)0) )Description
TRUEevaluated 172652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 93090 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a) ==
((*a) == ((void *)0) )Description
TRUEevaluated 172652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 93090 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-265742
268 ((void *)0)
((*a) == ((void *)0) )Description
TRUEevaluated 172652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 93090 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
93090-172652
269 )
((*a) == ((void *)0) )Description
TRUEevaluated 172652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 93090 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
93090-172652
270 ret = ASN1_INTEGER_new();-
271 if (ret ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 172652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-172652
272 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 172652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-172652
273 )-
274 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
275 ((void *)0)
never executed: return ((void *)0) ;
0
276 ;
never executed: return ((void *)0) ;
0
277 ret->type = 2;-
278 }
executed 172652 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
172652
279 ret = *a;
executed 93090 times by 1 test: ret = *a;
Executed by:
  • libcrypto.so.1.1
93090
280-
281 if (ASN1_STRING_set(ret,
ASN1_STRING_se...*)0) , r) == 0Description
TRUEnever evaluated
FALSEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-265742
282 ((void *)0)
ASN1_STRING_se...*)0) , r) == 0Description
TRUEnever evaluated
FALSEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-265742
283 , r) == 0
ASN1_STRING_se...*)0) , r) == 0Description
TRUEnever evaluated
FALSEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-265742
284 goto
never executed: goto err;
err;
never executed: goto err;
0
285-
286 c2i_ibuf(ret->data, &neg, *pp, len);-
287-
288 if (neg
negDescription
TRUEevaluated 49814 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 215928 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
49814-215928
289 ret->type |= 0x100;
executed 49814 times by 1 test: ret->type |= 0x100;
Executed by:
  • libcrypto.so.1.1
49814
290-
291 *pp += len;-
292 if (a !=
a != ((void *)0)Description
TRUEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-265742
293 ((void *)0)
a != ((void *)0)Description
TRUEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-265742
294 )-
295 (*
executed 265742 times by 1 test: (*a) = ret;
Executed by:
  • libcrypto.so.1.1
a) = ret;
executed 265742 times by 1 test: (*a) = ret;
Executed by:
  • libcrypto.so.1.1
265742
296 return
executed 265742 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 265742 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
265742
297 err:-
298 ERR_put_error(13,(194),((1|64)),__FILE__,313);-
299 if ((
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
a ==
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
300 ((void *)0)
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
301 )
(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
302 ASN1_INTEGER_free(ret);
never executed: ASN1_INTEGER_free(ret);
0
303 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
304 ((void *)0)
never executed: return ((void *)0) ;
0
305 ;
never executed: return ((void *)0) ;
0
306}-
307-
308static int asn1_string_get_int64(int64_t *pr, const ASN1_STRING *a, int itype)-
309{-
310 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 20451 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20451
311 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 20451 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20451
312 ) {-
313 ERR_put_error(13,(227),((3|64)),__FILE__,322);-
314 return
never executed: return 0;
0;
never executed: return 0;
0
315 }-
316 if ((
(a->type & ~0x100) != itypeDescription
TRUEnever evaluated
FALSEevaluated 20451 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a->type & ~0x100) != itype
(a->type & ~0x100) != itypeDescription
TRUEnever evaluated
FALSEevaluated 20451 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-20451
317 ERR_put_error(13,(227),(225),__FILE__,326);-
318 return
never executed: return 0;
0;
never executed: return 0;
0
319 }-
320 return
executed 20451 times by 1 test: return asn1_get_int64(pr, a->data, a->length, a->type & 0x100);
Executed by:
  • libcrypto.so.1.1
asn1_get_int64(pr, a->data, a->length, a->type & 0x100);
executed 20451 times by 1 test: return asn1_get_int64(pr, a->data, a->length, a->type & 0x100);
Executed by:
  • libcrypto.so.1.1
20451
321}-
322-
323static int asn1_string_set_int64(ASN1_STRING *a, int64_t r, int itype)-
324{-
325 unsigned char tbuf[sizeof(r)];-
326 size_t off;-
327-
328 a->type = itype;-
329 if (r < 0
r < 0Description
TRUEnever evaluated
FALSEevaluated 829 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-829
330-
331-
332-
333-
334-
335 off = asn1_put_uint64(tbuf, 0 - (uint64_t)r);-
336 a->type |= 0x100;-
337 }
never executed: end of block
else {
0
338 off = asn1_put_uint64(tbuf, r);-
339 a->type &= ~0x100;-
340 }
executed 829 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
829
341 return
executed 829 times by 1 test: return ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
Executed by:
  • libcrypto.so.1.1
ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
executed 829 times by 1 test: return ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
Executed by:
  • libcrypto.so.1.1
829
342}-
343-
344static int asn1_string_get_uint64(uint64_t *pr, const ASN1_STRING *a,-
345 int itype)-
346{-
347 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
348 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
349 ) {-
350 ERR_put_error(13,(230),((3|64)),__FILE__,357);-
351 return
never executed: return 0;
0;
never executed: return 0;
0
352 }-
353 if ((
(a->type & ~0x100) != itypeDescription
TRUEnever evaluated
FALSEnever evaluated
a->type & ~0x100) != itype
(a->type & ~0x100) != itypeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
354 ERR_put_error(13,(230),(225),__FILE__,361);-
355 return
never executed: return 0;
0;
never executed: return 0;
0
356 }-
357 if (a->type & 0x100
a->type & 0x100Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
358 ERR_put_error(13,(230),(226),__FILE__,365);-
359 return
never executed: return 0;
0;
never executed: return 0;
0
360 }-
361 return
never executed: return asn1_get_uint64(pr, a->data, a->length);
asn1_get_uint64(pr, a->data, a->length);
never executed: return asn1_get_uint64(pr, a->data, a->length);
0
362}-
363-
364static int asn1_string_set_uint64(ASN1_STRING *a, uint64_t r, int itype)-
365{-
366 unsigned char tbuf[sizeof(r)];-
367 size_t off;-
368-
369 a->type = itype;-
370 off = asn1_put_uint64(tbuf, r);-
371 return
executed 2 times by 1 test: return ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
Executed by:
  • libcrypto.so.1.1
ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
executed 2 times by 1 test: return ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
Executed by:
  • libcrypto.so.1.1
2
372}-
373-
374-
375-
376-
377-
378-
379-
380ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,-
381 long length)-
382{-
383 ASN1_INTEGER *ret = -
384 ((void *)0)-
385 ;-
386 const unsigned char *p;-
387 unsigned char *s;-
388 long len;-
389 int inf, tag, xclass;-
390 int i;-
391-
392 if ((
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
a ==
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
393 ((void *)0)
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
394 )
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
|| ((*
((*a) == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
a) ==
((*a) == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
395 ((void *)0)
((*a) == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
396 )
((*a) == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
397 if ((
(ret = ASN1_IN...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
ret = ASN1_INTEGER_new()) ==
(ret = ASN1_IN...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
398 ((void *)0)
(ret = ASN1_IN...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
399 )-
400 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
401 ((void *)0)
never executed: return ((void *)0) ;
0
402 ;
never executed: return ((void *)0) ;
0
403 ret->type = 2;-
404 }
never executed: end of block
else
0
405 ret = (*a);
never executed: ret = (*a);
0
406-
407 p = *pp;-
408 inf = ASN1_get_object(&p, &len, &tag, &xclass, length);-
409 if (inf & 0x80
inf & 0x80Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
410 i = 102;-
411 goto
never executed: goto err;
err;
never executed: goto err;
0
412 }-
413-
414 if (tag != 2
tag != 2Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
415 i = 115;-
416 goto
never executed: goto err;
err;
never executed: goto err;
0
417 }-
418-
419-
420-
421-
422-
423 s = CRYPTO_malloc((int)len + 1, __FILE__, 420);-
424 if (s ==
s == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
425 ((void *)0)
s == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
426 ) {-
427 i = (1|64);-
428 goto
never executed: goto err;
err;
never executed: goto err;
0
429 }-
430 ret->type = 2;-
431 if (len
lenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
432 if ((*
(*p == 0)Description
TRUEnever evaluated
FALSEnever evaluated
p == 0)
(*p == 0)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(len != 1)Description
TRUEnever evaluated
FALSEnever evaluated
len != 1)
(len != 1)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
433 p++;-
434 len--;-
435 }
never executed: end of block
0
436 memcpy(s, p, (int)len);-
437 p += len;-
438 }
never executed: end of block
0
439-
440 CRYPTO_free(ret->data, __FILE__, 435);-
441 ret->data = s;-
442 ret->length = (int)len;-
443 if (a !=
a != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
444 ((void *)0)
a != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
445 )-
446 (*
never executed: (*a) = ret;
a) = ret;
never executed: (*a) = ret;
0
447 *pp = p;-
448 return
never executed: return ret;
ret;
never executed: return ret;
0
449 err:-
450 ERR_put_error(13,(150),(i),__FILE__,443);-
451 if ((
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
a ==
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
452 ((void *)0)
(a == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
453 )
(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
454 ASN1_INTEGER_free(ret);
never executed: ASN1_INTEGER_free(ret);
0
455 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
456 ((void *)0)
never executed: return ((void *)0) ;
0
457 ;
never executed: return ((void *)0) ;
0
458}-
459-
460static ASN1_STRING *bn_to_asn1_string(const BIGNUM *bn, ASN1_STRING *ai,-
461 int atype)-
462{-
463 ASN1_INTEGER *ret;-
464 int len;-
465-
466 if (ai ==
ai == ((void *)0)Description
TRUEevaluated 131 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 60 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
60-131
467 ((void *)0)
ai == ((void *)0)Description
TRUEevaluated 131 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 60 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
60-131
468 ) {-
469 ret = ASN1_STRING_type_new(atype);-
470 }
executed 131 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
131
471 ret = ai;-
472 ret->type = atype;-
473 }
executed 60 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
60
474-
475 if (ret ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 191 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-191
476 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 191 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-191
477 ) {-
478 ERR_put_error(13,(229),(58),__FILE__,463);-
479 goto
never executed: goto err;
err;
never executed: goto err;
0
480 }-
481-
482 if (BN_is_negative(bn)
BN_is_negative(bn)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 179 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !BN_is_zero(bn)
!BN_is_zero(bn)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-179
483 ret->type |= (2 | 0x100);
executed 12 times by 1 test: ret->type |= (2 | 0x100);
Executed by:
  • libcrypto.so.1.1
12
484-
485 len = ((BN_num_bits(bn)+7)/8);-
486-
487 if (len == 0
len == 0Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 160 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
31-160
488 len = 1;
executed 31 times by 1 test: len = 1;
Executed by:
  • libcrypto.so.1.1
31
489-
490 if (ASN1_STRING_set(ret,
ASN1_STRING_se...0) , len) == 0Description
TRUEnever evaluated
FALSEevaluated 191 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-191
491 ((void *)0)
ASN1_STRING_se...0) , len) == 0Description
TRUEnever evaluated
FALSEevaluated 191 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-191
492 , len) == 0
ASN1_STRING_se...0) , len) == 0Description
TRUEnever evaluated
FALSEevaluated 191 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-191
493 ERR_put_error(13,(229),((1|64)),__FILE__,476);-
494 goto
never executed: goto err;
err;
never executed: goto err;
0
495 }-
496-
497-
498 if (BN_is_zero(bn)
BN_is_zero(bn)Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 160 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
31-160
499 ret->data[0] = 0;
executed 31 times by 1 test: ret->data[0] = 0;
Executed by:
  • libcrypto.so.1.1
31
500 else-
501 len = BN_bn2bin(bn, ret->data);
executed 160 times by 1 test: len = BN_bn2bin(bn, ret->data);
Executed by:
  • libcrypto.so.1.1
160
502 ret->length = len;-
503 return
executed 191 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 191 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
191
504 err:-
505 if (ret != ai
ret != aiDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
506 ASN1_INTEGER_free(ret);
never executed: ASN1_INTEGER_free(ret);
0
507 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
508 ((void *)0)
never executed: return ((void *)0) ;
0
509 ;
never executed: return ((void *)0) ;
0
510}-
511-
512static BIGNUM *asn1_string_to_bn(const ASN1_INTEGER *ai, BIGNUM *bn,-
513 int itype)-
514{-
515 BIGNUM *ret;-
516-
517 if ((
(ai->type & ~0x100) != itypeDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15168 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ai->type & ~0x100) != itype
(ai->type & ~0x100) != itypeDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15168 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
38-15168
518 ERR_put_error(13,(228),(225),__FILE__,499);-
519 return
executed 38 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 38 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
38
520 ((void *)0)
executed 38 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
38
521 ;
executed 38 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
38
522 }-
523-
524 ret = BN_bin2bn(ai->data, ai->length, bn);-
525 if (ret ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15168 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15168
526 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15168 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15168
527 ) {-
528 ERR_put_error(13,(228),(105),__FILE__,505);-
529 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
530 ((void *)0)
never executed: return ((void *)0) ;
0
531 ;
never executed: return ((void *)0) ;
0
532 }-
533 if (ai->type & 0x100
ai->type & 0x100Description
TRUEevaluated 2868 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12300 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2868-12300
534 BN_set_negative(ret, 1);
executed 2868 times by 1 test: BN_set_negative(ret, 1);
Executed by:
  • libcrypto.so.1.1
2868
535 return
executed 15168 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 15168 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
15168
536}-
537-
538int ASN1_INTEGER_get_int64(int64_t *pr, const ASN1_INTEGER *a)-
539{-
540 return
executed 15773 times by 1 test: return asn1_string_get_int64(pr, a, 2);
Executed by:
  • libcrypto.so.1.1
asn1_string_get_int64(pr, a, 2);
executed 15773 times by 1 test: return asn1_string_get_int64(pr, a, 2);
Executed by:
  • libcrypto.so.1.1
15773
541}-
542-
543int ASN1_INTEGER_set_int64(ASN1_INTEGER *a, int64_t r)-
544{-
545 return
executed 829 times by 1 test: return asn1_string_set_int64(a, r, 2);
Executed by:
  • libcrypto.so.1.1
asn1_string_set_int64(a, r, 2);
executed 829 times by 1 test: return asn1_string_set_int64(a, r, 2);
Executed by:
  • libcrypto.so.1.1
829
546}-
547-
548int ASN1_INTEGER_get_uint64(uint64_t *pr, const ASN1_INTEGER *a)-
549{-
550 return
never executed: return asn1_string_get_uint64(pr, a, 2);
asn1_string_get_uint64(pr, a, 2);
never executed: return asn1_string_get_uint64(pr, a, 2);
0
551}-
552-
553int ASN1_INTEGER_set_uint64(ASN1_INTEGER *a, uint64_t r)-
554{-
555 return
executed 2 times by 1 test: return asn1_string_set_uint64(a, r, 2);
Executed by:
  • libcrypto.so.1.1
asn1_string_set_uint64(a, r, 2);
executed 2 times by 1 test: return asn1_string_set_uint64(a, r, 2);
Executed by:
  • libcrypto.so.1.1
2
556}-
557-
558int ASN1_INTEGER_set(ASN1_INTEGER *a, long v)-
559{-
560 return
executed 829 times by 1 test: return ASN1_INTEGER_set_int64(a, v);
Executed by:
  • libcrypto.so.1.1
ASN1_INTEGER_set_int64(a, v);
executed 829 times by 1 test: return ASN1_INTEGER_set_int64(a, v);
Executed by:
  • libcrypto.so.1.1
829
561}-
562-
563long ASN1_INTEGER_get(const ASN1_INTEGER *a)-
564{-
565 int i;-
566 int64_t r;-
567 if (a ==
a == ((void *)0)Description
TRUEevaluated 2770 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15773 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2770-15773
568 ((void *)0)
a == ((void *)0)Description
TRUEevaluated 2770 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15773 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2770-15773
569 )-
570 return
executed 2770 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 2770 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
2770
571 i = ASN1_INTEGER_get_int64(&r, a);-
572 if (i == 0
i == 0Description
TRUEevaluated 131 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15642 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
131-15642
573 return
executed 131 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 131 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
131
574 if (r > 0x7fffffffffffffffL
r > 0x7fffffffffffffffLDescription
TRUEnever evaluated
FALSEevaluated 15642 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| r <
r < (-0x7fffff...fffffffL - 1L)Description
TRUEnever evaluated
FALSEevaluated 15642 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15642
575 (-0x7fffffffffffffffL - 1L)
r < (-0x7fffff...fffffffL - 1L)Description
TRUEnever evaluated
FALSEevaluated 15642 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15642
576 )-
577 return
never executed: return -1;
-1;
never executed: return -1;
0
578 return
executed 15642 times by 1 test: return (long)r;
Executed by:
  • libcrypto.so.1.1
(long)r;
executed 15642 times by 1 test: return (long)r;
Executed by:
  • libcrypto.so.1.1
15642
579}-
580-
581ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai)-
582{-
583 return
executed 191 times by 1 test: return bn_to_asn1_string(bn, ai, 2);
Executed by:
  • libcrypto.so.1.1
bn_to_asn1_string(bn, ai, 2);
executed 191 times by 1 test: return bn_to_asn1_string(bn, ai, 2);
Executed by:
  • libcrypto.so.1.1
191
584}-
585-
586BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn)-
587{-
588 return
executed 13334 times by 1 test: return asn1_string_to_bn(ai, bn, 2);
Executed by:
  • libcrypto.so.1.1
asn1_string_to_bn(ai, bn, 2);
executed 13334 times by 1 test: return asn1_string_to_bn(ai, bn, 2);
Executed by:
  • libcrypto.so.1.1
13334
589}-
590-
591int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_ENUMERATED *a)-
592{-
593 return
executed 4678 times by 1 test: return asn1_string_get_int64(pr, a, 10);
Executed by:
  • libcrypto.so.1.1
asn1_string_get_int64(pr, a, 10);
executed 4678 times by 1 test: return asn1_string_get_int64(pr, a, 10);
Executed by:
  • libcrypto.so.1.1
4678
594}-
595-
596int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r)-
597{-
598 return
never executed: return asn1_string_set_int64(a, r, 10);
asn1_string_set_int64(a, r, 10);
never executed: return asn1_string_set_int64(a, r, 10);
0
599}-
600-
601int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)-
602{-
603 return
never executed: return ASN1_ENUMERATED_set_int64(a, v);
ASN1_ENUMERATED_set_int64(a, v);
never executed: return ASN1_ENUMERATED_set_int64(a, v);
0
604}-
605-
606long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a)-
607{-
608 int i;-
609 int64_t r;-
610 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5798
611 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5798
612 )-
613 return
never executed: return 0;
0;
never executed: return 0;
0
614 if ((
(a->type & ~0x100) != 10Description
TRUEnever evaluated
FALSEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a->type & ~0x100) != 10
(a->type & ~0x100) != 10Description
TRUEnever evaluated
FALSEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5798
615 return
never executed: return -1;
-1;
never executed: return -1;
0
616 if (a->length > (int)sizeof(long)
a->length > (int)sizeof(long)Description
TRUEevaluated 1120 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4678 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1120-4678
617 return
executed 1120 times by 1 test: return 0xffffffffL;
Executed by:
  • libcrypto.so.1.1
0xffffffffL;
executed 1120 times by 1 test: return 0xffffffffL;
Executed by:
  • libcrypto.so.1.1
1120
618 i = ASN1_ENUMERATED_get_int64(&r, a);-
619 if (i == 0
i == 0Description
TRUEevaluated 1227 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3451 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1227-3451
620 return
executed 1227 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 1227 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
1227
621 if (r > 0x7fffffffffffffffL
r > 0x7fffffffffffffffLDescription
TRUEnever evaluated
FALSEevaluated 3451 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| r <
r < (-0x7fffff...fffffffL - 1L)Description
TRUEnever evaluated
FALSEevaluated 3451 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3451
622 (-0x7fffffffffffffffL - 1L)
r < (-0x7fffff...fffffffL - 1L)Description
TRUEnever evaluated
FALSEevaluated 3451 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3451
623 )-
624 return
never executed: return -1;
-1;
never executed: return -1;
0
625 return
executed 3451 times by 1 test: return (long)r;
Executed by:
  • libcrypto.so.1.1
(long)r;
executed 3451 times by 1 test: return (long)r;
Executed by:
  • libcrypto.so.1.1
3451
626}-
627-
628ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai)-
629{-
630 return
never executed: return bn_to_asn1_string(bn, ai, 10);
bn_to_asn1_string(bn, ai, 10);
never executed: return bn_to_asn1_string(bn, ai, 10);
0
631}-
632-
633BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn)-
634{-
635 return
executed 1872 times by 1 test: return asn1_string_to_bn(ai, bn, 10);
Executed by:
  • libcrypto.so.1.1
asn1_string_to_bn(ai, bn, 10);
executed 1872 times by 1 test: return asn1_string_to_bn(ai, bn, 10);
Executed by:
  • libcrypto.so.1.1
1872
636}-
637-
638-
639int c2i_uint64_int(uint64_t *ret, int *neg, const unsigned char **pp, long len)-
640{-
641 unsigned char buf[sizeof(uint64_t)];-
642 size_t buflen;-
643-
644 buflen = c2i_ibuf(-
645 ((void *)0)-
646 , -
647 ((void *)0)-
648 , *pp, len);-
649 if (buflen == 0
buflen == 0Description
TRUEevaluated 130 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 42708 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
130-42708
650 return
executed 130 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 130 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
130
651 if (buflen > sizeof(uint64_t)
buflen > sizeof(uint64_t)Description
TRUEevaluated 340 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 42368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
340-42368
652 ERR_put_error(13,(101),(223),__FILE__,615);-
653 return
executed 340 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 340 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
340
654 }-
655 (void)c2i_ibuf(buf, neg, *pp, len);-
656 return
executed 42368 times by 1 test: return asn1_get_uint64(ret, buf, buflen);
Executed by:
  • libcrypto.so.1.1
asn1_get_uint64(ret, buf, buflen);
executed 42368 times by 1 test: return asn1_get_uint64(ret, buf, buflen);
Executed by:
  • libcrypto.so.1.1
42368
657}-
658-
659int i2c_uint64_int(unsigned char *p, uint64_t r, int neg)-
660{-
661 unsigned char buf[sizeof(uint64_t)];-
662 size_t off;-
663-
664 off = asn1_put_uint64(buf, r);-
665 return
executed 128920 times by 1 test: return i2c_ibuf(buf + off, sizeof(buf) - off, neg, &p);
Executed by:
  • libcrypto.so.1.1
i2c_ibuf(buf + off, sizeof(buf) - off, neg, &p);
executed 128920 times by 1 test: return i2c_ibuf(buf + off, sizeof(buf) - off, neg, &p);
Executed by:
  • libcrypto.so.1.1
128920
666}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2