OpenCoverage

bss_file.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bio/bss_file.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5static int file_write(BIO *h, const char *buf, int num);-
6static int file_read(BIO *h, char *buf, int size);-
7static int file_puts(BIO *h, const char *str);-
8static int file_gets(BIO *h, char *str, int size);-
9static long file_ctrl(BIO *h, int cmd, long arg1, void *arg2);-
10static int file_new(BIO *h);-
11static int file_free(BIO *data);-
12static const BIO_METHOD methods_filep = {-
13 ( 2|0x0400),-
14 "FILE pointer",-
15-
16 bwrite_conv,-
17 file_write,-
18-
19 bread_conv,-
20 file_read,-
21 file_puts,-
22 file_gets,-
23 file_ctrl,-
24 file_new,-
25 file_free,-
26 -
27 ((void *)0)-
28 ,-
29};-
30-
31BIO *BIO_new_file(const char *filename, const char *mode)-
32{-
33 BIO *ret;-
34 FILE *file = openssl_fopen(filename, mode);-
35 int fp_flags = 0x01;-
36-
37 if (-
38 (
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__extension__ (__builtin_constant_p (
__builtin_constant_p ( 'b' )Description
TRUEevaluated 9803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9803
39 'b'
__builtin_constant_p ( 'b' )Description
TRUEevaluated 9803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9803
40 )
__builtin_constant_p ( 'b' )Description
TRUEevaluated 9803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& !__builtin_constant_p (
!__builtin_constant_p ( mode )Description
TRUEevaluated 9803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9803
41 mode
!__builtin_constant_p ( mode )Description
TRUEevaluated 9803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9803
42 )
!__builtin_constant_p ( mode )Description
TRUEevaluated 9803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
( 'b' ) == '\0'Description
TRUEnever evaluated
FALSEevaluated 9803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9803
43 'b'
( 'b' ) == '\0'Description
TRUEnever evaluated
FALSEevaluated 9803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9803
44 ) == '\0'
( 'b' ) == '\0'Description
TRUEnever evaluated
FALSEevaluated 9803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? (char *) __rawmemchr (
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9803
45 mode
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4705-5098
46 ,
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4705-5098
47 'b'
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4705-5098
48 ) : __builtin_strchr (
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4705-5098
49 mode
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4705-5098
50 ,
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4705-5098
51 'b'
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4705-5098
52 )))
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4705-5098
53 ==
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4705-5098
54 ((void *)0)
(__extension__...== ((void *)0)Description
TRUEevaluated 4705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5098 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4705-5098
55 )-
56 fp_flags |= 0x10;
executed 4705 times by 1 test: fp_flags |= 0x10;
Executed by:
  • libcrypto.so.1.1
4705
57-
58 if (file ==
file == ((void *)0)Description
TRUEevaluated 2540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7263 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2540-7263
59 ((void *)0)
file == ((void *)0)Description
TRUEevaluated 2540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7263 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2540-7263
60 ) {-
61 ERR_put_error(2,(1),(-
62 (*__errno_location ())-
63 ),__FILE__,72);-
64 ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");-
65 if (-
66 (*
(*__errno_location ()) == 2Description
TRUEevaluated 2539 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
__errno_location ())
(*__errno_location ()) == 2Description
TRUEevaluated 2539 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-2539
67 ==
(*__errno_location ()) == 2Description
TRUEevaluated 2539 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-2539
68 2
(*__errno_location ()) == 2Description
TRUEevaluated 2539 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-2539
69-
70 -
71 || -
72 (*
(*__errno_location ()) == 6Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
__errno_location ())
(*__errno_location ()) == 6Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
73 ==
(*__errno_location ()) == 6Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
74 6
(*__errno_location ()) == 6Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
75-
76 -
77 )-
78 ERR_put_error(32,(109),(128),__FILE__,79);
executed 2539 times by 1 test: ERR_put_error(32,(109),(128),__FILE__,79);
Executed by:
  • libcrypto.so.1.1
2539
79 else-
80 ERR_put_error(32,(109),(2),__FILE__,81);
executed 1 time by 1 test: ERR_put_error(32,(109),(2),__FILE__,81);
Executed by:
  • libcrypto.so.1.1
1
81 return
executed 2540 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 2540 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
2540
82 ((void *)0)
executed 2540 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
2540
83 ;
executed 2540 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
2540
84 }-
85 if ((
(ret = BIO_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7263 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret = BIO_new(BIO_s_file())) ==
(ret = BIO_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7263 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7263
86 ((void *)0)
(ret = BIO_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7263 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7263
87 ) {-
88 fclose(file);-
89 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
90 ((void *)0)
never executed: return ((void *)0) ;
0
91 ;
never executed: return ((void *)0) ;
0
92 }-
93-
94 BIO_clear_flags(ret, 0);-
95-
96 BIO_ctrl(ret,106,fp_flags,(char *)(file));-
97 return
executed 7263 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 7263 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
7263
98}-
99-
100BIO *BIO_new_fp(FILE *stream, int close_flag)-
101{-
102 BIO *ret;-
103-
104 if ((
(ret = BIO_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10202 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
ret = BIO_new(BIO_s_file())) ==
(ret = BIO_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10202 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
0-10202
105 ((void *)0)
(ret = BIO_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10202 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
0-10202
106 )-
107 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
108 ((void *)0)
never executed: return ((void *)0) ;
0
109 ;
never executed: return ((void *)0) ;
0
110-
111-
112 BIO_set_flags(ret, 0);-
113 BIO_ctrl(ret,106,close_flag,(char *)(stream));-
114 return
executed 10202 times by 12 tests: return ret;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
ret;
executed 10202 times by 12 tests: return ret;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
10202
115}-
116-
117const BIO_METHOD *BIO_s_file(void)-
118{-
119 return
executed 22400 times by 12 tests: return &methods_filep;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
&methods_filep;
executed 22400 times by 12 tests: return &methods_filep;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
22400
120}-
121-
122static int file_new(BIO *bi)-
123{-
124 bi->init = 0;-
125 bi->num = 0;-
126 bi->ptr = -
127 ((void *)0)-
128 ;-
129 bi->flags = 0;-
130 return
executed 22400 times by 12 tests: return 1;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
1;
executed 22400 times by 12 tests: return 1;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
22400
131}-
132-
133static int file_free(BIO *a)-
134{-
135 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 44800 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
0-44800
136 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 44800 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
0-44800
137 )-
138 return
never executed: return 0;
0;
never executed: return 0;
0
139 if (a->shutdown
a->shutdownDescription
TRUEevaluated 34660 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEevaluated 10140 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
) {
10140-34660
140 if ((
(a->init)Description
TRUEevaluated 12260 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 22400 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
a->init)
(a->init)Description
TRUEevaluated 12260 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 22400 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
&& (
(a->ptr != ((void *)0) )Description
TRUEevaluated 12260 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
a->ptr !=
(a->ptr != ((void *)0) )Description
TRUEevaluated 12260 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-22400
141 ((void *)0)
(a->ptr != ((void *)0) )Description
TRUEevaluated 12260 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-12260
142 )
(a->ptr != ((void *)0) )Description
TRUEevaluated 12260 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-12260
143 if (a->flags & 0
a->flags & 0Description
TRUEnever evaluated
FALSEevaluated 12260 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-12260
144 fclose(a->ptr);
never executed: fclose(a->ptr);
0
145 else-
146 fclose(a->ptr);
executed 12260 times by 1 test: fclose(a->ptr);
Executed by:
  • libcrypto.so.1.1
12260
147 a->ptr = -
148 ((void *)0)-
149 ;-
150 a->flags = 0;-
151 }
executed 12260 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
12260
152 a->init = 0;-
153 }
executed 34660 times by 12 tests: end of block
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
34660
154 return
executed 44800 times by 12 tests: return 1;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
1;
executed 44800 times by 12 tests: return 1;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
44800
155}-
156-
157static int file_read(BIO *b, char *out, int outl)-
158{-
159 int ret = 0;-
160-
161 if (b->init
b->initDescription
TRUEevaluated 7006 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(out != ((void *)0) )Description
TRUEevaluated 7006 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
out !=
(out != ((void *)0) )Description
TRUEevaluated 7006 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-7006
162 ((void *)0)
(out != ((void *)0) )Description
TRUEevaluated 7006 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-7006
163 )
(out != ((void *)0) )Description
TRUEevaluated 7006 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-7006
164 if (b->flags & 0
b->flags & 0Description
TRUEnever evaluated
FALSEevaluated 7006 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-7006
165 ret = fread(out, 1, (int)outl, b->ptr);
never executed: ret = fread(out, 1, (int)outl, b->ptr);
0
166 else-
167 ret = fread(out, 1, (int)outl, (FILE *)b->ptr);
executed 7006 times by 1 test: ret = fread(out, 1, (int)outl, (FILE *)b->ptr);
Executed by:
  • libcrypto.so.1.1
7006
168 if (ret == 0
ret == 0Description
TRUEevaluated 767 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6239 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret == 0 && (b...FILE *)b->ptr)Description
TRUEnever evaluated
FALSEevaluated 7006 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7006
169 && (
(b->flags & 0)Description
TRUEnever evaluated
FALSEevaluated 767 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
b->flags & 0)
(b->flags & 0)Description
TRUEnever evaluated
FALSEevaluated 767 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? ferror((FILE *)b->ptr) :
ret == 0 && (b...FILE *)b->ptr)Description
TRUEnever evaluated
FALSEevaluated 7006 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7006
170 ferror((FILE *)b->ptr)
ret == 0 && (b...FILE *)b->ptr)Description
TRUEnever evaluated
FALSEevaluated 7006 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-7006
171 ERR_put_error(2,(11),(-
172 (*__errno_location ())-
173 ),__FILE__,152);-
174 ERR_put_error(32,(130),(2),__FILE__,153);-
175 ret = -1;-
176 }
never executed: end of block
0
177 }
executed 7006 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7006
178 return
executed 7006 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 7006 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
7006
179}-
180-
181static int file_write(BIO *b, const char *in, int inl)-
182{-
183 int ret = 0;-
184-
185 if (b->init
b->initDescription
TRUEevaluated 413449 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEnever evaluated
&& (
(in != ((void *)0) )Description
TRUEevaluated 413449 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEnever evaluated
in !=
(in != ((void *)0) )Description
TRUEevaluated 413449 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEnever evaluated
0-413449
186 ((void *)0)
(in != ((void *)0) )Description
TRUEevaluated 413449 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEnever evaluated
0-413449
187 )
(in != ((void *)0) )Description
TRUEevaluated 413449 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEnever evaluated
) {
0-413449
188 if (b->flags & 0
b->flags & 0Description
TRUEnever evaluated
FALSEevaluated 413449 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
)
0-413449
189 ret = fwrite(in, (int)inl, 1, b->ptr);
never executed: ret = fwrite(in, (int)inl, 1, b->ptr);
0
190 else-
191 ret = fwrite(in, (int)inl, 1, (FILE *)b->ptr);
executed 413449 times by 12 tests: ret = fwrite(in, (int)inl, 1, (FILE *)b->ptr);
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
413449
192 if (ret
retDescription
TRUEevaluated 413449 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEnever evaluated
)
0-413449
193 ret = inl;
executed 413449 times by 12 tests: ret = inl;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
413449
194-
195-
196-
197-
198-
199-
200 }
executed 413449 times by 12 tests: end of block
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
413449
201 return
executed 413449 times by 12 tests: return ret;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
ret;
executed 413449 times by 12 tests: return ret;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
413449
202}-
203-
204static long file_ctrl(BIO *b, int cmd, long num, void *ptr)-
205{-
206 long ret = 1;-
207 FILE *fp = (FILE *)b->ptr;-
208 FILE **fpp;-
209 char p[4];-
210 int st;-
211-
212 switch (cmd) {-
213 case
never executed: case 128:
128:
never executed: case 128:
0
214 case
executed 5 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 5 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
5
215 if (b->flags & 0
b->flags & 0Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
216 ret = (long)fseek(b->ptr, num, 0);
never executed: ret = (long)fseek(b->ptr, num, 0);
0
217 else-
218 ret = (long)fseek(fp, num, 0);
executed 5 times by 1 test: ret = (long)fseek(fp, num, 0);
Executed by:
  • libcrypto.so.1.1
5
219 break;
executed 5 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
5
220 case
executed 11122 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
2:
executed 11122 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
11122
221 if (b->flags & 0
b->flags & 0Description
TRUEnever evaluated
FALSEevaluated 11122 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11122
222 ret = (long)feof(fp);
never executed: ret = (long)feof(fp);
0
223 else-
224 ret = (long)feof(fp);
executed 11122 times by 1 test: ret = (long)feof(fp);
Executed by:
  • libcrypto.so.1.1
11122
225 break;
executed 11122 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
11122
226 case
never executed: case 133:
133:
never executed: case 133:
0
227 case
never executed: case 3:
3:
never executed: case 3:
0
228 if (b->flags & 0
b->flags & 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
229 ret = ftell(b->ptr);
never executed: ret = ftell(b->ptr);
0
230 else-
231 ret = ftell(fp);
never executed: ret = ftell(fp);
0
232 break;
never executed: break;
0
233 case
executed 17465 times by 12 tests: case 106:
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
106:
executed 17465 times by 12 tests: case 106:
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
17465
234 file_free(b);-
235 b->shutdown = (int)num & 0x01;-
236 b->ptr = ptr;-
237 b->init = 1;-
238 {-
239 }-
240 break;
executed 17465 times by 12 tests: break;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
17465
241 case
executed 4935 times by 1 test: case 108:
Executed by:
  • libcrypto.so.1.1
108:
executed 4935 times by 1 test: case 108:
Executed by:
  • libcrypto.so.1.1
4935
242 file_free(b);-
243 b->shutdown = (int)num & 0x01;-
244 if (num & 0x08
num & 0x08Description
TRUEnever evaluated
FALSEevaluated 4935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4935
245 if (num & 0x02
num & 0x02Description
TRUEnever evaluated
FALSEnever evaluated
)
0
246 OPENSSL_strlcpy(p, "a+", sizeof(p));
never executed: OPENSSL_strlcpy(p, "a+", sizeof(p));
0
247 else-
248 OPENSSL_strlcpy(p, "a", sizeof(p));
never executed: OPENSSL_strlcpy(p, "a", sizeof(p));
0
249 } else if ((
(num & 0x02)Description
TRUEevaluated 4935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
num & 0x02)
(num & 0x02)Description
TRUEevaluated 4935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(num & 0x04)Description
TRUEnever evaluated
FALSEevaluated 4935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
num & 0x04)
(num & 0x04)Description
TRUEnever evaluated
FALSEevaluated 4935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4935
250 OPENSSL_strlcpy(p, "r+", sizeof(p));
never executed: OPENSSL_strlcpy(p, "r+", sizeof(p));
0
251 else if (num & 0x04
num & 0x04Description
TRUEnever evaluated
FALSEevaluated 4935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4935
252 OPENSSL_strlcpy(p, "w", sizeof(p));
never executed: OPENSSL_strlcpy(p, "w", sizeof(p));
0
253 else if (num & 0x02
num & 0x02Description
TRUEevaluated 4935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-4935
254 OPENSSL_strlcpy(p, "r", sizeof(p));
executed 4935 times by 1 test: OPENSSL_strlcpy(p, "r", sizeof(p));
Executed by:
  • libcrypto.so.1.1
4935
255 else {-
256 ERR_put_error(32,(116),(101),__FILE__,278);-
257 ret = 0;-
258 break;
never executed: break;
0
259 }-
260-
261-
262-
263-
264-
265-
266 fp = openssl_fopen(ptr, p);-
267 if (fp ==
fp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4935
268 ((void *)0)
fp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4935
269 ) {-
270 ERR_put_error(2,(1),(-
271 (*__errno_location ())-
272 ),__FILE__,290);-
273 ERR_add_error_data(5, "fopen('", ptr, "','", p, "')");-
274 ERR_put_error(32,(116),(2),__FILE__,292);-
275 ret = 0;-
276 break;
never executed: break;
0
277 }-
278 b->ptr = fp;-
279 b->init = 1;-
280 BIO_clear_flags(b, 0);-
281-
282 break;
executed 4935 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
4935
283 case
executed 2 times by 1 test: case 107:
Executed by:
  • libcrypto.so.1.1
107:
executed 2 times by 1 test: case 107:
Executed by:
  • libcrypto.so.1.1
2
284-
285 if (ptr !=
ptr != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2
286 ((void *)0)
ptr != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2
287 ) {-
288 fpp = (FILE **)ptr;-
289 *fpp = (FILE *)b->ptr;-
290 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
291 break;
executed 2 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
2
292 case
never executed: case 8:
8:
never executed: case 8:
0
293 ret = (long)b->shutdown;-
294 break;
never executed: break;
0
295 case
never executed: case 9:
9:
never executed: case 9:
0
296 b->shutdown = (int)num;-
297 break;
never executed: break;
0
298 case
executed 32247 times by 12 tests: case 11:
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
11:
executed 32247 times by 12 tests: case 11:
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
32247
299 st = b->flags & 0
b->flags & 0Description
TRUEnever evaluated
FALSEevaluated 32247 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
0-32247
300 ? fflush(b->ptr) : fflush((FILE *)b->ptr);-
301 if (st ==
st == (-1)Description
TRUEnever evaluated
FALSEevaluated 32247 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
0-32247
302 (-1)
st == (-1)Description
TRUEnever evaluated
FALSEevaluated 32247 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
0-32247
303 ) {-
304 ERR_put_error(2,(18),(-
305 (*__errno_location ())-
306 ),__FILE__,318);-
307 ERR_add_error_data(1, "fflush()");-
308 ERR_put_error(32,(116),(2),__FILE__,320);-
309 ret = 0;-
310 }
never executed: end of block
0
311 break;
executed 32247 times by 12 tests: break;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
32247
312 case
never executed: case 12:
12:
never executed: case 12:
0
313 ret = 1;-
314 break;
never executed: break;
0
315-
316 case
never executed: case 13:
13:
never executed: case 13:
0
317 case
never executed: case 10:
10:
never executed: case 10:
0
318 case
executed 2774 times by 12 tests: case 6:
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
6:
executed 2774 times by 12 tests: case 6:
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
2774
319 case
executed 240 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
7:
executed 240 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
240
320 default
never executed: default:
:
never executed: default:
0
321 ret = 0;-
322 break;
executed 3014 times by 12 tests: break;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
3014
323 }-
324 return
executed 68790 times by 12 tests: return ret;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
ret;
executed 68790 times by 12 tests: return ret;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
68790
325}-
326-
327static int file_gets(BIO *bp, char *buf, int size)-
328{-
329 int ret = 0;-
330-
331 buf[0] = '\0';-
332 if (bp->flags & 0
bp->flags & 0Description
TRUEnever evaluated
FALSEevaluated 376779 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-376779
333 if (!fgets(buf, size, bp->ptr)
!fgets(buf, size, bp->ptr)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
334 goto
never executed: goto err;
err;
never executed: goto err;
0
335 }
never executed: end of block
else {
0
336 if (!fgets(buf, size, (FILE *)bp->ptr)
!fgets(buf, si...ILE *)bp->ptr)Description
TRUEevaluated 6349 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 370430 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
6349-370430
337 goto
executed 6349 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 6349 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
6349
338 }
executed 370430 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
370430
339 if (buf[0] != '\0'
buf[0] != '\0'Description
TRUEevaluated 370430 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-370430
340 ret = strlen(buf);
executed 370430 times by 1 test: ret = strlen(buf);
Executed by:
  • libcrypto.so.1.1
370430
341 err:
code before this statement executed 370430 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
370430
342 return
executed 376779 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 376779 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
376779
343}-
344-
345static int file_puts(BIO *bp, const char *str)-
346{-
347 int n, ret;-
348-
349 n = strlen(str);-
350 ret = file_write(bp, str, n);-
351 return
executed 37333 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 37333 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
37333
352}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2