OpenCoverage

digest.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/digest.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3int EVP_MD_CTX_reset(EVP_MD_CTX *ctx)-
4{-
5 if (ctx ==
ctx == ((void *)0)Description
TRUEevaluated 783053 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2564792 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
783053-2564792
6 ((void *)0)
ctx == ((void *)0)Description
TRUEevaluated 783053 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2564792 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
783053-2564792
7 )-
8 return
executed 783053 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 783053 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
783053
9-
10-
11-
12-
13-
14 if (ctx->digest
ctx->digestDescription
TRUEevaluated 1218625 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1346167 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& ctx->digest->cleanup
ctx->digest->cleanupDescription
TRUEnever evaluated
FALSEevaluated 1218625 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
0-1346167
15 && !EVP_MD_CTX_test_flags(ctx, 0x0002)
!EVP_MD_CTX_te...s(ctx, 0x0002)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
16 ctx->digest->cleanup(ctx);
never executed: ctx->digest->cleanup(ctx);
0
17 if (ctx->digest
ctx->digestDescription
TRUEevaluated 1218625 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1346167 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& ctx->digest->ctx_size
ctx->digest->ctx_sizeDescription
TRUEevaluated 1218625 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
&& ctx->md_data
ctx->md_dataDescription
TRUEevaluated 1040427 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 178198 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1346167
18 && !EVP_MD_CTX_test_flags(ctx, 0x0004)
!EVP_MD_CTX_te...s(ctx, 0x0004)Description
TRUEevaluated 733840 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 306587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
306587-733840
19 CRYPTO_clear_free(ctx->md_data, ctx->digest->ctx_size, __FILE__, 33);-
20 }
executed 733840 times by 3 tests: end of block
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
733840
21-
22-
23-
24-
25 if (!EVP_MD_CTX_test_flags(ctx, 0x0400)
!EVP_MD_CTX_te...s(ctx, 0x0400)Description
TRUEevaluated 2564789 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3-2564789
26 EVP_PKEY_CTX_free(ctx->pctx);
executed 2564789 times by 3 tests: EVP_PKEY_CTX_free(ctx->pctx);
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
2564789
27-
28 ENGINE_finish(ctx->engine);-
29-
30 OPENSSL_cleanse(ctx, sizeof(*ctx));-
31-
32 return
executed 2564792 times by 3 tests: return 1;
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 2564792 times by 3 tests: return 1;
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
2564792
33}-
34-
35EVP_MD_CTX *EVP_MD_CTX_new(void)-
36{-
37 return
executed 882945 times by 3 tests: return CRYPTO_zalloc(sizeof(EVP_MD_CTX), __FILE__, 51);
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
CRYPTO_zalloc(sizeof(EVP_MD_CTX), __FILE__, 51);
executed 882945 times by 3 tests: return CRYPTO_zalloc(sizeof(EVP_MD_CTX), __FILE__, 51);
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
882945
38}-
39-
40void EVP_MD_CTX_free(EVP_MD_CTX *ctx)-
41{-
42 EVP_MD_CTX_reset(ctx);-
43 CRYPTO_free(ctx, __FILE__, 57);-
44}
executed 1018217 times by 3 tests: end of block
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
1018217
45-
46int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)-
47{-
48 EVP_MD_CTX_reset(ctx);-
49 return
executed 18 times by 2 tests: return EVP_DigestInit_ex(ctx, type, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
EVP_DigestInit_ex(ctx, type,
executed 18 times by 2 tests: return EVP_DigestInit_ex(ctx, type, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
18
50 ((void *)0)
executed 18 times by 2 tests: return EVP_DigestInit_ex(ctx, type, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
18
51 );
executed 18 times by 2 tests: return EVP_DigestInit_ex(ctx, type, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
18
52}-
53-
54int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)-
55{-
56 EVP_MD_CTX_clear_flags(ctx, 0x0002);-
57-
58-
59-
60-
61-
62-
63-
64 if (ctx->engine
ctx->engineDescription
TRUEevaluated 730 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 689700 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
&& ctx->digest
ctx->digestDescription
TRUEevaluated 730 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&&
0-689700
65 (type ==
type == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 730 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-730
66 ((void *)0)
type == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 730 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-730
67 || (
(type->type ==...>digest->type)Description
TRUEevaluated 730 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
type->type == ctx->digest->type)
(type->type ==...>digest->type)Description
TRUEevaluated 730 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
))
0-730
68 goto
executed 730 times by 1 test: goto skip_to_init;
Executed by:
  • libcrypto.so.1.1
skip_to_init;
executed 730 times by 1 test: goto skip_to_init;
Executed by:
  • libcrypto.so.1.1
730
69 if (type
typeDescription
TRUEevaluated 689700 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
) {
0-689700
70-
71-
72-
73-
74-
75 ENGINE_finish(ctx->engine);-
76 if (impl !=
impl != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 689700 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
0-689700
77 ((void *)0)
impl != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 689700 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
0-689700
78 ) {-
79 if (!ENGINE_init(impl)
!ENGINE_init(impl)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
80 ERR_put_error(6,(128),(134),__FILE__,88);-
81 return
never executed: return 0;
0;
never executed: return 0;
0
82 }-
83 }
never executed: end of block
else {
0
84-
85 impl = ENGINE_get_digest_engine(type->type);-
86 }
executed 689700 times by 3 tests: end of block
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
689700
87 if (impl !=
impl != ((void *)0)Description
TRUEevaluated 10747 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 678953 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
10747-678953
88 ((void *)0)
impl != ((void *)0)Description
TRUEevaluated 10747 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 678953 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
10747-678953
89 ) {-
90-
91 const EVP_MD *d = ENGINE_get_digest(impl, type->type);-
92-
93 if (d ==
d == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10747 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10747
94 ((void *)0)
d == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10747 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10747
95 ) {-
96 ERR_put_error(6,(128),(134),__FILE__,100);-
97 ENGINE_finish(impl);-
98 return
never executed: return 0;
0;
never executed: return 0;
0
99 }-
100-
101 type = d;-
102-
103-
104-
105-
106 ctx->engine = impl;-
107 }
executed 10747 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
10747
108 ctx->engine =
executed 678953 times by 3 tests: ctx->engine = ((void *)0) ;
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
678953
109 ((void *)0)
executed 678953 times by 3 tests: ctx->engine = ((void *)0) ;
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
678953
110 ;
executed 678953 times by 3 tests: ctx->engine = ((void *)0) ;
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
678953
111 } else {-
112 if (!ctx->digest
!ctx->digestDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
113 ERR_put_error(6,(128),(139),__FILE__,115);-
114 return
never executed: return 0;
0;
never executed: return 0;
0
115 }-
116 type = ctx->digest;-
117 }
never executed: end of block
0
118-
119 if (ctx->digest != type
ctx->digest != typeDescription
TRUEevaluated 196733 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 492967 times by 2 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
) {
196733-492967
120 if (ctx->digest
ctx->digestDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 196731 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
&& ctx->digest->ctx_size
ctx->digest->ctx_sizeDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-196731
121 CRYPTO_clear_free(ctx->md_data, ctx->digest->ctx_size, __FILE__, 123);-
122 ctx->md_data = -
123 ((void *)0)-
124 ;-
125 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
126 ctx->digest = type;-
127 if (!(ctx->flags & 0x0100)
!(ctx->flags & 0x0100)Description
TRUEevaluated 177835 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 18898 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& type->ctx_size
type->ctx_sizeDescription
TRUEevaluated 177835 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
) {
0-177835
128 ctx->update = type->update;-
129 ctx->md_data = CRYPTO_zalloc(type->ctx_size, __FILE__, 129);-
130 if (ctx->md_data ==
ctx->md_data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 177835 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
0-177835
131 ((void *)0)
ctx->md_data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 177835 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
0-177835
132 ) {-
133 ERR_put_error(6,(128),((1|64)),__FILE__,131);-
134 return
never executed: return 0;
0;
never executed: return 0;
0
135 }-
136 }
executed 177835 times by 3 tests: end of block
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
177835
137 }
executed 196733 times by 3 tests: end of block
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
196733
138-
139 skip_to_init:
code before this statement executed 689700 times by 3 tests: skip_to_init:
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
689700
140-
141 if (ctx->pctx
ctx->pctxDescription
TRUEevaluated 24374 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 666056 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
) {
24374-666056
142 int r;-
143 r = EVP_PKEY_CTX_ctrl(ctx->pctx, -1, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)),-
144 7, 0, ctx);-
145 if (r <= 0
r <= 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 24371 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(r != -2)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
r != -2)
(r != -2)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-24371
146 return
never executed: return 0;
0;
never executed: return 0;
0
147 }
executed 24374 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
24374
148 if (ctx->flags & 0x0100
ctx->flags & 0x0100Description
TRUEevaluated 19206 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 671224 times by 3 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
)
19206-671224
149 return
executed 19206 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 19206 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
19206
150 return
executed 671224 times by 3 tests: return ctx->digest->init(ctx);
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
ctx->digest->init(ctx);
executed 671224 times by 3 tests: return ctx->digest->init(ctx);
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
671224
151}-
152-
153int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)-
154{-
155 return
executed 2536966 times by 3 tests: return ctx->update(ctx, data, count);
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
ctx->update(ctx, data, count);
executed 2536966 times by 3 tests: return ctx->update(ctx, data, count);
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
  • sm2_internal_test
2536966
156}-
157-
158-
159int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)-
160{-
161 int ret;-
162 ret = EVP_DigestFinal_ex(ctx, md, size);-
163 EVP_MD_CTX_reset(ctx);-
164 return
executed 374 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 374 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
374
165}-
166-
167-
168int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)-
169{-
170 int ret;-
171-
172 (void)((ctx->digest->md_size <= 64) ? 0 : (OPENSSL_die("assertion failed: " "ctx->digest->md_size <= EVP_MAX_MD_SIZE", __FILE__, 170), 1));-
173 ret = ctx->digest->final(ctx, md);-
174 if (size !=
size != ((void *)0)Description
TRUEevaluated 259342 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 642946 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
259342-642946
175 ((void *)0)
size != ((void *)0)Description
TRUEevaluated 259342 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 642946 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
259342-642946
176 )-
177 *
executed 259342 times by 1 test: *size = ctx->digest->md_size;
Executed by:
  • libcrypto.so.1.1
size = ctx->digest->md_size;
executed 259342 times by 1 test: *size = ctx->digest->md_size;
Executed by:
  • libcrypto.so.1.1
259342
178 if (ctx->digest->cleanup
ctx->digest->cleanupDescription
TRUEnever evaluated
FALSEevaluated 902288 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-902288
179 ctx->digest->cleanup(ctx);-
180 EVP_MD_CTX_set_flags(ctx, 0x0002);-
181 }
never executed: end of block
0
182 OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);-
183 return
executed 902288 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 902288 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
902288
184}-
185-
186int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *md, size_t size)-
187{-
188 int ret = 0;-
189-
190 if (ctx->digest->flags & 0x0002
ctx->digest->flags & 0x0002Description
TRUEevaluated 136 times by 2 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
FALSEnever evaluated
0-136
191 && size <= 0x7fffffff
size <= 0x7fffffffDescription
TRUEevaluated 136 times by 2 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
FALSEnever evaluated
0-136
192 && ctx->digest->md_ctrl(ctx, 0x3, (int)size,
ctx->digest->m... ((void *)0) )Description
TRUEevaluated 136 times by 2 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
FALSEnever evaluated
0-136
193 ((void *)0)
ctx->digest->m... ((void *)0) )Description
TRUEevaluated 136 times by 2 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
FALSEnever evaluated
0-136
194 )
ctx->digest->m... ((void *)0) )Description
TRUEevaluated 136 times by 2 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-136
195 ret = ctx->digest->final(ctx, md);-
196-
197 if (ctx->digest->cleanup !=
ctx->digest->c...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 136 times by 2 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
0-136
198 ((void *)0)
ctx->digest->c...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 136 times by 2 tests
Evaluated by:
  • curve448_internal_test
  • libcrypto.so.1.1
0-136
199 ) {-
200 ctx->digest->cleanup(ctx);-
201 EVP_MD_CTX_set_flags(ctx, 0x0002);-
202 }
never executed: end of block
0
203 OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);-
204 }
executed 136 times by 2 tests: end of block
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
else {
136
205 ERR_put_error(6,(174),(178),__FILE__,197);-
206 }
never executed: end of block
0
207-
208 return
executed 136 times by 2 tests: return ret;
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
ret;
executed 136 times by 2 tests: return ret;
Executed by:
  • curve448_internal_test
  • libcrypto.so.1.1
136
209}-
210-
211int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)-
212{-
213 EVP_MD_CTX_reset(out);-
214 return
executed 11621 times by 1 test: return EVP_MD_CTX_copy_ex(out, in);
Executed by:
  • libcrypto.so.1.1
EVP_MD_CTX_copy_ex(out, in);
executed 11621 times by 1 test: return EVP_MD_CTX_copy_ex(out, in);
Executed by:
  • libcrypto.so.1.1
11621
215}-
216-
217int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)-
218{-
219 unsigned char *tmp_buf;-
220 if ((
(in == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1021894 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
in ==
(in == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1021894 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1021894
221 ((void *)0)
(in == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1021894 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1021894
222 )
(in == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1021894 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(in->digest == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1021894 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
in->digest ==
(in->digest == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1021894 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1021894
223 ((void *)0)
(in->digest == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1021894 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1021894
224 )
(in->digest == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1021894 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1021894
225 ERR_put_error(6,(110),(111),__FILE__,213);-
226 return
never executed: return 0;
0;
never executed: return 0;
0
227 }-
228-
229-
230 if (in->engine
in->engineDescription
TRUEevaluated 39211 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 982683 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !ENGINE_init(in->engine)
!ENGINE_init(in->engine)Description
TRUEnever evaluated
FALSEevaluated 39211 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-982683
231 ERR_put_error(6,(110),(38),__FILE__,219);-
232 return
never executed: return 0;
0;
never executed: return 0;
0
233 }-
234-
235-
236 if (out->digest == in->digest
out->digest == in->digestDescription
TRUEevaluated 353623 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 668271 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
353623-668271
237 tmp_buf = out->md_data;-
238 EVP_MD_CTX_set_flags(out, 0x0004);-
239 }
executed 353623 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
353623
240 tmp_buf =
executed 668271 times by 1 test: tmp_buf = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
668271
241 ((void *)0)
executed 668271 times by 1 test: tmp_buf = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
668271
242 ;
executed 668271 times by 1 test: tmp_buf = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
668271
243 EVP_MD_CTX_reset(out);-
244 memcpy(out, in, sizeof(*out));-
245-
246-
247 EVP_MD_CTX_clear_flags(out, 0x0400);-
248-
249-
250-
251-
252-
253 out->md_data = -
254 ((void *)0)-
255 ;-
256 out->pctx = -
257 ((void *)0)-
258 ;-
259-
260 if (in->md_data
in->md_dataDescription
TRUEevaluated 862594 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 159300 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& out->digest->ctx_size
out->digest->ctx_sizeDescription
TRUEevaluated 862594 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-862594
261 if (tmp_buf
tmp_bufDescription
TRUEevaluated 306587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 556007 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
306587-556007
262 out->md_data = tmp_buf;
executed 306587 times by 1 test: out->md_data = tmp_buf;
Executed by:
  • libcrypto.so.1.1
306587
263 else {-
264 out->md_data = CRYPTO_malloc(out->digest->ctx_size, __FILE__, 246);-
265 if (out->md_data ==
out->md_data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 556007 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556007
266 ((void *)0)
out->md_data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 556007 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-556007
267 ) {-
268 ERR_put_error(6,(110),((1|64)),__FILE__,248);-
269 return
never executed: return 0;
0;
never executed: return 0;
0
270 }-
271 }
executed 556007 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
556007
272 memcpy(out->md_data, in->md_data, out->digest->ctx_size);-
273 }
executed 862594 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
862594
274-
275 out->update = in->update;-
276-
277 if (in->pctx
in->pctxDescription
TRUEevaluated 164769 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 857125 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
164769-857125
278 out->pctx = EVP_PKEY_CTX_dup(in->pctx);-
279 if (!out->pctx
!out->pctxDescription
TRUEnever evaluated
FALSEevaluated 164769 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-164769
280 EVP_MD_CTX_reset(out);-
281 return
never executed: return 0;
0;
never executed: return 0;
0
282 }-
283 }
executed 164769 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
164769
284-
285 if (out->digest->copy
out->digest->copyDescription
TRUEnever evaluated
FALSEevaluated 1021894 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1021894
286 return
never executed: return out->digest->copy(out, in);
out->digest->copy(out, in);
never executed: return out->digest->copy(out, in);
0
287-
288 return
executed 1021894 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1021894 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1021894
289}-
290-
291int EVP_Digest(const void *data, size_t count,-
292 unsigned char *md, unsigned int *size, const EVP_MD *type,-
293 ENGINE *impl)-
294{-
295 EVP_MD_CTX *ctx = EVP_MD_CTX_new();-
296 int ret;-
297-
298 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 50360 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-50360
299 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 50360 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-50360
300 )-
301 return
never executed: return 0;
0;
never executed: return 0;
0
302 EVP_MD_CTX_set_flags(ctx, 0x0001);-
303 ret = EVP_DigestInit_ex(ctx, type, impl)
EVP_DigestInit...x, type, impl)Description
TRUEevaluated 50360 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-50360
304 && EVP_DigestUpdate(ctx, data, count)
EVP_DigestUpda..., data, count)Description
TRUEevaluated 50360 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-50360
305 && EVP_DigestFinal_ex(ctx, md, size)
EVP_DigestFina...ctx, md, size)Description
TRUEevaluated 50360 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
;
0-50360
306 EVP_MD_CTX_free(ctx);-
307-
308 return
executed 50360 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 50360 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
50360
309}-
310-
311int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)-
312{-
313 if (ctx->digest
ctx->digestDescription
TRUEnever evaluated
FALSEnever evaluated
&& ctx->digest->md_ctrl
ctx->digest->md_ctrlDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
314 int ret = ctx->digest->md_ctrl(ctx, cmd, p1, p2);-
315 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
316 return
never executed: return 0;
0;
never executed: return 0;
0
317 return
never executed: return 1;
1;
never executed: return 1;
0
318 }-
319 return
never executed: return 0;
0;
never executed: return 0;
0
320}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2