OpenCoverage

encode.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/evp/encode.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2static const unsigned char data_bin2ascii[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";-
3static const unsigned char data_ascii2bin[128] = {-
4 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
5 0xFF, 0xE0, 0xF0, 0xFF, 0xFF, 0xF1, 0xFF, 0xFF,-
6 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
7 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
8 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
9 0xFF, 0xFF, 0xFF, 0x3E, 0xFF, 0xF2, 0xFF, 0x3F,-
10 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,-
11 0x3C, 0x3D, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF,-
12 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,-
13 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,-
14 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,-
15 0x17, 0x18, 0x19, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
16 0xFF, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,-
17 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,-
18 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,-
19 0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,-
20};-
21-
22void-
23EVP_EncodeInit(EVP_ENCODE_CTX *ctx)-
24{-
25 ctx->length = 48;-
26 ctx->num = 0;-
27 ctx->line_num = 0;-
28}
executed 117 times by 4 tests: end of block
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
117
29-
30int-
31EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,-
32 const unsigned char *in, int inl)-
33{-
34 int i, j;-
35 size_t total = 0;-
36-
37 *outl = 0;-
38 if (inl <= 0
inl <= 0Description
TRUEnever evaluated
FALSEevaluated 213 times by 4 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
)
0-213
39 return
never executed: return 0;
0;
never executed: return 0;
0
40 (void)((ctx->length <= (int)sizeof(ctx->enc_data)) ? 0 : (OpenSSLDie(__FILE__, 133, "ctx->length <= (int)sizeof(ctx->enc_data)"),1));-
41 if (ctx->length - ctx->num > inl
ctx->length - ctx->num > inlDescription
TRUEevaluated 127 times by 2 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
FALSEevaluated 86 times by 3 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
) {
86-127
42 memcpy(&(ctx->enc_data[ctx->num]), in, inl);-
43 ctx->num += inl;-
44 return
executed 127 times by 2 tests: return 1;
Executed by:
  • base64test
  • libcrypto.so.44.0.1
1;
executed 127 times by 2 tests: return 1;
Executed by:
  • base64test
  • libcrypto.so.44.0.1
127
45 }-
46 if (ctx->num != 0
ctx->num != 0Description
TRUEevaluated 71 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
FALSEevaluated 15 times by 3 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
) {
15-71
47 i = ctx->length - ctx->num;-
48 memcpy(&(ctx->enc_data[ctx->num]), in, i);-
49 in += i;-
50 inl -= i;-
51 j = EVP_EncodeBlock(out, ctx->enc_data, ctx->length);-
52 ctx->num = 0;-
53 out += j;-
54 *(out++) = '\n';-
55 *out = '\0';-
56 total = j + 1;-
57 }
executed 71 times by 1 test: end of block
Executed by:
  • libcrypto.so.44.0.1
71
58 while (inl >= ctx->length
inl >= ctx->lengthDescription
TRUEevaluated 1131 times by 3 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
FALSEevaluated 86 times by 3 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
&& total <= 0x7fffffff
total <= 0x7fffffffDescription
TRUEevaluated 1131 times by 3 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
FALSEnever evaluated
) {
0-1131
59 j = EVP_EncodeBlock(out, in, ctx->length);-
60 in += ctx->length;-
61 inl -= ctx->length;-
62 out += j;-
63 *(out++) = '\n';-
64 *out = '\0';-
65 total += j + 1;-
66 }
executed 1131 times by 3 tests: end of block
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
1131
67 if (total > 0x7fffffff
total > 0x7fffffffDescription
TRUEnever evaluated
FALSEevaluated 86 times by 3 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
) {
0-86
68-
69 *outl = 0;-
70 return
never executed: return 0;
0;
never executed: return 0;
0
71 }-
72 if (inl != 0
inl != 0Description
TRUEevaluated 64 times by 3 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
)
22-64
73 memcpy(&(ctx->enc_data[0]), in, inl);
executed 64 times by 3 tests: memcpy(&(ctx->enc_data[0]), in, inl);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
64
74 ctx->num = inl;-
75 *outl = total;-
76-
77 return
executed 86 times by 3 tests: return 1;
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
1;
executed 86 times by 3 tests: return 1;
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
86
78}-
79-
80void-
81EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)-
82{-
83 unsigned int ret = 0;-
84-
85 if (ctx->num != 0
ctx->num != 0Description
TRUEevaluated 71 times by 4 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
FALSEnever evaluated
) {
0-71
86 ret = EVP_EncodeBlock(out, ctx->enc_data, ctx->num);-
87 out[ret++] = '\n';-
88 out[ret] = '\0';-
89 ctx->num = 0;-
90 }
executed 71 times by 4 tests: end of block
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
71
91 *outl = ret;-
92}
executed 71 times by 4 tests: end of block
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
71
93-
94int-
95EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen)-
96{-
97 int i, ret = 0;-
98 unsigned long l;-
99-
100 for (i = dlen; i > 0
i > 0Description
TRUEevaluated 19828 times by 4 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
FALSEevaluated 1309 times by 4 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
; i -= 3) {
1309-19828
101 if (i >= 3
i >= 3Description
TRUEevaluated 19748 times by 4 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
FALSEevaluated 80 times by 4 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
) {
80-19748
102 l = (((unsigned long)f[0]) << 16L) |-
103 (((unsigned long)f[1]) << 8L) | f[2];-
104 *(t++) = (data_bin2ascii[(l >> 18L)&0x3f]);-
105 *(t++) = (data_bin2ascii[(l >> 12L)&0x3f]);-
106 *(t++) = (data_bin2ascii[(l >> 6L)&0x3f]);-
107 *(t++) = (data_bin2ascii[(l)&0x3f]);-
108 }
executed 19748 times by 4 tests: end of block
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
else {
19748
109 l = ((unsigned long)f[0]) << 16L;-
110 if (i == 2
i == 2Description
TRUEevaluated 17 times by 3 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
FALSEevaluated 63 times by 4 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
)
17-63
111 l |= ((unsigned long)f[1] << 8L);
executed 17 times by 3 tests: l |= ((unsigned long)f[1] << 8L);
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
17
112-
113 *(t++) = (data_bin2ascii[(l >> 18L)&0x3f]);-
114 *(t++) = (data_bin2ascii[(l >> 12L)&0x3f]);-
115 *(t++) = (
(i == 1)Description
TRUEevaluated 63 times by 4 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
FALSEevaluated 17 times by 3 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
i == 1)
(i == 1)Description
TRUEevaluated 63 times by 4 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
FALSEevaluated 17 times by 3 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
? '=' : (data_bin2ascii[(l >> 6L)&0x3f]);
17-63
116 *(t++) = '=';-
117 }
executed 80 times by 4 tests: end of block
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
80
118 ret += 4;-
119 f += 3;-
120 }
executed 19828 times by 4 tests: end of block
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
19828
121-
122 *t = '\0';-
123 return
executed 1309 times by 4 tests: return (ret);
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
(ret);
executed 1309 times by 4 tests: return (ret);
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • tlstest
1309
124}-
125-
126void-
127EVP_DecodeInit(EVP_ENCODE_CTX *ctx)-
128{-
129 ctx->length = 30;-
130 ctx->num = 0;-
131 ctx->line_num = 0;-
132 ctx->expect_nl = 0;-
133}
executed 519 times by 8 tests: end of block
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
519
134-
135-
136-
137-
138-
139int-
140EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,-
141 const unsigned char *in, int inl)-
142{-
143 int seof = -1, eof = 0, rv = -1, ret = 0, i, v, tmp, n, ln, exp_nl;-
144 unsigned char *d;-
145-
146 n = ctx->num;-
147 d = ctx->enc_data;-
148 ln = ctx->line_num;-
149 exp_nl = ctx->expect_nl;-
150-
151-
152 if ((
(inl == 0)Description
TRUEnever evaluated
FALSEevaluated 507 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
inl == 0)
(inl == 0)Description
TRUEnever evaluated
FALSEevaluated 507 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
|| ((
(n == 0)Description
TRUEevaluated 457 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
n == 0)
(n == 0)Description
TRUEevaluated 457 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
&& ((
((data_ascii2b...x7f]) == 0xF2)Description
TRUEnever evaluated
FALSEevaluated 457 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
data_ascii2bin[(in[0])&0x7f]) == 0xF2)
((data_ascii2b...x7f]) == 0xF2)Description
TRUEnever evaluated
FALSEevaluated 457 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
)) {
0-507
153 rv = 0;-
154 goto
never executed: goto end;
end;
never executed: goto end;
0
155 }-
156-
157-
158 for (i = 0; i < inl
i < inlDescription
TRUEevaluated 418999 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 180 times by 5 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • ssltest
  • tlstest
; i++) {
180-418999
159-
160 if (ln >= 80
ln >= 80Description
TRUEnever evaluated
FALSEevaluated 418999 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
0-418999
161 rv = -1;-
162 goto
never executed: goto end;
end;
never executed: goto end;
0
163 }-
164-
165-
166 tmp= *(in++);-
167 v = (data_ascii2bin[(tmp)&0x7f]);-
168-
169 if (!(((v)|0x13) == 0xF3)
!(((v)|0x13) == 0xF3)Description
TRUEevaluated 412290 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 6709 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
6709-412290
170 (void)((n < (int)sizeof(ctx->enc_data)) ? 0 : (OpenSSLDie(__FILE__, 263, "n < (int)sizeof(ctx->enc_data)"),1));-
171 d[n++] = tmp;-
172 ln++;-
173 }
executed 412290 times by 8 tests: end of block
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
else if (v == 0xFF
v == 0xFFDescription
TRUEnever evaluated
FALSEevaluated 6709 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
0-412290
174 rv = -1;-
175 goto
never executed: goto end;
end;
never executed: goto end;
0
176 }-
177-
178-
179 if (eof
eofDescription
TRUEevaluated 667 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 418332 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
&& tmp != '='
tmp != '='Description
TRUEevaluated 386 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 281 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
&& tmp != '\r'
tmp != '\r'Description
TRUEevaluated 328 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 58 times by 1 test
Evaluated by:
  • base64test
&& tmp != '\n'
tmp != '\n'Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 318 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
&&
10-418332
180 v != 0xF2
v != 0xF2Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • base64test
FALSEnever evaluated
) {
0-10
181 rv = -1;-
182 goto
executed 10 times by 1 test: goto end;
Executed by:
  • base64test
end;
executed 10 times by 1 test: goto end;
Executed by:
  • base64test
10
183 }-
184-
185-
186-
187-
188-
189 if (tmp == '='
tmp == '='Description
TRUEevaluated 612 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 418377 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
612-418377
190 if (seof == -1
seof == -1Description
TRUEevaluated 331 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 281 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
)
281-331
191 seof = n;
executed 331 times by 8 tests: seof = n;
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
331
192 eof++;-
193 }
executed 612 times by 8 tests: end of block
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
612
194-
195-
196 if (eof > 2
eof > 2Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 418981 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
8-418981
197 rv = -1;-
198 goto
executed 8 times by 1 test: goto end;
Executed by:
  • base64test
end;
executed 8 times by 1 test: goto end;
Executed by:
  • base64test
8
199 }-
200-
201 if (v == 0xF1
v == 0xF1Description
TRUEevaluated 85 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 418896 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
85-418896
202 ln = 0;-
203 if (exp_nl
exp_nlDescription
TRUEnever evaluated
FALSEevaluated 85 times by 1 test
Evaluated by:
  • base64test
)
0-85
204 continue;
never executed: continue;
0
205 }
executed 85 times by 1 test: end of block
Executed by:
  • base64test
85
206-
207-
208 if (v == 0xF0
v == 0xF0Description
TRUEevaluated 6624 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 412357 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
6624-412357
209 ln = 0;-
210 if (exp_nl
exp_nlDescription
TRUEevaluated 6247 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 377 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
377-6247
211 exp_nl = 0;-
212 continue;
executed 6247 times by 7 tests: continue;
Executed by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
6247
213 }-
214 }
executed 377 times by 8 tests: end of block
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
377
215 exp_nl = 0;-
216-
217-
218-
219 if (((
((i + 1) == inl)Description
TRUEevaluated 417 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 412317 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
i + 1) == inl)
((i + 1) == inl)Description
TRUEevaluated 417 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 412317 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
&& (((
((n&3) == 0)Description
TRUEevaluated 348 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 69 times by 2 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
n&3) == 0)
((n&3) == 0)Description
TRUEevaluated 348 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 69 times by 2 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
|| eof
eofDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 59 times by 2 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
)) {
10-412317
220 v = 0xF2;-
221-
222-
223-
224-
225 eof = 0;-
226 if (d[n-1] == '='
d[n-1] == '='Description
TRUEevaluated 313 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 45 times by 5 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • ssltest
  • tlstest
)
45-313
227 eof++;
executed 313 times by 8 tests: eof++;
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
313
228 if (d[n-2] == '='
d[n-2] == '='Description
TRUEevaluated 263 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 95 times by 5 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • ssltest
  • tlstest
)
95-263
229 eof++;
executed 263 times by 8 tests: eof++;
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
263
230-
231 }
executed 358 times by 8 tests: end of block
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
358
232-
233 if ((v == 0xF2
v == 0xF2Description
TRUEevaluated 358 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 412376 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
&& (
(n&3) == 0Description
TRUEevaluated 348 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 10 times by 1 test
Evaluated by:
  • base64test
n&3) == 0
(n&3) == 0Description
TRUEevaluated 348 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 10 times by 1 test
Evaluated by:
  • base64test
) || (
(n >= 64)Description
TRUEevaluated 6247 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 406139 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
n >= 64)
(n >= 64)Description
TRUEevaluated 6247 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 406139 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
10-412376
234-
235-
236-
237 if ((
(v != 0xF2)Description
TRUEevaluated 6247 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 348 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
v != 0xF2)
(v != 0xF2)Description
TRUEevaluated 6247 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 348 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
&& (
(n >= 64)Description
TRUEevaluated 6247 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEnever evaluated
n >= 64)
(n >= 64)Description
TRUEevaluated 6247 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEnever evaluated
)
0-6247
238 exp_nl = 1;
executed 6247 times by 7 tests: exp_nl = 1;
Executed by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
6247
239 if (n > 0
n > 0Description
TRUEevaluated 6591 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 4 times by 1 test
Evaluated by:
  • base64test
) {
4-6591
240 v = EVP_DecodeBlock(out, d, n);-
241 n = 0;-
242 if (v < 0
v < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 6589 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
2-6589
243 rv = 0;-
244 goto
executed 2 times by 1 test: goto end;
Executed by:
  • base64test
end;
executed 2 times by 1 test: goto end;
Executed by:
  • base64test
2
245 }-
246 ret += (v - eof);-
247 }
executed 6589 times by 8 tests: end of block
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
else {
6589
248 eof = 1;-
249 v = 0;-
250 }
executed 4 times by 1 test: end of block
Executed by:
  • base64test
4
251-
252-
253-
254 if ((
(v < ctx->length)Description
TRUEevaluated 344 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 6249 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
v < ctx->length)
(v < ctx->length)Description
TRUEevaluated 344 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 6249 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
&& eof
eofDescription
TRUEevaluated 305 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 39 times by 5 tests
Evaluated by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • ssltest
  • tlstest
) {
39-6249
255 rv = 0;-
256 goto
executed 305 times by 8 tests: goto end;
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
end;
executed 305 times by 8 tests: goto end;
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
305
257 } else-
258 ctx->length = v;
executed 6288 times by 8 tests: ctx->length = v;
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
6288
259-
260 if (seof >= 0
seof >= 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 6286 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
2-6286
261 rv = 0;-
262 goto
executed 2 times by 1 test: goto end;
Executed by:
  • base64test
end;
executed 2 times by 1 test: goto end;
Executed by:
  • base64test
2
263 }-
264 out += v;-
265 }
executed 6286 times by 8 tests: end of block
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
6286
266 }
executed 412425 times by 8 tests: end of block
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
412425
267 rv = 1;-
268-
269end:
code before this statement executed 180 times by 5 tests: end:
Executed by:
  • base64test
  • libcrypto.so.44.0.1
  • pkcs7test
  • ssltest
  • tlstest
180
270 *outl = ret;-
271 ctx->num = n;-
272 ctx->line_num = ln;-
273 ctx->expect_nl = exp_nl;-
274 return
executed 507 times by 8 tests: return (rv);
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
(rv);
executed 507 times by 8 tests: return (rv);
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
507
275}-
276-
277int-
278EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n)-
279{-
280 int i, ret = 0, a, b, c, d;-
281 unsigned long l;-
282-
283-
284 while (((
((data_ascii2b...x7f]) == 0xE0)Description
TRUEnever evaluated
FALSEevaluated 6651 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
data_ascii2bin[(*f)&0x7f]) == 0xE0)
((data_ascii2b...x7f]) == 0xE0)Description
TRUEnever evaluated
FALSEevaluated 6651 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
&& (
(n > 0)Description
TRUEnever evaluated
FALSEnever evaluated
n > 0)
(n > 0)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-6651
285 f++;-
286 n--;-
287 }
never executed: end of block
0
288-
289-
290-
291 while ((
(n > 3)Description
TRUEevaluated 6637 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 15 times by 1 test
Evaluated by:
  • base64test
n > 3)
(n > 3)Description
TRUEevaluated 6637 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 15 times by 1 test
Evaluated by:
  • base64test
&& (((((
(((((data_asci...x13) == 0xF3))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • base64test
FALSEevaluated 6636 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
data_ascii2bin[(f[n - 1])&0x7f]))|0x13) == 0xF3))
(((((data_asci...x13) == 0xF3))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • base64test
FALSEevaluated 6636 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
)
1-6637
292 n--;
executed 1 time by 1 test: n--;
Executed by:
  • base64test
1
293-
294 if (n % 4 != 0
n % 4 != 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • base64test
FALSEevaluated 6650 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
)
1-6650
295 return
executed 1 time by 1 test: return (-1);
Executed by:
  • base64test
(-1);
executed 1 time by 1 test: return (-1);
Executed by:
  • base64test
1
296-
297 for (i = 0; i < n
i < nDescription
TRUEevaluated 103124 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
FALSEevaluated 6641 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
; i += 4) {
6641-103124
298 a = (data_ascii2bin[(*(f++))&0x7f]);-
299 b = (data_ascii2bin[(*(f++))&0x7f]);-
300 c = (data_ascii2bin[(*(f++))&0x7f]);-
301 d = (data_ascii2bin[(*(f++))&0x7f]);-
302 if ((
(a & 0x80)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 103121 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
a & 0x80)
(a & 0x80)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 103121 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
|| (
(b & 0x80)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 103119 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
b & 0x80)
(b & 0x80)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 103119 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
||
2-103121
303 (
(c & 0x80)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • base64test
FALSEevaluated 103118 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
c & 0x80)
(c & 0x80)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • base64test
FALSEevaluated 103118 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
|| (
(d & 0x80)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 103115 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
d & 0x80)
(d & 0x80)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • base64test
FALSEevaluated 103115 times by 8 tests
Evaluated by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
)
1-103118
304 return
executed 9 times by 1 test: return (-1);
Executed by:
  • base64test
(-1);
executed 9 times by 1 test: return (-1);
Executed by:
  • base64test
9
305 l = ((((unsigned long)a) << 18L) |-
306 (((unsigned long)b) << 12L) |-
307 (((unsigned long)c) << 6L) |-
308 (((unsigned long)d)));-
309 *(t++) = (unsigned char)(l >> 16L) & 0xff;-
310 *(t++) = (unsigned char)(l >> 8L) & 0xff;-
311 *(t++) = (unsigned char)(l) & 0xff;-
312 ret += 3;-
313 }
executed 103115 times by 8 tests: end of block
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
103115
314 return
executed 6641 times by 8 tests: return (ret);
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
(ret);
executed 6641 times by 8 tests: return (ret);
Executed by:
  • asn1test
  • base64test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
6641
315}-
316-
317int-
318EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)-
319{-
320 int i;-
321-
322 *outl = 0;-
323 if (ctx->num != 0
ctx->num != 0Description
TRUEnever evaluated
FALSEevaluated 257 times by 7 tests
Evaluated by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
) {
0-257
324 i = EVP_DecodeBlock(out, ctx->enc_data, ctx->num);-
325 if (i < 0
i < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
326 return
never executed: return (-1);
(-1);
never executed: return (-1);
0
327 ctx->num = 0;-
328 *outl = i;-
329 return
never executed: return (1);
(1);
never executed: return (1);
0
330 } else-
331 return
executed 257 times by 7 tests: return (1);
Executed by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
(1);
executed 257 times by 7 tests: return (1);
Executed by:
  • asn1test
  • keypairtest
  • libcrypto.so.44.0.1
  • pkcs7test
  • servertest
  • ssltest
  • tlstest
257
332}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2