OpenCoverage

bio_enc.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/evp/bio_enc.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3static int enc_write(BIO *h, const char *buf, int num);-
4static int enc_read(BIO *h, char *buf, int size);-
5-
6-
7static long enc_ctrl(BIO *h, int cmd, long arg1, void *arg2);-
8static int enc_new(BIO *h);-
9static int enc_free(BIO *data);-
10static long enc_callback_ctrl(BIO *h, int cmd, bio_info_cb *fps);-
11-
12-
13-
14typedef struct enc_struct {-
15 int buf_len;-
16 int buf_off;-
17 int cont;-
18 int finished;-
19 int ok;-
20 EVP_CIPHER_CTX cipher;-
21-
22-
23-
24 char buf[(1024*4) + (32*2) + 2];-
25} BIO_ENC_CTX;-
26-
27static const BIO_METHOD methods_enc = {-
28 .type = (10|0x0200),-
29 .name = "cipher",-
30 .bwrite = enc_write,-
31 .bread = enc_read,-
32 .ctrl = enc_ctrl,-
33 .create = enc_new,-
34 .destroy = enc_free,-
35 .callback_ctrl = enc_callback_ctrl-
36};-
37-
38const BIO_METHOD *-
39BIO_f_cipher(void)-
40{-
41 return
executed 198 times by 2 tests: return (&methods_enc);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
(&methods_enc);
executed 198 times by 2 tests: return (&methods_enc);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
198
42}-
43-
44static int-
45enc_new(BIO *bi)-
46{-
47 BIO_ENC_CTX *ctx;-
48-
49 ctx = malloc(sizeof(BIO_ENC_CTX));-
50 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 198 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
0-198
51 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 198 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
0-198
52 )-
53 return
never executed: return (0);
(0);
never executed: return (0);
0
54 EVP_CIPHER_CTX_init(&ctx->cipher);-
55-
56 ctx->buf_len = 0;-
57 ctx->buf_off = 0;-
58 ctx->cont = 1;-
59 ctx->finished = 0;-
60 ctx->ok = 1;-
61-
62 bi->init = 0;-
63 bi->ptr = (char *)ctx;-
64 bi->flags = 0;-
65 return
executed 198 times by 2 tests: return (1);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
(1);
executed 198 times by 2 tests: return (1);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
198
66}-
67-
68static int-
69enc_free(BIO *a)-
70{-
71 BIO_ENC_CTX *b;-
72-
73 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 198 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
0-198
74 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 198 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
0-198
75 )-
76 return
never executed: return (0);
(0);
never executed: return (0);
0
77 b = (BIO_ENC_CTX *)a->ptr;-
78 EVP_CIPHER_CTX_cleanup(&(b->cipher));-
79 freezero(a->ptr, sizeof(BIO_ENC_CTX));-
80 a->ptr = -
81 ((void *)0)-
82 ;-
83 a->init = 0;-
84 a->flags = 0;-
85 return
executed 198 times by 2 tests: return (1);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
(1);
executed 198 times by 2 tests: return (1);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
198
86}-
87-
88static int-
89enc_read(BIO *b, char *out, int outl)-
90{-
91 int ret = 0, i;-
92 BIO_ENC_CTX *ctx;-
93-
94 if (out ==
out == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
0-2
95 ((void *)0)
out == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
0-2
96 )-
97 return
never executed: return (0);
(0);
never executed: return (0);
0
98 ctx = (BIO_ENC_CTX *)b->ptr;-
99-
100 if ((
(ctx == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
ctx ==
(ctx == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
0-2
101 ((void *)0)
(ctx == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
0-2
102 )
(ctx == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
|| (
(b->next_bio == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
b->next_bio ==
(b->next_bio == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
0-2
103 ((void *)0)
(b->next_bio == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
0-2
104 )
(b->next_bio == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
)
0-2
105 return
never executed: return (0);
(0);
never executed: return (0);
0
106-
107-
108 if (ctx->buf_len > 0
ctx->buf_len > 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
) {
1
109 i = ctx->buf_len - ctx->buf_off;-
110 if (i > outl
i > outlDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
)
0-1
111 i = outl;
never executed: i = outl;
0
112 memcpy(out, &(ctx->buf[ctx->buf_off]), i);-
113 ret = i;-
114 out += i;-
115 outl -= i;-
116 ctx->buf_off += i;-
117 if (ctx->buf_len == ctx->buf_off
ctx->buf_len == ctx->buf_offDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
FALSEnever evaluated
) {
0-1
118 ctx->buf_len = 0;-
119 ctx->buf_off = 0;-
120 }
executed 1 time by 1 test: end of block
Executed by:
  • pkcs7test
1
121 }
executed 1 time by 1 test: end of block
Executed by:
  • pkcs7test
1
122-
123-
124-
125-
126 while (outl > 0
outl > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • pkcs7test
FALSEnever evaluated
) {
0-4
127 if (ctx->cont <= 0
ctx->cont <= 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
)
2
128 break;
executed 2 times by 1 test: break;
Executed by:
  • pkcs7test
2
129-
130-
131-
132 i = BIO_read(b->next_bio, &(ctx->buf[(32*2)]), (1024*4));-
133-
134 if (i <= 0
i <= 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
) {
1
135-
136 if (!BIO_test_flags(b->next_bio, 0x08)
!BIO_test_flag...ext_bio, 0x08)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
FALSEnever evaluated
) {
0-1
137 ctx->cont = i;-
138 i = EVP_CipherFinal_ex(&(ctx->cipher),-
139 (unsigned char *)ctx->buf,-
140 &(ctx->buf_len));-
141 ctx->ok = i;-
142 ctx->buf_off = 0;-
143 }
executed 1 time by 1 test: end of block
Executed by:
  • pkcs7test
else {
1
144 ret = (
(ret == 0)Description
TRUEnever evaluated
FALSEnever evaluated
ret == 0)
(ret == 0)Description
TRUEnever evaluated
FALSEnever evaluated
? i : ret;
0
145 break;
never executed: break;
0
146 }-
147 } else {-
148 EVP_CipherUpdate(&(ctx->cipher),-
149 (unsigned char *)ctx->buf, &ctx->buf_len,-
150 (unsigned char *)&(ctx->buf[(32*2)]), i);-
151 ctx->cont = 1;-
152-
153-
154-
155-
156-
157-
158 if (ctx->buf_len == 0
ctx->buf_len == 0Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
)
0-1
159 continue;
never executed: continue;
0
160 }
executed 1 time by 1 test: end of block
Executed by:
  • pkcs7test
1
161-
162 if (ctx->buf_len <= outl
ctx->buf_len <= outlDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
FALSEnever evaluated
)
0-2
163 i = ctx->buf_len;
executed 2 times by 1 test: i = ctx->buf_len;
Executed by:
  • pkcs7test
2
164 else-
165 i = outl;
never executed: i = outl;
0
166 if (i <= 0
i <= 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pkcs7test
)
0-2
167 break;
never executed: break;
0
168 memcpy(out, ctx->buf, i);-
169 ret += i;-
170 ctx->buf_off = i;-
171 outl -= i;-
172 out += i;-
173 }
executed 2 times by 1 test: end of block
Executed by:
  • pkcs7test
2
174-
175 BIO_clear_flags(b, ((0x01|0x02|0x04)|0x08));-
176 BIO_copy_next_retry(b);-
177 return
executed 2 times by 1 test: return ((ret == 0) ? ctx->cont : ret);
Executed by:
  • pkcs7test
((
(ret == 0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
ret == 0)
(ret == 0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • pkcs7test
? ctx->cont : ret);
executed 2 times by 1 test: return ((ret == 0) ? ctx->cont : ret);
Executed by:
  • pkcs7test
1-2
178}-
179-
180static int-
181enc_write(BIO *b, const char *in, int inl)-
182{-
183 int ret = 0, n, i;-
184 BIO_ENC_CTX *ctx;-
185-
186 ctx = (BIO_ENC_CTX *)b->ptr;-
187 ret = inl;-
188-
189 BIO_clear_flags(b, ((0x01|0x02|0x04)|0x08));-
190 n = ctx->buf_len - ctx->buf_off;-
191 while (n > 0
n > 0Description
TRUEevaluated 57 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
FALSEevaluated 254 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
) {
57-254
192 i = BIO_write(b->next_bio, &(ctx->buf[ctx->buf_off]), n);-
193 if (i <= 0
i <= 0Description
TRUEnever evaluated
FALSEevaluated 57 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
) {
0-57
194 BIO_copy_next_retry(b);-
195 return
never executed: return (i);
(i);
never executed: return (i);
0
196 }-
197 ctx->buf_off += i;-
198 n -= i;-
199 }
executed 57 times by 2 tests: end of block
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
57
200-
201-
202 if ((
(in == ((void *)0) )Description
TRUEevaluated 57 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
in ==
(in == ((void *)0) )Description
TRUEevaluated 57 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
57-197
203 ((void *)0)
(in == ((void *)0) )Description
TRUEevaluated 57 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
57-197
204 )
(in == ((void *)0) )Description
TRUEevaluated 57 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
|| (
(inl <= 0)Description
TRUEnever evaluated
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
inl <= 0)
(inl <= 0)Description
TRUEnever evaluated
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
)
0-197
205 return
executed 57 times by 2 tests: return (0);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
(0);
executed 57 times by 2 tests: return (0);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
57
206-
207 ctx->buf_off = 0;-
208 while (inl > 0
inl > 0Description
TRUEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
) {
197
209 n = (
(inl > (1024*4))Description
TRUEnever evaluated
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
inl > (1024*4))
(inl > (1024*4))Description
TRUEnever evaluated
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
? (1024*4) : inl;
0-197
210 EVP_CipherUpdate(&(ctx->cipher),-
211 (unsigned char *)ctx->buf, &ctx->buf_len,-
212 (unsigned char *)in, n);-
213 inl -= n;-
214 in += n;-
215-
216 ctx->buf_off = 0;-
217 n = ctx->buf_len;-
218 while (n > 0
n > 0Description
TRUEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
) {
197
219 i = BIO_write(b->next_bio, &(ctx->buf[ctx->buf_off]), n);-
220 if (i <= 0
i <= 0Description
TRUEnever evaluated
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
) {
0-197
221 BIO_copy_next_retry(b);-
222 return
never executed: return (ret == inl) ? i : ret - inl;
(
(ret == inl)Description
TRUEnever evaluated
FALSEnever evaluated
ret == inl)
(ret == inl)Description
TRUEnever evaluated
FALSEnever evaluated
? i : ret - inl;
never executed: return (ret == inl) ? i : ret - inl;
0
223 }-
224 n -= i;-
225 ctx->buf_off += i;-
226 }
executed 197 times by 2 tests: end of block
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
197
227 ctx->buf_len = 0;-
228 ctx->buf_off = 0;-
229 }
executed 197 times by 2 tests: end of block
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
197
230 BIO_copy_next_retry(b);-
231 return
executed 197 times by 2 tests: return (ret);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
(ret);
executed 197 times by 2 tests: return (ret);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
197
232}-
233-
234static long-
235enc_ctrl(BIO *b, int cmd, long num, void *ptr)-
236{-
237 BIO *dbio;-
238 BIO_ENC_CTX *ctx, *dctx;-
239 long ret = 1;-
240 int i;-
241 EVP_CIPHER_CTX **c_ctx;-
242-
243 ctx = (BIO_ENC_CTX *)b->ptr;-
244-
245 switch (cmd) {-
246 case
never executed: case 1:
1:
never executed: case 1:
0
247 ctx->ok = 1;-
248 ctx->finished = 0;-
249 EVP_CipherInit_ex(&(ctx->cipher), -
250 ((void *)0)-
251 , -
252 ((void *)0)-
253 , -
254 ((void *)0)-
255 , -
256 ((void *)0)-
257 ,-
258 ctx->cipher.encrypt);-
259 ret = BIO_ctrl(b->next_bio, cmd, num, ptr);-
260 break;
never executed: break;
0
261 case
never executed: case 2:
2:
never executed: case 2:
0
262 if (ctx->cont <= 0
ctx->cont <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
263 ret = 1;
never executed: ret = 1;
0
264 else-
265 ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
never executed: ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
0
266 break;
never executed: break;
0
267 case
never executed: case 13:
13:
never executed: case 13:
0
268 ret = ctx->buf_len - ctx->buf_off;-
269 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
270 ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
never executed: ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
0
271 break;
never executed: break;
0
272 case
never executed: case 10:
10:
never executed: case 10:
0
273 ret = ctx->buf_len - ctx->buf_off;-
274 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
275 ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
never executed: ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
0
276 break;
never executed: break;
0
277 case
executed 198 times by 2 tests: case 11:
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
11:
executed 198 times by 2 tests: case 11:
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
198
278-
279again:-
280 while (ctx->buf_len != ctx->buf_off
ctx->buf_len != ctx->buf_offDescription
TRUEevaluated 57 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
FALSEevaluated 395 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
) {
57-395
281 i = enc_write(b, -
282 ((void *)0)-
283 , 0);-
284 if (i < 0
i < 0Description
TRUEnever evaluated
FALSEevaluated 57 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
)
0-57
285 return
never executed: return i;
i;
never executed: return i;
0
286 }
executed 57 times by 2 tests: end of block
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
57
287-
288 if (!ctx->finished
!ctx->finishedDescription
TRUEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
FALSEevaluated 198 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
) {
197-198
289 ctx->finished = 1;-
290 ctx->buf_off = 0;-
291 ret = EVP_CipherFinal_ex(&(ctx->cipher),-
292 (unsigned char *)ctx->buf,-
293 &(ctx->buf_len));-
294 ctx->ok = (int)ret;-
295 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • pkcs7test
)
0-197
296 break;
never executed: break;
0
297-
298-
299 goto
executed 197 times by 2 tests: goto again;
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
again;
executed 197 times by 2 tests: goto again;
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
197
300 }-
301-
302-
303 ret = BIO_ctrl(b->next_bio, cmd, num, ptr);-
304 break;
executed 198 times by 2 tests: break;
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
198
305 case
executed 1 time by 1 test: case 113:
Executed by:
  • pkcs7test
113:
executed 1 time by 1 test: case 113:
Executed by:
  • pkcs7test
1
306 ret = (long)ctx->ok;-
307 break;
executed 1 time by 1 test: break;
Executed by:
  • pkcs7test
1
308 case
never executed: case 101:
101:
never executed: case 101:
0
309 BIO_clear_flags(b, ((0x01|0x02|0x04)|0x08));-
310 ret = BIO_ctrl(b->next_bio, cmd, num, ptr);-
311 BIO_copy_next_retry(b);-
312 break;
never executed: break;
0
313 case
executed 198 times by 2 tests: case 129:
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
129:
executed 198 times by 2 tests: case 129:
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
198
314 c_ctx = (EVP_CIPHER_CTX **)ptr;-
315 (*c_ctx) = &(ctx->cipher);-
316 b->init = 1;-
317 break;
executed 198 times by 2 tests: break;
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
198
318 case
never executed: case 12:
12:
never executed: case 12:
0
319 dbio = (BIO *)ptr;-
320 dctx = (BIO_ENC_CTX *)dbio->ptr;-
321 EVP_CIPHER_CTX_init(&dctx->cipher);-
322 ret = EVP_CIPHER_CTX_copy(&dctx->cipher, &ctx->cipher);-
323 if (ret
retDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
324 dbio->init = 1;
never executed: dbio->init = 1;
0
325 break;
never executed: break;
0
326 default
executed 200 times by 2 tests: default:
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
:
executed 200 times by 2 tests: default:
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
200
327 ret = BIO_ctrl(b->next_bio, cmd, num, ptr);-
328 break;
executed 200 times by 2 tests: break;
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
200
329 }-
330 return
executed 597 times by 2 tests: return (ret);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
(ret);
executed 597 times by 2 tests: return (ret);
Executed by:
  • libcrypto.so.44.0.1
  • pkcs7test
597
331}-
332-
333static long-
334enc_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)-
335{-
336 long ret = 1;-
337-
338 if (b->next_bio ==
b->next_bio == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
339 ((void *)0)
b->next_bio == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
340 )-
341 return
never executed: return (0);
(0);
never executed: return (0);
0
342 switch (cmd) {-
343 default
never executed: default:
:
never executed: default:
0
344 ret = BIO_callback_ctrl(b->next_bio, cmd, fp);-
345 break;
never executed: break;
0
346 }-
347 return
never executed: return (ret);
(ret);
never executed: return (ret);
0
348}-
349int-
350BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k,-
351 const unsigned char *i, int e)-
352{-
353 BIO_ENC_CTX *ctx;-
354 long (*cb)(BIO *, int, const char *, int, long, long);-
355-
356 if (b ==
b == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
357 ((void *)0)
b == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
358 )-
359 return
never executed: return 0;
0;
never executed: return 0;
0
360-
361 if ((
(ctx = BIO_get...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
ctx = BIO_get_data(b)) ==
(ctx = BIO_get...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
362 ((void *)0)
(ctx = BIO_get...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
363 )-
364 return
never executed: return 0;
0;
never executed: return 0;
0
365-
366 if ((
(cb = BIO_get_...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
cb = BIO_get_callback(b)) !=
(cb = BIO_get_...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
367 ((void *)0)
(cb = BIO_get_...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
368 ) {-
369 if (cb(b, 0x06, (const char *)c, 4, e, 0L)
cb(b, 0x06, (c...4, e, 0L) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
370 <= 0
cb(b, 0x06, (c...4, e, 0L) <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
371 return
never executed: return 0;
0;
never executed: return 0;
0
372 }
never executed: end of block
0
373-
374 BIO_set_init(b, 1);-
375-
376 if (!EVP_CipherInit_ex(&(ctx->cipher), c,
!EVP_CipherIni...)0) , k, i, e)Description
TRUEnever evaluated
FALSEnever evaluated
0
377 ((void *)0)
!EVP_CipherIni...)0) , k, i, e)Description
TRUEnever evaluated
FALSEnever evaluated
0
378 , k, i, e)
!EVP_CipherIni...)0) , k, i, e)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
379 return
never executed: return 0;
0;
never executed: return 0;
0
380-
381 if (cb !=
cb != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
382 ((void *)0)
cb != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
383 )-
384 return
never executed: return cb(b, 0x06, (const char *)c, 4, e, 1L);
cb(b, 0x06, (const char *)c, 4, e, 1L);
never executed: return cb(b, 0x06, (const char *)c, 4, e, 1L);
0
385-
386 return
never executed: return 1;
1;
never executed: return 1;
0
387}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2