OpenCoverage

async.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/async/async.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9static CRYPTO_THREAD_LOCAL ctxkey;-
10static CRYPTO_THREAD_LOCAL poolkey;-
11-
12static async_ctx *async_ctx_new(void)-
13{-
14 async_ctx *nctx;-
15-
16 if (!ossl_init_thread_start(0x01)
!ossl_init_thread_start(0x01)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
17 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
18 ((void *)0)
never executed: return ((void *)0) ;
0
19 ;
never executed: return ((void *)0) ;
0
20-
21 nctx = CRYPTO_malloc(sizeof(*nctx), __FILE__, 40);-
22 if (nctx ==
nctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
23 ((void *)0)
nctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
24 ) {-
25 ERR_put_error(51,(100),((1|64)),__FILE__,42);-
26 goto
never executed: goto err;
err;
never executed: goto err;
0
27 }-
28-
29 ;-
30 nctx->currjob = -
31 ((void *)0)-
32 ;-
33 nctx->blocked = 0;-
34 if (!CRYPTO_THREAD_set_local(&ctxkey, nctx)
!CRYPTO_THREAD...&ctxkey, nctx)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
35 goto
never executed: goto err;
err;
never executed: goto err;
0
36-
37 return
executed 5 times by 1 test: return nctx;
Executed by:
  • libcrypto.so.1.1
nctx;
executed 5 times by 1 test: return nctx;
Executed by:
  • libcrypto.so.1.1
5
38err:-
39 CRYPTO_free(nctx, __FILE__, 54);-
40-
41 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
42 ((void *)0)
never executed: return ((void *)0) ;
0
43 ;
never executed: return ((void *)0) ;
0
44}-
45-
46async_ctx *async_get_ctx(void)-
47{-
48 return
executed 58 times by 1 test: return (async_ctx *)CRYPTO_THREAD_get_local(&ctxkey);
Executed by:
  • libcrypto.so.1.1
(async_ctx *)CRYPTO_THREAD_get_local(&ctxkey);
executed 58 times by 1 test: return (async_ctx *)CRYPTO_THREAD_get_local(&ctxkey);
Executed by:
  • libcrypto.so.1.1
58
49}-
50-
51static int async_ctx_free(void)-
52{-
53 async_ctx *ctx;-
54-
55 ctx = async_get_ctx();-
56-
57 if (!CRYPTO_THREAD_set_local(&ctxkey,
!CRYPTO_THREAD... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
58 ((void *)0)
!CRYPTO_THREAD... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
59 )
!CRYPTO_THREAD... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6
60 return
never executed: return 0;
0;
never executed: return 0;
0
61-
62 CRYPTO_free(ctx, __FILE__, 73);-
63-
64 return
executed 6 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 6 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
6
65}-
66-
67static ASYNC_JOB *async_job_new(void)-
68{-
69 ASYNC_JOB *job = -
70 ((void *)0)-
71 ;-
72-
73 job = CRYPTO_zalloc(sizeof(*job), __FILE__, 82);-
74 if (job ==
job == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
75 ((void *)0)
job == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
76 ) {-
77 ERR_put_error(51,(102),((1|64)),__FILE__,84);-
78 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
79 ((void *)0)
never executed: return ((void *)0) ;
0
80 ;
never executed: return ((void *)0) ;
0
81 }-
82-
83 job->status = 0;-
84-
85 return
executed 6 times by 1 test: return job;
Executed by:
  • libcrypto.so.1.1
job;
executed 6 times by 1 test: return job;
Executed by:
  • libcrypto.so.1.1
6
86}-
87-
88static void async_job_free(ASYNC_JOB *job)-
89{-
90 if (job !=
job != ((void *)0)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5-6
91 ((void *)0)
job != ((void *)0)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5-6
92 ) {-
93 CRYPTO_free(job->funcargs, __FILE__, 96);-
94 async_fibre_free(&job->fibrectx);-
95 CRYPTO_free(job, __FILE__, 98);-
96 }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6
97}
executed 11 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
11
98-
99static ASYNC_JOB *async_get_pool_job(void) {-
100 ASYNC_JOB *job;-
101 async_pool *pool;-
102-
103 pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey);-
104 if (pool ==
pool == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
105 ((void *)0)
pool == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
106 ) {-
107-
108-
109-
110-
111 if (ASYNC_init_thread(0, 0) == 0
ASYNC_init_thread(0, 0) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
112 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
113 ((void *)0)
never executed: return ((void *)0) ;
0
114 ;
never executed: return ((void *)0) ;
0
115 pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey);-
116 }
never executed: end of block
0
117-
118 job = sk_ASYNC_JOB_pop(pool->jobs);-
119 if (job ==
job == ((void *)0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-7
120 ((void *)0)
job == ((void *)0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-7
121 ) {-
122-
123 if ((
(pool->max_size != 0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
pool->max_size != 0)
(pool->max_size != 0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(pool->curr_si...ool->max_size)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pool->curr_size >= pool->max_size)
(pool->curr_si...ool->max_size)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-7
124 return
executed 1 time by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 1 time by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
1
125 ((void *)0)
executed 1 time by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
1
126 ;
executed 1 time by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
1
127-
128 job = async_job_new();-
129 if (job !=
job != ((void *)0)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-6
130 ((void *)0)
job != ((void *)0)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-6
131 ) {-
132 if (! async_fibre_makecontext(&job->fibrectx)
! async_fibre_...job->fibrectx)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-6
133 async_job_free(job);-
134 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
135 ((void *)0)
never executed: return ((void *)0) ;
0
136 ;
never executed: return ((void *)0) ;
0
137 }-
138 pool->curr_size++;-
139 }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6
140 }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6
141 return
executed 7 times by 1 test: return job;
Executed by:
  • libcrypto.so.1.1
job;
executed 7 times by 1 test: return job;
Executed by:
  • libcrypto.so.1.1
7
142}-
143-
144static void async_release_job(ASYNC_JOB *job) {-
145 async_pool *pool;-
146-
147 pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey);-
148 CRYPTO_free(job->funcargs, __FILE__, 139);-
149 job->funcargs = -
150 ((void *)0)-
151 ;-
152 sk_ASYNC_JOB_push(pool->jobs, job);-
153}
executed 7 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7
154-
155void async_start_func(void)-
156{-
157 ASYNC_JOB *job;-
158 async_ctx *ctx = async_get_ctx();-
159-
160 while (1) {-
161-
162 job = ctx->currjob;-
163 job->ret = job->func(job->funcargs);-
164-
165-
166 job->status = 3;-
167 if (!async_fibre_swapcontext(&job->fibrectx,
!async_fibre_s...dispatcher, 1)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
168 &ctx->dispatcher, 1)
!async_fibre_s...dispatcher, 1)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1
169-
170-
171-
172-
173 ERR_put_error(51,(104),(102),__FILE__,162);-
174 }
never executed: end of block
0
175 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
176}
never executed: end of block
0
177-
178int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *wctx, int *ret,-
179 int (*func)(void *), void *args, size_t size)-
180{-
181 async_ctx *ctx;-
182-
183 if (!OPENSSL_init_crypto(0x00000100L,
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-17
184 ((void *)0)
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-17
185 )
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-17
186 return
never executed: return 0;
0;
never executed: return 0;
0
187-
188 ctx = async_get_ctx();-
189 if (ctx ==
ctx == ((void *)0)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5-12
190 ((void *)0)
ctx == ((void *)0)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5-12
191 )-
192 ctx = async_ctx_new();
executed 5 times by 1 test: ctx = async_ctx_new();
Executed by:
  • libcrypto.so.1.1
5
193 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-17
194 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-17
195 )-
196 return
never executed: return 0;
0;
never executed: return 0;
0
197-
198 if (*
*jobDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
job
*jobDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
8-9
199 ctx->currjob = *job;
executed 9 times by 1 test: ctx->currjob = *job;
Executed by:
  • libcrypto.so.1.1
9
200-
201 for (;;) {-
202 if (ctx->currjob !=
ctx->currjob != ((void *)0)Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8-25
203 ((void *)0)
ctx->currjob != ((void *)0)Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8-25
204 ) {-
205 if (ctx->currjob->status == 3
ctx->currjob->status == 3Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
7-18
206 *ret = ctx->currjob->ret;-
207 ctx->currjob->waitctx = -
208 ((void *)0)-
209 ;-
210 async_release_job(ctx->currjob);-
211 ctx->currjob = -
212 ((void *)0)-
213 ;-
214 *job = -
215 ((void *)0)-
216 ;-
217 return
executed 7 times by 1 test: return 3;
Executed by:
  • libcrypto.so.1.1
3;
executed 7 times by 1 test: return 3;
Executed by:
  • libcrypto.so.1.1
7
218 }-
219-
220 if (ctx->currjob->status == 1
ctx->currjob->status == 1Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
9
221 *job = ctx->currjob;-
222 ctx->currjob->status = 2;-
223 ctx->currjob = -
224 ((void *)0)-
225 ;-
226 return
executed 9 times by 1 test: return 2;
Executed by:
  • libcrypto.so.1.1
2;
executed 9 times by 1 test: return 2;
Executed by:
  • libcrypto.so.1.1
9
227 }-
228-
229 if (ctx->currjob->status == 2
ctx->currjob->status == 2Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-9
230 ctx->currjob = *job;-
231-
232 if (!async_fibre_swapcontext(&ctx->dispatcher,
!async_fibre_s...->fibrectx, 1)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9
233 &ctx->currjob->fibrectx, 1)
!async_fibre_s...->fibrectx, 1)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-9
234 ERR_put_error(51,(105),(102),__FILE__,208)-
235 ;-
236 goto
never executed: goto err;
err;
never executed: goto err;
0
237 }-
238 continue;
executed 9 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
9
239 }-
240-
241-
242 ERR_put_error(51,(105),((4|64)),__FILE__,215);-
243 async_release_job(ctx->currjob);-
244 ctx->currjob = -
245 ((void *)0)-
246 ;-
247 *job = -
248 ((void *)0)-
249 ;-
250 return
never executed: return 0;
0;
never executed: return 0;
0
251 }-
252-
253-
254 if ((
(ctx->currjob ...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx->currjob = async_get_pool_job()) ==
(ctx->currjob ...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-7
255 ((void *)0)
(ctx->currjob ...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-7
256 )-
257 return
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1
258-
259 if (args !=
args != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7
260 ((void *)0)
args != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7
261 ) {-
262 ctx->currjob->funcargs = CRYPTO_malloc(size, __FILE__, 227);-
263 if (ctx->currjob->funcargs ==
ctx->currjob->...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
264 ((void *)0)
ctx->currjob->...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
265 ) {-
266 ERR_put_error(51,(105),((1|64)),__FILE__,229);-
267 async_release_job(ctx->currjob);-
268 ctx->currjob = -
269 ((void *)0)-
270 ;-
271 return
never executed: return 0;
0;
never executed: return 0;
0
272 }-
273 memcpy(ctx->currjob->funcargs, args, size);-
274 }
never executed: end of block
else {
0
275 ctx->currjob->funcargs = -
276 ((void *)0)-
277 ;-
278 }
executed 7 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7
279-
280 ctx->currjob->func = func;-
281 ctx->currjob->waitctx = wctx;-
282 if (!async_fibre_swapcontext(&ctx->dispatcher,
!async_fibre_s...->fibrectx, 1)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7
283 &ctx->currjob->fibrectx, 1)
!async_fibre_s...->fibrectx, 1)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-7
284 ERR_put_error(51,(105),(102),__FILE__,243);-
285 goto
never executed: goto err;
err;
never executed: goto err;
0
286 }-
287 }
executed 7 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7
288-
289err:
code before this statement never executed: err:
0
290 async_release_job(ctx->currjob);-
291 ctx->currjob = -
292 ((void *)0)-
293 ;-
294 *job = -
295 ((void *)0)-
296 ;-
297 return
never executed: return 0;
0;
never executed: return 0;
0
298}-
299-
300int ASYNC_pause_job(void)-
301{-
302 ASYNC_JOB *job;-
303 async_ctx *ctx = async_get_ctx();-
304-
305 if (ctx ==
ctx == ((void *)0)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
9-10
306 ((void *)0)
ctx == ((void *)0)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
9-10
307 -
308 || ctx->currjob ==
ctx->currjob == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10
309 ((void *)0)
ctx->currjob == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10
310 -
311 || ctx->blocked
ctx->blockedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-9
312-
313-
314-
315-
316 return
executed 10 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 10 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
10
317 }-
318-
319 job = ctx->currjob;-
320 job->status = 1;-
321-
322 if (!async_fibre_swapcontext(&job->fibrectx,
!async_fibre_s...dispatcher, 1)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9
323 &ctx->dispatcher, 1)
!async_fibre_s...dispatcher, 1)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-9
324 ERR_put_error(51,(103),(102),__FILE__,275);-
325 return
never executed: return 0;
0;
never executed: return 0;
0
326 }-
327-
328 async_wait_ctx_reset_counts(job->waitctx);-
329-
330 return
executed 9 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 9 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
9
331}-
332-
333static void async_empty_pool(async_pool *pool)-
334{-
335 ASYNC_JOB *job;-
336-
337 if (!pool
!poolDescription
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !pool->jobs
!pool->jobsDescription
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
338 return;
never executed: return;
0
339-
340 do {-
341 job = sk_ASYNC_JOB_pop(pool->jobs);-
342 async_job_free(job);-
343 }
executed 11 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
while (job
jobDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
);
5-11
344}
executed 5 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5
345-
346int async_init(void)-
347{-
348 if (!CRYPTO_THREAD_init_local(&ctxkey,
!CRYPTO_THREAD... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
349 ((void *)0)
!CRYPTO_THREAD... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
350 )
!CRYPTO_THREAD... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4
351 return
never executed: return 0;
0;
never executed: return 0;
0
352-
353 if (!CRYPTO_THREAD_init_local(&poolkey,
!CRYPTO_THREAD... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
354 ((void *)0)
!CRYPTO_THREAD... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
355 )
!CRYPTO_THREAD... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4
356 CRYPTO_THREAD_cleanup_local(&ctxkey);-
357 return
never executed: return 0;
0;
never executed: return 0;
0
358 }-
359-
360 return
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
4
361}-
362-
363void async_deinit(void)-
364{-
365 CRYPTO_THREAD_cleanup_local(&ctxkey);-
366 CRYPTO_THREAD_cleanup_local(&poolkey);-
367}
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
368-
369int ASYNC_init_thread(size_t max_size, size_t init_size)-
370{-
371 async_pool *pool;-
372 size_t curr_size = 0;-
373-
374 if (init_size > max_size
init_size > max_sizeDescription
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5
375 ERR_put_error(51,(101),(103),__FILE__,322);-
376 return
never executed: return 0;
0;
never executed: return 0;
0
377 }-
378-
379 if (!OPENSSL_init_crypto(0x00000100L,
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
380 ((void *)0)
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
381 )
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
382 return
never executed: return 0;
0;
never executed: return 0;
0
383-
384 if (!ossl_init_thread_start(0x01)
!ossl_init_thread_start(0x01)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
385 return
never executed: return 0;
0;
never executed: return 0;
0
386-
387 pool = CRYPTO_zalloc(sizeof(*pool), __FILE__, 332);-
388 if (pool ==
pool == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
389 ((void *)0)
pool == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
390 ) {-
391 ERR_put_error(51,(101),((1|64)),__FILE__,334);-
392 return
never executed: return 0;
0;
never executed: return 0;
0
393 }-
394-
395 pool->jobs = sk_ASYNC_JOB_new_reserve(-
396 ((void *)0)-
397 , init_size);-
398 if (pool->jobs ==
pool->jobs == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
399 ((void *)0)
pool->jobs == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
400 ) {-
401 ERR_put_error(51,(101),((1|64)),__FILE__,340);-
402 CRYPTO_free(pool, __FILE__, 341);-
403 return
never executed: return 0;
0;
never executed: return 0;
0
404 }-
405-
406 pool->max_size = max_size;-
407-
408-
409 while (init_size--
init_size--Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5
410 ASYNC_JOB *job;-
411 job = async_job_new();-
412 if (job ==
job == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
413 ((void *)0)
job == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
414 || !async_fibre_makecontext(&job->fibrectx)
!async_fibre_m...job->fibrectx)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
415-
416-
417-
418-
419 async_job_free(job);-
420 break;
never executed: break;
0
421 }-
422 job->funcargs = -
423 ((void *)0)-
424 ;-
425 sk_ASYNC_JOB_push(pool->jobs, job);-
426 curr_size++;-
427 }
never executed: end of block
0
428 pool->curr_size = curr_size;-
429 if (!CRYPTO_THREAD_set_local(&poolkey, pool)
!CRYPTO_THREAD...poolkey, pool)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5
430 ERR_put_error(51,(101),(101),__FILE__,365);-
431 goto
never executed: goto err;
err;
never executed: goto err;
0
432 }-
433-
434 return
executed 5 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 5 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
5
435err:-
436 async_empty_pool(pool);-
437 sk_ASYNC_JOB_free(pool->jobs);-
438 CRYPTO_free(pool, __FILE__, 373);-
439 return
never executed: return 0;
0;
never executed: return 0;
0
440}-
441-
442void async_delete_thread_state(void)-
443{-
444 async_pool *pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey);-
445-
446 if (pool !=
pool != ((void *)0)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-5
447 ((void *)0)
pool != ((void *)0)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-5
448 ) {-
449 async_empty_pool(pool);-
450 sk_ASYNC_JOB_free(pool->jobs);-
451 CRYPTO_free(pool, __FILE__, 384);-
452 CRYPTO_THREAD_set_local(&poolkey, -
453 ((void *)0)-
454 );-
455 }
executed 5 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5
456 async_local_cleanup();-
457 async_ctx_free();-
458}
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6
459-
460void ASYNC_cleanup_thread(void)-
461{-
462 if (!OPENSSL_init_crypto(0x00000100L,
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
463 ((void *)0)
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
464 )
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
465 return;
never executed: return;
0
466-
467 async_delete_thread_state();-
468}
executed 5 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5
469-
470ASYNC_JOB *ASYNC_get_current_job(void)-
471{-
472 async_ctx *ctx;-
473-
474 if (!OPENSSL_init_crypto(0x00000100L,
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
475 ((void *)0)
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
476 )
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-8
477 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
478 ((void *)0)
never executed: return ((void *)0) ;
0
479 ;
never executed: return ((void *)0) ;
0
480-
481 ctx = async_get_ctx();-
482 if (ctx ==
ctx == ((void *)0)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-6
483 ((void *)0)
ctx == ((void *)0)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-6
484 )-
485 return
executed 6 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 6 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
6
486 ((void *)0)
executed 6 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
6
487 ;
executed 6 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
6
488-
489 return
executed 2 times by 1 test: return ctx->currjob;
Executed by:
  • libcrypto.so.1.1
ctx->currjob;
executed 2 times by 1 test: return ctx->currjob;
Executed by:
  • libcrypto.so.1.1
2
490}-
491-
492ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job)-
493{-
494 return
executed 1 time by 1 test: return job->waitctx;
Executed by:
  • libcrypto.so.1.1
job->waitctx;
executed 1 time by 1 test: return job->waitctx;
Executed by:
  • libcrypto.so.1.1
1
495}-
496-
497void ASYNC_block_pause(void)-
498{-
499 async_ctx *ctx;-
500-
501 if (!OPENSSL_init_crypto(0x00000100L,
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
502 ((void *)0)
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
503 )
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
504 return;
never executed: return;
0
505-
506 ctx = async_get_ctx();-
507 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
508 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
509 || ctx->currjob ==
ctx->currjob == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
510 ((void *)0)
ctx->currjob == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
511 ) {-
512-
513-
514-
515 return;
never executed: return;
0
516 }-
517 ctx->blocked++;-
518}
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
519-
520void ASYNC_unblock_pause(void)-
521{-
522 async_ctx *ctx;-
523-
524 if (!OPENSSL_init_crypto(0x00000100L,
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
525 ((void *)0)
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
526 )
!OPENSSL_init_... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
527 return;
never executed: return;
0
528-
529 ctx = async_get_ctx();-
530 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
531 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
532 || ctx->currjob ==
ctx->currjob == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
533 ((void *)0)
ctx->currjob == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
534 ) {-
535-
536-
537-
538 return;
never executed: return;
0
539 }-
540 if (ctx->blocked > 0
ctx->blocked > 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-1
541 ctx->blocked--;
executed 1 time by 1 test: ctx->blocked--;
Executed by:
  • libcrypto.so.1.1
1
542}
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2