OpenCoverage

eng_dyn.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/engine/eng_dyn.c
Switch to Source codePreprocessed file
LineSourceCount
1static int dynamic_init(ENGINE *e);-
2static int dynamic_finish(ENGINE *e);-
3static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p,-
4 void (*f) (void));-
5-
6typedef struct st_dynamic_data_ctx dynamic_data_ctx;-
7-
8static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx);-
9static const char *engine_dynamic_id = "dynamic";-
10static const char *engine_dynamic_name = "Dynamic engine loading support";-
11static const ENGINE_CMD_DEFN dynamic_cmd_defns[] = {-
12 {200,-
13 "SO_PATH",-
14 "Specifies the path to the new ENGINE shared library",-
15 (unsigned int)0x0002},-
16 {(200 + 1),-
17 "NO_VCHECK",-
18 "Specifies to continue even if version checking fails (boolean)",-
19 (unsigned int)0x0001},-
20 {(200 + 2),-
21 "ID",-
22 "Specifies an ENGINE id name for loading",-
23 (unsigned int)0x0002},-
24 {(200 + 3),-
25 "LIST_ADD",-
26 "Whether to add a loaded ENGINE to the internal list (0=no,1=yes,2=mandatory)",-
27 (unsigned int)0x0001},-
28 {(200 + 4),-
29 "DIR_LOAD",-
30 "Specifies whether to load from 'DIR_ADD' directories (0=no,1=yes,2=mandatory)",-
31 (unsigned int)0x0001},-
32 {(200 + 5),-
33 "DIR_ADD",-
34 "Adds a directory from which ENGINEs can be loaded",-
35 (unsigned int)0x0002},-
36 {(200 + 6),-
37 "LOAD",-
38 "Load up the ENGINE specified by other settings",-
39 (unsigned int)0x0004},-
40 {0, -
41 ((void *)0)-
42 , -
43 ((void *)0)-
44 , 0}-
45};-
46-
47-
48-
49-
50-
51-
52struct st_dynamic_data_ctx {-
53-
54 DSO *dynamic_dso;-
55-
56-
57-
58 dynamic_v_check_fn v_check;-
59-
60-
61-
62 dynamic_bind_engine bind_engine;-
63-
64 char *DYNAMIC_LIBNAME;-
65-
66 int no_vcheck;-
67-
68 char *engine_id;-
69-
70-
71-
72-
73-
74 int list_add_value;-
75-
76 const char *DYNAMIC_F1;-
77-
78 const char *DYNAMIC_F2;-
79-
80-
81-
82-
83 int dir_load;-
84-
85 struct stack_st_OPENSSL_STRING *dirs;-
86};-
87-
88-
89-
90-
91-
92static int dynamic_ex_data_idx = -1;-
93-
94static void int_free_str(char *s)-
95{-
96 CRYPTO_free(s, __FILE__, 122);-
97}
executed 368 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
368
98static void dynamic_data_ctx_free_func(void *parent, void *ptr,-
99 CRYPTO_EX_DATA *ad, int idx, long argl,-
100 void *argp)-
101{-
102 if (ptr
ptrDescription
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
368
103 dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr;-
104 DSO_free(ctx->dynamic_dso);-
105 CRYPTO_free(ctx->DYNAMIC_LIBNAME, __FILE__, 141);-
106 CRYPTO_free(ctx->engine_id, __FILE__, 142);-
107 sk_OPENSSL_STRING_pop_free(ctx->dirs, int_free_str);-
108 CRYPTO_free(ctx, __FILE__, 144);-
109 }
executed 368 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
368
110}
executed 736 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
736
111-
112-
113-
114-
115-
116-
117-
118static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)-
119{-
120 dynamic_data_ctx *c = CRYPTO_zalloc(sizeof(*c), __FILE__, 156);-
121 int ret = 1;-
122-
123 if (c ==
c == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
124 ((void *)0)
c == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
125 ) {-
126 ERR_put_error(38,(183),((1|64)),__FILE__,160);-
127 return
never executed: return 0;
0;
never executed: return 0;
0
128 }-
129 c->dirs = sk_OPENSSL_STRING_new_null();-
130 if (c->dirs ==
c->dirs == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
131 ((void *)0)
c->dirs == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
132 ) {-
133 ERR_put_error(38,(183),((1|64)),__FILE__,165);-
134 CRYPTO_free(c, __FILE__, 166);-
135 return
never executed: return 0;
0;
never executed: return 0;
0
136 }-
137 c->DYNAMIC_F1 = "v_check";-
138 c->DYNAMIC_F2 = "bind_engine";-
139 c->dir_load = 1;-
140 CRYPTO_THREAD_write_lock(global_engine_lock);-
141 if ((*
(*ctx = (dynam...== ((void *)0)Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
ctx = (dynamic_data_ctx *)ENGINE_get_ex_data(e,
(*ctx = (dynam...== ((void *)0)Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-368
142 dynamic_ex_data_idx))
(*ctx = (dynam...== ((void *)0)Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-368
143 ==
(*ctx = (dynam...== ((void *)0)Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-368
144 ((void *)0)
(*ctx = (dynam...== ((void *)0)Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-368
145 ) {-
146-
147 ret = ENGINE_set_ex_data(e, dynamic_ex_data_idx, c);-
148 if (ret
retDescription
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-368
149 *ctx = c;-
150 c = -
151 ((void *)0)-
152 ;-
153 }
executed 368 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
368
154 }
executed 368 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
368
155 CRYPTO_THREAD_unlock(global_engine_lock);-
156-
157-
158-
159-
160 if (c
cDescription
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-368
161 sk_OPENSSL_STRING_free(c->dirs);
never executed: sk_OPENSSL_STRING_free(c->dirs);
0
162 CRYPTO_free(c, __FILE__, 190);-
163 return
executed 368 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 368 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
368
164}-
165-
166-
167-
168-
169-
170static dynamic_data_ctx *dynamic_get_data_ctx(ENGINE *e)-
171{-
172 dynamic_data_ctx *ctx;-
173 if (dynamic_ex_data_idx < 0
dynamic_ex_data_idx < 0Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
368-1472
174-
175-
176-
177-
178-
179 int new_idx = CRYPTO_get_ex_new_index(10, 0, -
180 ((void *)0)-
181 , -
182 ((void *)0)-
183 , -
184 ((void *)0)-
185 , dynamic_data_ctx_free_func)-
186 ;-
187 if (new_idx == -1
new_idx == -1Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-368
188 ERR_put_error(38,(181),(144),__FILE__,210);-
189 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
190 ((void *)0)
never executed: return ((void *)0) ;
0
191 ;
never executed: return ((void *)0) ;
0
192 }-
193 CRYPTO_THREAD_write_lock(global_engine_lock);-
194-
195 if (dynamic_ex_data_idx < 0
dynamic_ex_data_idx < 0Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-368
196-
197 dynamic_ex_data_idx = new_idx;-
198 new_idx = -1;-
199 }
executed 368 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
368
200 CRYPTO_THREAD_unlock(global_engine_lock);-
201-
202-
203-
204-
205 }
executed 368 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
368
206 ctx = (dynamic_data_ctx *)ENGINE_get_ex_data(e, dynamic_ex_data_idx);-
207-
208 if ((
(ctx == ((void *)0) )Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx ==
(ctx == ((void *)0) )Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
368-1472
209 ((void *)0)
(ctx == ((void *)0) )Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
368-1472
210 )
(ctx == ((void *)0) )Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !dynamic_set_data_ctx(e, &ctx)
!dynamic_set_data_ctx(e, &ctx)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1472
211-
212 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
213 ((void *)0)
never executed: return ((void *)0) ;
0
214 ;
never executed: return ((void *)0) ;
0
215 return
executed 1840 times by 1 test: return ctx;
Executed by:
  • libcrypto.so.1.1
ctx;
executed 1840 times by 1 test: return ctx;
Executed by:
  • libcrypto.so.1.1
1840
216}-
217-
218static ENGINE *engine_dynamic(void)-
219{-
220 ENGINE *ret = ENGINE_new();-
221 if (ret ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1959
222 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1959
223 )-
224 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
225 ((void *)0)
never executed: return ((void *)0) ;
0
226 ;
never executed: return ((void *)0) ;
0
227 if (!ENGINE_set_id(ret, engine_dynamic_id)
!ENGINE_set_id...ne_dynamic_id)Description
TRUEnever evaluated
FALSEevaluated 1959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-1959
228 !ENGINE_set_name(ret, engine_dynamic_name)
!ENGINE_set_na..._dynamic_name)Description
TRUEnever evaluated
FALSEevaluated 1959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-1959
229 !ENGINE_set_init_function(ret, dynamic_init)
!ENGINE_set_in... dynamic_init)Description
TRUEnever evaluated
FALSEevaluated 1959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-1959
230 !ENGINE_set_finish_function(ret, dynamic_finish)
!ENGINE_set_fi...ynamic_finish)Description
TRUEnever evaluated
FALSEevaluated 1959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-1959
231 !ENGINE_set_ctrl_function(ret, dynamic_ctrl)
!ENGINE_set_ct... dynamic_ctrl)Description
TRUEnever evaluated
FALSEevaluated 1959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-1959
232 !ENGINE_set_flags(ret, (int)0x0004)
!ENGINE_set_fl..., (int)0x0004)Description
TRUEnever evaluated
FALSEevaluated 1959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-1959
233 !ENGINE_set_cmd_defns(ret, dynamic_cmd_defns)
!ENGINE_set_cm...mic_cmd_defns)Description
TRUEnever evaluated
FALSEevaluated 1959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1959
234 ENGINE_free(ret);-
235 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
236 ((void *)0)
never executed: return ((void *)0) ;
0
237 ;
never executed: return ((void *)0) ;
0
238 }-
239 return
executed 1959 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 1959 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
1959
240}-
241-
242void engine_load_dynamic_int(void)-
243{-
244 ENGINE *toadd = engine_dynamic();-
245 if (!toadd
!toaddDescription
TRUEnever evaluated
FALSEevaluated 1959 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1959
246 return;
never executed: return;
0
247 ENGINE_add(toadd);-
248-
249-
250-
251-
252 ENGINE_free(toadd);-
253-
254-
255-
256-
257-
258 ERR_clear_error();-
259}
executed 1959 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1959
260-
261static int dynamic_init(ENGINE *e)-
262{-
263-
264-
265-
266-
267 return
never executed: return 0;
0;
never executed: return 0;
0
268}-
269-
270static int dynamic_finish(ENGINE *e)-
271{-
272-
273-
274-
275-
276 return
never executed: return 0;
0;
never executed: return 0;
0
277}-
278-
279static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void))-
280{-
281 dynamic_data_ctx *ctx = dynamic_get_data_ctx(e);-
282 int initialised;-
283-
284 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 1840 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1840
285 ERR_put_error(38,(180),(112),__FILE__,295);-
286 return
never executed: return 0;
0;
never executed: return 0;
0
287 }-
288 initialised = ((
(ctx->dynamic_... ((void *)0) )Description
TRUEevaluated 1840 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
ctx->dynamic_dso ==
(ctx->dynamic_... ((void *)0) )Description
TRUEevaluated 1840 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1840
289 ((void *)0)
(ctx->dynamic_... ((void *)0) )Description
TRUEevaluated 1840 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1840
290 )
(ctx->dynamic_... ((void *)0) )Description
TRUEevaluated 1840 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
? 0 : 1);
0-1840
291-
292 if (initialised
initialisedDescription
TRUEnever evaluated
FALSEevaluated 1840 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1840
293 ERR_put_error(38,(180),(100),__FILE__,301);-
294 return
never executed: return 0;
0;
never executed: return 0;
0
295 }-
296 switch (cmd) {-
297 case
never executed: case 200:
200:
never executed: case 200:
0
298-
299 if (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(strlen((const char *)p) < 1)Description
TRUEnever evaluated
FALSEnever evaluated
strlen((const char *)p) < 1)
(strlen((const char *)p) < 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
300 p =
never executed: p = ((void *)0) ;
0
301 ((void *)0)
never executed: p = ((void *)0) ;
0
302 ;
never executed: p = ((void *)0) ;
0
303 CRYPTO_free(ctx->DYNAMIC_LIBNAME, __FILE__, 309);-
304 if (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
305 ctx->DYNAMIC_LIBNAME = CRYPTO_strdup(p, __FILE__, 311);
never executed: ctx->DYNAMIC_LIBNAME = CRYPTO_strdup(p, __FILE__, 311);
0
306 else-
307 ctx->DYNAMIC_LIBNAME =
never executed: ctx->DYNAMIC_LIBNAME = ((void *)0) ;
0
308 ((void *)0)
never executed: ctx->DYNAMIC_LIBNAME = ((void *)0) ;
0
309 ;
never executed: ctx->DYNAMIC_LIBNAME = ((void *)0) ;
0
310 return
never executed: return (ctx->DYNAMIC_LIBNAME ? 1 : 0);
(ctx->DYNAMIC_LIBNAME
ctx->DYNAMIC_LIBNAMEDescription
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0);
never executed: return (ctx->DYNAMIC_LIBNAME ? 1 : 0);
0
311 case
never executed: case (200 + 1):
(200 + 1):
never executed: case (200 + 1):
0
312 ctx->no_vcheck = ((
(i == 0)Description
TRUEnever evaluated
FALSEnever evaluated
i == 0)
(i == 0)Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : 1);
0
313 return
never executed: return 1;
1;
never executed: return 1;
0
314 case
executed 368 times by 1 test: case (200 + 2):
Executed by:
  • libcrypto.so.1.1
(200 + 2):
executed 368 times by 1 test: case (200 + 2):
Executed by:
  • libcrypto.so.1.1
368
315-
316 if (p
pDescription
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(strlen((const char *)p) < 1)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
strlen((const char *)p) < 1)
(strlen((const char *)p) < 1)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-368
317 p =
never executed: p = ((void *)0) ;
0
318 ((void *)0)
never executed: p = ((void *)0) ;
0
319 ;
never executed: p = ((void *)0) ;
0
320 CRYPTO_free(ctx->engine_id, __FILE__, 322);-
321 if (p
pDescription
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-368
322 ctx->engine_id = CRYPTO_strdup(p, __FILE__, 324);
executed 368 times by 1 test: ctx->engine_id = CRYPTO_strdup(p, __FILE__, 324);
Executed by:
  • libcrypto.so.1.1
368
323 else-
324 ctx->engine_id =
never executed: ctx->engine_id = ((void *)0) ;
0
325 ((void *)0)
never executed: ctx->engine_id = ((void *)0) ;
0
326 ;
never executed: ctx->engine_id = ((void *)0) ;
0
327 return
executed 368 times by 1 test: return (ctx->engine_id ? 1 : 0);
Executed by:
  • libcrypto.so.1.1
(ctx->engine_id
ctx->engine_idDescription
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
? 1 : 0);
executed 368 times by 1 test: return (ctx->engine_id ? 1 : 0);
Executed by:
  • libcrypto.so.1.1
0-368
328 case
executed 368 times by 1 test: case (200 + 3):
Executed by:
  • libcrypto.so.1.1
(200 + 3):
executed 368 times by 1 test: case (200 + 3):
Executed by:
  • libcrypto.so.1.1
368
329 if ((
(i < 0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i < 0)
(i < 0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(i > 2)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i > 2)
(i > 2)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-368
330 ERR_put_error(38,(180),(143),__FILE__,330);-
331 return
never executed: return 0;
0;
never executed: return 0;
0
332 }-
333 ctx->list_add_value = (int)i;-
334 return
executed 368 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 368 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
368
335 case
executed 368 times by 1 test: case (200 + 6):
Executed by:
  • libcrypto.so.1.1
(200 + 6):
executed 368 times by 1 test: case (200 + 6):
Executed by:
  • libcrypto.so.1.1
368
336 return
executed 368 times by 1 test: return dynamic_load(e, ctx);
Executed by:
  • libcrypto.so.1.1
dynamic_load(e, ctx);
executed 368 times by 1 test: return dynamic_load(e, ctx);
Executed by:
  • libcrypto.so.1.1
368
337 case
executed 368 times by 1 test: case (200 + 4):
Executed by:
  • libcrypto.so.1.1
(200 + 4):
executed 368 times by 1 test: case (200 + 4):
Executed by:
  • libcrypto.so.1.1
368
338 if ((
(i < 0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i < 0)
(i < 0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(i > 2)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i > 2)
(i > 2)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-368
339 ERR_put_error(38,(180),(143),__FILE__,339);-
340 return
never executed: return 0;
0;
never executed: return 0;
0
341 }-
342 ctx->dir_load = (int)i;-
343 return
executed 368 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 368 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
368
344 case
executed 368 times by 1 test: case (200 + 5):
Executed by:
  • libcrypto.so.1.1
(200 + 5):
executed 368 times by 1 test: case (200 + 5):
Executed by:
  • libcrypto.so.1.1
368
345-
346 if (!p
!pDescription
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(strlen((const char *)p) < 1)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
strlen((const char *)p) < 1)
(strlen((const char *)p) < 1)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-368
347 ERR_put_error(38,(180),(143),__FILE__,347);-
348 return
never executed: return 0;
0;
never executed: return 0;
0
349 }-
350 {-
351 char *tmp_str = CRYPTO_strdup(p, __FILE__, 351);-
352 if (tmp_str ==
tmp_str == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
353 ((void *)0)
tmp_str == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
354 ) {-
355 ERR_put_error(38,(180),((1|64)),__FILE__,353);-
356 return
never executed: return 0;
0;
never executed: return 0;
0
357 }-
358 if (!sk_OPENSSL_STRING_push(ctx->dirs, tmp_str)
!sk_OPENSSL_ST...dirs, tmp_str)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-368
359 CRYPTO_free(tmp_str, __FILE__, 357);-
360 ERR_put_error(38,(180),((1|64)),__FILE__,358);-
361 return
never executed: return 0;
0;
never executed: return 0;
0
362 }-
363 }-
364 return
executed 368 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 368 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
368
365 default
never executed: default:
:
never executed: default:
0
366 break;
never executed: break;
0
367 }-
368 ERR_put_error(38,(180),(119),__FILE__,366);-
369 return
never executed: return 0;
0;
never executed: return 0;
0
370}-
371-
372static int int_load(dynamic_data_ctx *ctx)-
373{-
374 int num, loop;-
375-
376 if ((
(ctx->dir_load != 2)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx->dir_load != 2)
(ctx->dir_load != 2)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(DSO_load(ctx-...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
DSO_load(ctx->dynamic_dso,
(DSO_load(ctx-...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0-368
377 ctx->DYNAMIC_LIBNAME,
(DSO_load(ctx-...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
378 ((void *)0)
(DSO_load(ctx-...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
379 ,
(DSO_load(ctx-...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
380 0)) !=
(DSO_load(ctx-...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
381 ((void *)0)
(DSO_load(ctx-...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
382 )-
383 return
never executed: return 1;
1;
never executed: return 1;
0
384-
385 if (!ctx->dir_load
!ctx->dir_loadDescription
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(num = sk_OPEN...tx->dirs)) < 1Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
num = sk_OPENSSL_STRING_num(ctx->dirs)) < 1
(num = sk_OPEN...tx->dirs)) < 1Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-368
386 return
never executed: return 0;
0;
never executed: return 0;
0
387 for (loop = 0; loop < num
loop < numDescription
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
; loop++) {
0-368
388 const char *s = sk_OPENSSL_STRING_value(ctx->dirs, loop);-
389 char *merge = DSO_merge(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, s);-
390 if (!merge
!mergeDescription
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-368
391 return
never executed: return 0;
0;
never executed: return 0;
0
392 if (DSO_load(ctx->dynamic_dso, merge,
DSO_load(ctx->...void *)0) , 0)Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-368
393 ((void *)0)
DSO_load(ctx->...void *)0) , 0)Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-368
394 , 0)
DSO_load(ctx->...void *)0) , 0)Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-368
395-
396 CRYPTO_free(merge, __FILE__, 388);-
397 return
executed 368 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 368 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
368
398 }-
399 CRYPTO_free(merge, __FILE__, 391);-
400 }
never executed: end of block
0
401 return
never executed: return 0;
0;
never executed: return 0;
0
402}-
403-
404static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx)-
405{-
406 ENGINE cpy;-
407 dynamic_fns fns;-
408-
409 if (ctx->dynamic_dso ==
ctx->dynamic_d...== ((void *)0)Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-368
410 ((void *)0)
ctx->dynamic_d...== ((void *)0)Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-368
411 )-
412 ctx->dynamic_dso = DSO_new();
executed 368 times by 1 test: ctx->dynamic_dso = DSO_new();
Executed by:
  • libcrypto.so.1.1
368
413 if (ctx->dynamic_dso ==
ctx->dynamic_d...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
414 ((void *)0)
ctx->dynamic_d...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
415 )-
416 return
never executed: return 0;
0;
never executed: return 0;
0
417 if (!ctx->DYNAMIC_LIBNAME
!ctx->DYNAMIC_LIBNAMEDescription
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-368
418 if (!ctx->engine_id
!ctx->engine_idDescription
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-368
419 return
never executed: return 0;
0;
never executed: return 0;
0
420 DSO_ctrl(ctx->dynamic_dso, 2,-
421 0x02, -
422 ((void *)0)-
423 );-
424 ctx->DYNAMIC_LIBNAME =-
425 DSO_convert_filename(ctx->dynamic_dso, ctx->engine_id);-
426 }
executed 368 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
368
427 if (!int_load(ctx)
!int_load(ctx)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-368
428 ERR_put_error(38,(182),(132),__FILE__,414);-
429 DSO_free(ctx->dynamic_dso);-
430 ctx->dynamic_dso = -
431 ((void *)0)-
432 ;-
433 return
never executed: return 0;
0;
never executed: return 0;
0
434 }-
435-
436 if (!
! (ctx->bind_e...->DYNAMIC_F2))Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
437 (ctx->bind_engine =
! (ctx->bind_e...->DYNAMIC_F2))Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
438 (dynamic_bind_engine) DSO_bind_func(ctx->dynamic_dso,
! (ctx->bind_e...->DYNAMIC_F2))Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-368
439 ctx->DYNAMIC_F2))
! (ctx->bind_e...->DYNAMIC_F2))Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-368
440 ctx->bind_engine = -
441 ((void *)0)-
442 ;-
443 DSO_free(ctx->dynamic_dso);-
444 ctx->dynamic_dso = -
445 ((void *)0)-
446 ;-
447 ERR_put_error(38,(182),(104),__FILE__,427);-
448 return
never executed: return 0;
0;
never executed: return 0;
0
449 }-
450-
451 if (!ctx->no_vcheck
!ctx->no_vcheckDescription
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-368
452 unsigned long vcheck_res = 0;-
453-
454-
455-
456-
457 ctx->v_check =-
458 (dynamic_v_check_fn) DSO_bind_func(ctx->dynamic_dso,-
459 ctx->DYNAMIC_F1);-
460 if (ctx->v_check
ctx->v_checkDescription
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-368
461 vcheck_res = ctx->v_check((unsigned long)0x00030000);
executed 368 times by 1 test: vcheck_res = ctx->v_check((unsigned long)0x00030000);
Executed by:
  • libcrypto.so.1.1
368
462-
463-
464-
465-
466-
467 if (vcheck_res < (unsigned long)0x00030000
vcheck_res < (...ong)0x00030000Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-368
468-
469 ctx->bind_engine = -
470 ((void *)0)-
471 ;-
472 ctx->v_check = -
473 ((void *)0)-
474 ;-
475 DSO_free(ctx->dynamic_dso);-
476 ctx->dynamic_dso = -
477 ((void *)0)-
478 ;-
479 ERR_put_error(38,(182),(145),__FILE__,454)-
480 ;-
481 return
never executed: return 0;
0;
never executed: return 0;
0
482 }-
483 }
executed 368 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
368
484-
485-
486-
487-
488 memcpy(&cpy, e, sizeof(ENGINE));-
489-
490-
491-
492-
493-
494-
495-
496 fns.static_state = ENGINE_get_static_state();-
497 CRYPTO_get_mem_functions(&fns.mem_fns.malloc_fn, &fns.mem_fns.realloc_fn,-
498 &fns.mem_fns.free_fn);-
499-
500-
501-
502-
503 engine_set_all_null(e);-
504-
505-
506 if (!ctx->bind_engine(e, ctx->engine_id, &fns)
!ctx->bind_eng...gine_id, &fns)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-368
507 ctx->bind_engine = -
508 ((void *)0)-
509 ;-
510 ctx->v_check = -
511 ((void *)0)-
512 ;-
513 DSO_free(ctx->dynamic_dso);-
514 ctx->dynamic_dso = -
515 ((void *)0)-
516 ;-
517 ERR_put_error(38,(182),(109),__FILE__,485);-
518-
519 memcpy(e, &cpy, sizeof(ENGINE));-
520 return
never executed: return 0;
0;
never executed: return 0;
0
521 }-
522-
523 if (ctx->list_add_value > 0
ctx->list_add_value > 0Description
TRUEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-368
524 if (!ENGINE_add(e)
!ENGINE_add(e)Description
TRUEnever evaluated
FALSEevaluated 368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-368
525-
526 if (ctx->list_add_value > 1
ctx->list_add_value > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
527-
528-
529-
530-
531-
532-
533 ERR_put_error(38,(182),(103),__FILE__,502)-
534 ;-
535 return
never executed: return 0;
0;
never executed: return 0;
0
536 }-
537-
538 ERR_clear_error();-
539 }
never executed: end of block
0
540 }
executed 368 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
368
541 return
executed 368 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 368 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
368
542}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2