OpenCoverage

encode.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/encode.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2static unsigned char conv_ascii2bin(unsigned char a,-
3 const unsigned char *table);-
4static int evp_encodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,-
5 const unsigned char *f, int dlen);-
6static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,-
7 const unsigned char *f, int n);-
8static const unsigned char data_bin2ascii[65] =-
9 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";-
10-
11-
12static const unsigned char srpdata_bin2ascii[65] =-
13 "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";-
14static const unsigned char data_ascii2bin[128] = {-
15 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
16 0xFF, 0xE0, 0xF0, 0xFF, 0xFF, 0xF1, 0xFF, 0xFF,-
17 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
18 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
19 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
20 0xFF, 0xFF, 0xFF, 0x3E, 0xFF, 0xF2, 0xFF, 0x3F,-
21 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,-
22 0x3C, 0x3D, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF,-
23 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,-
24 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,-
25 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,-
26 0x17, 0x18, 0x19, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
27 0xFF, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,-
28 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,-
29 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,-
30 0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
31};-
32-
33static const unsigned char srpdata_ascii2bin[128] = {-
34 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
35 0xFF, 0xE0, 0xF0, 0xFF, 0xFF, 0xF1, 0xFF, 0xFF,-
36 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
37 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
38 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
39 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF2, 0x3E, 0x3F,-
40 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,-
41 0x08, 0x09, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF,-
42 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,-
43 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,-
44 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,-
45 0x21, 0x22, 0x23, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
46 0xFF, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A,-
47 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32,-
48 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,-
49 0x3B, 0x3C, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
50};-
51-
52-
53static unsigned char conv_ascii2bin(unsigned char a, const unsigned char *table)-
54{-
55 if (a & 0x80
a & 0x80Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 35049650 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2-35049650
56 return
executed 2 times by 1 test: return 0xFF;
Executed by:
  • libcrypto.so.1.1
0xFF;
executed 2 times by 1 test: return 0xFF;
Executed by:
  • libcrypto.so.1.1
2
57 return
executed 35049650 times by 1 test: return table[a];
Executed by:
  • libcrypto.so.1.1
table[a];
executed 35049650 times by 1 test: return table[a];
Executed by:
  • libcrypto.so.1.1
35049650
58}-
59EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)-
60{-
61 return
executed 22934 times by 1 test: return CRYPTO_zalloc(sizeof(EVP_ENCODE_CTX), __FILE__, 129);
Executed by:
  • libcrypto.so.1.1
CRYPTO_zalloc(sizeof(EVP_ENCODE_CTX), __FILE__, 129);
executed 22934 times by 1 test: return CRYPTO_zalloc(sizeof(EVP_ENCODE_CTX), __FILE__, 129);
Executed by:
  • libcrypto.so.1.1
22934
62}-
63-
64void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)-
65{-
66 CRYPTO_free(ctx, __FILE__, 134);-
67}
executed 22934 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
22934
68-
69int EVP_ENCODE_CTX_copy(EVP_ENCODE_CTX *dctx, EVP_ENCODE_CTX *sctx)-
70{-
71 memcpy(dctx, sctx, sizeof(EVP_ENCODE_CTX));-
72-
73 return
never executed: return 1;
1;
never executed: return 1;
0
74}-
75-
76int EVP_ENCODE_CTX_num(EVP_ENCODE_CTX *ctx)-
77{-
78 return
executed 352 times by 1 test: return ctx->num;
Executed by:
  • libcrypto.so.1.1
ctx->num;
executed 352 times by 1 test: return ctx->num;
Executed by:
  • libcrypto.so.1.1
352
79}-
80-
81void evp_encode_ctx_set_flags(EVP_ENCODE_CTX *ctx, unsigned int flags)-
82{-
83 ctx->flags = flags;-
84}
executed 12 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
12
85-
86void EVP_EncodeInit(EVP_ENCODE_CTX *ctx)-
87{-
88 ctx->length = 48;-
89 ctx->num = 0;-
90 ctx->line_num = 0;-
91 ctx->flags = 0;-
92}
executed 402 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
402
93-
94int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,-
95 const unsigned char *in, int inl)-
96{-
97 int i, j;-
98 size_t total = 0;-
99-
100 *outl = 0;-
101 if (inl <= 0
inl <= 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2425 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1-2425
102 return
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
1
103 (void)((ctx->length <= (int)sizeof(ctx->enc_data)) ? 0 : (OPENSSL_die("assertion failed: " "ctx->length <= (int)sizeof(ctx->enc_data)", __FILE__, 171), 1));-
104 if (ctx->length - ctx->num > inl
ctx->length - ctx->num > inlDescription
TRUEevaluated 386 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2039 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
386-2039
105 memcpy(&(ctx->enc_data[ctx->num]), in, inl);-
106 ctx->num += inl;-
107 return
executed 386 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 386 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
386
108 }-
109 if (ctx->num != 0
ctx->num != 0Description
TRUEevaluated 1482 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 557 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
557-1482
110 i = ctx->length - ctx->num;-
111 memcpy(&(ctx->enc_data[ctx->num]), in, i);-
112 in += i;-
113 inl -= i;-
114 j = evp_encodeblock_int(ctx, out, ctx->enc_data, ctx->length);-
115 ctx->num = 0;-
116 out += j;-
117 total = j;-
118 if ((
(ctx->flags & 1) == 0Description
TRUEevaluated 1480 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx->flags & 1) == 0
(ctx->flags & 1) == 0Description
TRUEevaluated 1480 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-1480
119 *(out++) = '\n';-
120 total++;-
121 }
executed 1480 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1480
122 *out = '\0';-
123 }
executed 1482 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1482
124 while (inl >= ctx->length
inl >= ctx->lengthDescription
TRUEevaluated 8968 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2039 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& total <= 0x7fffffff
total <= 0x7fffffffDescription
TRUEevaluated 8968 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-8968
125 j = evp_encodeblock_int(ctx, out, in, ctx->length);-
126 in += ctx->length;-
127 inl -= ctx->length;-
128 out += j;-
129 total += j;-
130 if ((
(ctx->flags & 1) == 0Description
TRUEevaluated 8928 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx->flags & 1) == 0
(ctx->flags & 1) == 0Description
TRUEevaluated 8928 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
40-8928
131 *(out++) = '\n';-
132 total++;-
133 }
executed 8928 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8928
134 *out = '\0';-
135 }
executed 8968 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8968
136 if (total > 0x7fffffff
total > 0x7fffffffDescription
TRUEnever evaluated
FALSEevaluated 2039 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2039
137-
138 *outl = 0;-
139 return
never executed: return 0;
0;
never executed: return 0;
0
140 }-
141 if (inl != 0
inl != 0Description
TRUEevaluated 1722 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 317 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
317-1722
142 memcpy(&(ctx->enc_data[0]), in, inl);
executed 1722 times by 1 test: memcpy(&(ctx->enc_data[0]), in, inl);
Executed by:
  • libcrypto.so.1.1
1722
143 ctx->num = inl;-
144 *outl = total;-
145-
146 return
executed 2039 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2039 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2039
147}-
148-
149void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)-
150{-
151 unsigned int ret = 0;-
152-
153 if (ctx->num != 0
ctx->num != 0Description
TRUEevaluated 395 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5-395
154 ret = evp_encodeblock_int(ctx, out, ctx->enc_data, ctx->num);-
155 if ((
(ctx->flags & 1) == 0Description
TRUEevaluated 391 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx->flags & 1) == 0
(ctx->flags & 1) == 0Description
TRUEevaluated 391 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4-391
156 out[ret++] = '\n';
executed 391 times by 1 test: out[ret++] = '\n';
Executed by:
  • libcrypto.so.1.1
391
157 out[ret] = '\0';-
158 ctx->num = 0;-
159 }
executed 395 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
395
160 *outl = ret;-
161}
executed 400 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
400
162-
163static int evp_encodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,-
164 const unsigned char *f, int dlen)-
165{-
166 int i, ret = 0;-
167 unsigned long l;-
168 const unsigned char *table;-
169-
170 if (ctx !=
ctx != ((void *)0)Description
TRUEevaluated 10845 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-10845
171 ((void *)0)
ctx != ((void *)0)Description
TRUEevaluated 10845 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-10845
172 && (
(ctx->flags & 2) != 0Description
TRUEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10799 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx->flags & 2) != 0
(ctx->flags & 2) != 0Description
TRUEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10799 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
46-10799
173 table = srpdata_bin2ascii;
executed 46 times by 1 test: table = srpdata_bin2ascii;
Executed by:
  • libcrypto.so.1.1
46
174 else-
175 table = data_bin2ascii;
executed 10799 times by 1 test: table = data_bin2ascii;
Executed by:
  • libcrypto.so.1.1
10799
176-
177 for (i = dlen; i > 0
i > 0Description
TRUEevaluated 171032 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10845 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i -= 3) {
10845-171032
178 if (i >= 3
i >= 3Description
TRUEevaluated 170741 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 291 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
291-170741
179 l = (((unsigned long)f[0]) << 16L) |-
180 (((unsigned long)f[1]) << 8L) | f[2];-
181 *(t++) = ((table)[(l >> 18L)&0x3f]);-
182 *(t++) = ((table)[(l >> 12L)&0x3f]);-
183 *(t++) = ((table)[(l >> 6L)&0x3f]);-
184 *(t++) = ((table)[(l)&0x3f]);-
185 }
executed 170741 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
170741
186 l = ((unsigned long)f[0]) << 16L;-
187 if (i == 2
i == 2Description
TRUEevaluated 43 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 248 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
43-248
188 l |= ((unsigned long)f[1] << 8L);
executed 43 times by 1 test: l |= ((unsigned long)f[1] << 8L);
Executed by:
  • libcrypto.so.1.1
43
189-
190 *(t++) = ((table)[(l >> 18L)&0x3f]);-
191 *(t++) = ((table)[(l >> 12L)&0x3f]);-
192 *(t++) = (
(i == 1)Description
TRUEevaluated 248 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 43 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i == 1)
(i == 1)Description
TRUEevaluated 248 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 43 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? '=' : ((table)[(l >> 6L)&0x3f]);
43-248
193 *(t++) = '=';-
194 }
executed 291 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
291
195 ret += 4;-
196 f += 3;-
197 }
executed 171032 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
171032
198-
199 *t = '\0';-
200 return
executed 10845 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 10845 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
10845
201}-
202-
203int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen)-
204{-
205 return
never executed: return evp_encodeblock_int( ((void *)0) , t, f, dlen);
evp_encodeblock_int(
never executed: return evp_encodeblock_int( ((void *)0) , t, f, dlen);
0
206 ((void *)0)
never executed: return evp_encodeblock_int( ((void *)0) , t, f, dlen);
0
207 , t, f, dlen);
never executed: return evp_encodeblock_int( ((void *)0) , t, f, dlen);
0
208}-
209-
210void EVP_DecodeInit(EVP_ENCODE_CTX *ctx)-
211{-
212-
213 ctx->num = 0;-
214 ctx->length = 0;-
215 ctx->line_num = 0;-
216 ctx->flags = 0;-
217}
executed 18641 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
18641
218int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,-
219 const unsigned char *in, int inl)-
220{-
221 int seof = 0, eof = 0, rv = -1, ret = 0, i, v, tmp, n, decoded_len;-
222 unsigned char *d;-
223 const unsigned char *table;-
224-
225 n = ctx->num;-
226 d = ctx->enc_data;-
227-
228 if (n > 0
n > 0Description
TRUEevaluated 287 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18656 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& d[n - 1] == '='
d[n - 1] == '='Description
TRUEnever evaluated
FALSEevaluated 287 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-18656
229 eof++;-
230 if (n > 1
n > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& d[n - 2] == '='
d[n - 2] == '='Description
TRUEnever evaluated
FALSEnever evaluated
)
0
231 eof++;
never executed: eof++;
0
232 }
never executed: end of block
0
233-
234-
235 if (inl == 0
inl == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18941 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-18941
236 rv = 0;-
237 goto
executed 2 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
end;
executed 2 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
2
238 }-
239-
240 if ((
(ctx->flags & 2) != 0Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18925 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx->flags & 2) != 0
(ctx->flags & 2) != 0Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18925 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
16-18925
241 table = srpdata_ascii2bin;
executed 16 times by 1 test: table = srpdata_ascii2bin;
Executed by:
  • libcrypto.so.1.1
16
242 else-
243 table = data_ascii2bin;
executed 18925 times by 1 test: table = data_ascii2bin;
Executed by:
  • libcrypto.so.1.1
18925
244-
245 for (i = 0; i < inl
i < inlDescription
TRUEevaluated 16252417 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18917 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
18917-16252417
246 tmp = *(in++);-
247 v = conv_ascii2bin(tmp, table);-
248 if (v == 0xFF
v == 0xFFDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16252411 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
6-16252411
249 rv = -1;-
250 goto
executed 6 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
end;
executed 6 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
6
251 }-
252-
253 if (tmp == '='
tmp == '='Description
TRUEevaluated 23615 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16228796 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
23615-16228796
254 eof++;-
255 }
executed 23615 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (eof > 0
eof > 0Description
TRUEevaluated 13315 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16215481 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(!(((v)|0x13) == 0xF3))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
!(((v)|0x13) == 0xF3))
(!(((v)|0x13) == 0xF3))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13311 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4-16215481
256-
257 rv = -1;-
258 goto
executed 4 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
end;
executed 4 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
4
259 }-
260-
261 if (eof > 2
eof > 2Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16252397 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
10-16252397
262 rv = -1;-
263 goto
executed 10 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
end;
executed 10 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
10
264 }-
265-
266 if (v == 0xF2
v == 0xF2Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16252393 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4-16252393
267 seof = 1;-
268 goto
executed 4 times by 1 test: goto tail;
Executed by:
  • libcrypto.so.1.1
tail;
executed 4 times by 1 test: goto tail;
Executed by:
  • libcrypto.so.1.1
4
269 }-
270-
271-
272 if ((
(!(((v)|0x13) == 0xF3))Description
TRUEevaluated 15991495 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 260898 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
!(((v)|0x13) == 0xF3))
(!(((v)|0x13) == 0xF3))Description
TRUEevaluated 15991495 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 260898 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
260898-15991495
273 if (n >= 64
n >= 64Description
TRUEnever evaluated
FALSEevaluated 15991495 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-15991495
274-
275-
276-
277-
278-
279 rv = -1;-
280 goto
never executed: goto end;
end;
never executed: goto end;
0
281 }-
282 (void)((n < (int)sizeof(ctx->enc_data)) ? 0 : (OPENSSL_die("assertion failed: " "n < (int)sizeof(ctx->enc_data)", __FILE__, 367), 1));-
283 d[n++] = tmp;-
284 }
executed 15991495 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
15991495
285-
286 if (n == 64
n == 64Description
TRUEevaluated 239986 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16012407 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
239986-16012407
287 decoded_len = evp_decodeblock_int(ctx, out, d, n);-
288 n = 0;-
289 if (decoded_len < 0
decoded_len < 0Description
TRUEnever evaluated
FALSEevaluated 239986 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| eof > decoded_len
eof > decoded_lenDescription
TRUEnever evaluated
FALSEevaluated 239986 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-239986
290 rv = -1;-
291 goto
never executed: goto end;
end;
never executed: goto end;
0
292 }-
293 ret += decoded_len - eof;-
294 out += decoded_len - eof;-
295 }
executed 239986 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
239986
296 }
executed 16252393 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
16252393
297-
298-
299-
300-
301-
302-
303tail:
code before this statement executed 18917 times by 1 test: tail:
Executed by:
  • libcrypto.so.1.1
18917
304 if (n > 0
n > 0Description
TRUEevaluated 18502 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 419 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
419-18502
305 if ((
(n & 3) == 0Description
TRUEevaluated 18203 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 299 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
n & 3) == 0
(n & 3) == 0Description
TRUEevaluated 18203 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 299 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
299-18203
306 decoded_len = evp_decodeblock_int(ctx, out, d, n);-
307 n = 0;-
308 if (decoded_len < 0
decoded_len < 0Description
TRUEnever evaluated
FALSEevaluated 18203 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| eof > decoded_len
eof > decoded_lenDescription
TRUEnever evaluated
FALSEevaluated 18203 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-18203
309 rv = -1;-
310 goto
never executed: goto end;
end;
never executed: goto end;
0
311 }-
312 ret += (decoded_len - eof);-
313 }
executed 18203 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (seof
seofDescription
TRUEnever evaluated
FALSEevaluated 299 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-18203
314-
315 rv = -1;-
316 goto
never executed: goto end;
end;
never executed: goto end;
0
317 }-
318 }
executed 18502 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
18502
319-
320 rv = seof
seofDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18917 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (n == 0
n == 0Description
TRUEevaluated 18618 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 299 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& eof
eofDescription
TRUEevaluated 13279 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5339 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) ? 0 : 1;
4-18917
321end:
code before this statement executed 18921 times by 1 test: end:
Executed by:
  • libcrypto.so.1.1
18921
322-
323 *outl = ret;-
324 ctx->num = n;-
325 return
executed 18943 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
rv;
executed 18943 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
18943
326}-
327-
328static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,-
329 const unsigned char *f, int n)-
330{-
331 int i, ret = 0, a, b, c, d;-
332 unsigned long l;-
333 const unsigned char *table;-
334-
335 if (ctx !=
ctx != ((void *)0)Description
TRUEevaluated 258201 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14701 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
14701-258201
336 ((void *)0)
ctx != ((void *)0)Description
TRUEevaluated 258201 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14701 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
14701-258201
337 && (
(ctx->flags & 2) != 0Description
TRUEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 258109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx->flags & 2) != 0
(ctx->flags & 2) != 0Description
TRUEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 258109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
92-258109
338 table = srpdata_ascii2bin;
executed 92 times by 1 test: table = srpdata_ascii2bin;
Executed by:
  • libcrypto.so.1.1
92
339 else-
340 table = data_ascii2bin;
executed 272810 times by 1 test: table = data_ascii2bin;
Executed by:
  • libcrypto.so.1.1
272810
341-
342-
343 while ((
(conv_ascii2bi...able) == 0xE0)Description
TRUEnever evaluated
FALSEevaluated 272902 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
conv_ascii2bin(*f, table) == 0xE0)
(conv_ascii2bi...able) == 0xE0)Description
TRUEnever evaluated
FALSEevaluated 272902 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(n > 0)Description
TRUEnever evaluated
FALSEnever evaluated
n > 0)
(n > 0)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-272902
344 f++;-
345 n--;-
346 }
never executed: end of block
0
347-
348-
349-
350-
351-
352 while ((
(n > 3)Description
TRUEevaluated 272897 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
n > 3)
(n > 3)Description
TRUEevaluated 272897 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& ((((
((((conv_ascii...x13) == 0xF3))Description
TRUEnever evaluated
FALSEevaluated 272897 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
conv_ascii2bin(f[n - 1], table))|0x13) == 0xF3))
((((conv_ascii...x13) == 0xF3))Description
TRUEnever evaluated
FALSEevaluated 272897 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-272897
353 n--;
never executed: n--;
0
354-
355 if (n % 4 != 0
n % 4 != 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 272890 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
12-272890
356 return
executed 12 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 12 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
12
357-
358 for (i = 0; i < n
i < nDescription
TRUEevaluated 4562859 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 272889 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i += 4) {
272889-4562859
359 a = conv_ascii2bin(*(f++), table);-
360 b = conv_ascii2bin(*(f++), table);-
361 c = conv_ascii2bin(*(f++), table);-
362 d = conv_ascii2bin(*(f++), table);-
363 if ((
(a & 0x80)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4562858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a & 0x80)
(a & 0x80)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4562858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(b & 0x80)Description
TRUEnever evaluated
FALSEevaluated 4562858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
b & 0x80)
(b & 0x80)Description
TRUEnever evaluated
FALSEevaluated 4562858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(c & 0x80)Description
TRUEnever evaluated
FALSEevaluated 4562858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
c & 0x80)
(c & 0x80)Description
TRUEnever evaluated
FALSEevaluated 4562858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(d & 0x80)Description
TRUEnever evaluated
FALSEevaluated 4562858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
d & 0x80)
(d & 0x80)Description
TRUEnever evaluated
FALSEevaluated 4562858 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4562858
364 return
executed 1 time by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 1 time by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
1
365 l = ((((unsigned long)a) << 18L) |-
366 (((unsigned long)b) << 12L) |-
367 (((unsigned long)c) << 6L) | (((unsigned long)d)));-
368 *(t++) = (unsigned char)(l >> 16L) & 0xff;-
369 *(t++) = (unsigned char)(l >> 8L) & 0xff;-
370 *(t++) = (unsigned char)(l) & 0xff;-
371 ret += 3;-
372 }
executed 4562858 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4562858
373 return
executed 272889 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 272889 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
272889
374}-
375-
376int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n)-
377{-
378 return
executed 14701 times by 1 test: return evp_decodeblock_int( ((void *)0) , t, f, n);
Executed by:
  • libcrypto.so.1.1
evp_decodeblock_int(
executed 14701 times by 1 test: return evp_decodeblock_int( ((void *)0) , t, f, n);
Executed by:
  • libcrypto.so.1.1
14701
379 ((void *)0)
executed 14701 times by 1 test: return evp_decodeblock_int( ((void *)0) , t, f, n);
Executed by:
  • libcrypto.so.1.1
14701
380 , t, f, n);
executed 14701 times by 1 test: return evp_decodeblock_int( ((void *)0) , t, f, n);
Executed by:
  • libcrypto.so.1.1
14701
381}-
382-
383int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)-
384{-
385 int i;-
386-
387 *outl = 0;-
388 if (ctx->num != 0
ctx->num != 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18261 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
12-18261
389 i = evp_decodeblock_int(ctx, out, ctx->enc_data, ctx->num);-
390 if (i < 0
i < 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-12
391 return
executed 12 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 12 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
12
392 ctx->num = 0;-
393 *outl = i;-
394 return
never executed: return 1;
1;
never executed: return 1;
0
395 } else-
396 return
executed 18261 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 18261 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
18261
397}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2