]>
Commit | Line | Data |
---|---|---|
2390c573 | 1 | /* |
fecb3aae | 2 | * Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved. |
2390c573 RL |
3 | * |
4 | * Licensed under the Apache License 2.0 (the "License"). You may not use | |
5 | * this file except in compliance with the License. You can obtain a copy | |
6 | * in the file LICENSE in the source distribution or at | |
7 | * https://www.openssl.org/source/license.html | |
8 | */ | |
9 | ||
10 | #include <stdio.h> | |
11 | #include <string.h> | |
12 | ||
cf0932cd | 13 | #include "internal/thread_once.h" |
2390c573 RL |
14 | #include <openssl/bio.h> |
15 | #include <openssl/crypto.h> | |
16 | #include <openssl/trace.h> | |
17 | #include "internal/bio.h" | |
18 | #include "internal/nelem.h" | |
a935791d | 19 | #include "internal/refcount.h" |
25f2138b | 20 | #include "crypto/cryptlib.h" |
2390c573 | 21 | |
16a9d374 RL |
22 | #ifndef OPENSSL_NO_TRACE |
23 | ||
2390c573 RL |
24 | static CRYPTO_RWLOCK *trace_lock = NULL; |
25 | ||
26 | static const BIO *current_channel = NULL; | |
27 | ||
28 | /*- | |
29 | * INTERNAL TRACE CHANNEL IMPLEMENTATION | |
30 | * | |
31 | * For our own flexibility, all trace categories are associated with a | |
32 | * BIO sink object, also called the trace channel. Instead of a BIO object, | |
33 | * the application can also provide a callback function, in which case an | |
34 | * internal trace channel is attached, which simply calls the registered | |
35 | * callback function. | |
36 | */ | |
37 | static int trace_write(BIO *b, const char *buf, | |
38 | size_t num, size_t *written); | |
39 | static int trace_puts(BIO *b, const char *str); | |
40 | static long trace_ctrl(BIO *channel, int cmd, long argl, void *argp); | |
41 | static int trace_free(BIO *b); | |
42 | ||
43 | static const BIO_METHOD trace_method = { | |
44 | BIO_TYPE_SOURCE_SINK, | |
45 | "trace", | |
46 | trace_write, | |
47 | NULL, /* old write */ | |
48 | NULL, /* read_ex */ | |
49 | NULL, /* read */ | |
50 | trace_puts, | |
51 | NULL, /* gets */ | |
52 | trace_ctrl, /* ctrl */ | |
53 | NULL, /* create */ | |
54 | trace_free, /* free */ | |
55 | NULL, /* callback_ctrl */ | |
56 | }; | |
57 | ||
58 | struct trace_data_st { | |
59 | OSSL_trace_cb callback; | |
60 | int category; | |
61 | void *data; | |
62 | }; | |
63 | ||
64 | static int trace_write(BIO *channel, | |
65 | const char *buf, size_t num, size_t *written) | |
66 | { | |
67 | struct trace_data_st *ctx = BIO_get_data(channel); | |
13d06925 | 68 | size_t cnt = ctx->callback(buf, num, ctx->category, OSSL_TRACE_CTRL_WRITE, |
2390c573 RL |
69 | ctx->data); |
70 | ||
71 | *written = cnt; | |
72 | return cnt != 0; | |
73 | } | |
74 | ||
75 | static int trace_puts(BIO *channel, const char *str) | |
76 | { | |
77 | size_t written; | |
78 | ||
79 | if (trace_write(channel, str, strlen(str), &written)) | |
80 | return (int)written; | |
81 | ||
82 | return EOF; | |
83 | } | |
84 | ||
85 | static long trace_ctrl(BIO *channel, int cmd, long argl, void *argp) | |
86 | { | |
87 | struct trace_data_st *ctx = BIO_get_data(channel); | |
88 | ||
89 | switch (cmd) { | |
90 | case OSSL_TRACE_CTRL_BEGIN: | |
91 | case OSSL_TRACE_CTRL_END: | |
92 | /* We know that the callback is likely to return 0 here */ | |
93 | ctx->callback("", 0, ctx->category, cmd, ctx->data); | |
94 | return 1; | |
95 | default: | |
96 | break; | |
97 | } | |
98 | return -2; /* Unsupported */ | |
99 | } | |
100 | ||
101 | static int trace_free(BIO *channel) | |
102 | { | |
103 | if (channel == NULL) | |
104 | return 0; | |
105 | OPENSSL_free(BIO_get_data(channel)); | |
106 | return 1; | |
107 | } | |
16a9d374 | 108 | #endif |
2390c573 RL |
109 | |
110 | /*- | |
111 | * TRACE | |
112 | */ | |
113 | ||
114 | /* Helper struct and macro to get name string to number mapping */ | |
115 | struct trace_category_st { | |
116 | const char * const name; | |
117 | const int num; | |
118 | }; | |
119 | #define TRACE_CATEGORY_(name) { #name, OSSL_TRACE_CATEGORY_##name } | |
120 | ||
121 | static const struct trace_category_st trace_categories[] = { | |
3a8269b3 | 122 | TRACE_CATEGORY_(ALL), |
3b9e1a39 | 123 | TRACE_CATEGORY_(TRACE), |
5c641735 | 124 | TRACE_CATEGORY_(INIT), |
49b26f54 | 125 | TRACE_CATEGORY_(TLS), |
77359d22 | 126 | TRACE_CATEGORY_(TLS_CIPHER), |
bc362b9b | 127 | TRACE_CATEGORY_(CONF), |
184fb690 | 128 | #ifndef OPENSSL_NO_ENGINE |
f272be67 | 129 | TRACE_CATEGORY_(ENGINE_TABLE), |
f518e3e8 | 130 | TRACE_CATEGORY_(ENGINE_REF_COUNT), |
184fb690 | 131 | #endif |
3a9b3d2d | 132 | TRACE_CATEGORY_(PKCS5V2), |
a902e43d | 133 | TRACE_CATEGORY_(PKCS12_KEYGEN), |
5f8a5f46 | 134 | TRACE_CATEGORY_(PKCS12_DECRYPT), |
b9ce85f6 | 135 | TRACE_CATEGORY_(X509V3_POLICY), |
6e810f2d | 136 | TRACE_CATEGORY_(BN_CTX), |
e06c0a28 | 137 | TRACE_CATEGORY_(CMP), |
2897b009 | 138 | TRACE_CATEGORY_(STORE), |
de5008a4 | 139 | TRACE_CATEGORY_(DECODER), |
0b9f90f5 | 140 | TRACE_CATEGORY_(ENCODER), |
e8fdb060 DDO |
141 | TRACE_CATEGORY_(REF_COUNT), |
142 | TRACE_CATEGORY_(HTTP), | |
143 | }; /* KEEP THIS LIST IN SYNC with #define OSSL_TRACE_CATEGORY_... in trace.h */ | |
2390c573 RL |
144 | |
145 | const char *OSSL_trace_get_category_name(int num) | |
146 | { | |
147 | size_t i; | |
148 | ||
149 | for (i = 0; i < OSSL_NELEM(trace_categories); i++) | |
150 | if (trace_categories[i].num == num) | |
151 | return trace_categories[i].name; | |
152 | return NULL; /* not found */ | |
153 | } | |
154 | ||
155 | int OSSL_trace_get_category_num(const char *name) | |
156 | { | |
157 | size_t i; | |
158 | ||
159 | for (i = 0; i < OSSL_NELEM(trace_categories); i++) | |
fba140c7 | 160 | if (OPENSSL_strcasecmp(name, trace_categories[i].name) == 0) |
2390c573 RL |
161 | return trace_categories[i].num; |
162 | return -1; /* not found */ | |
163 | } | |
164 | ||
16a9d374 RL |
165 | #ifndef OPENSSL_NO_TRACE |
166 | ||
2390c573 RL |
167 | /* We use one trace channel for each trace category */ |
168 | static struct { | |
5afb177c | 169 | enum { SIMPLE_CHANNEL, CALLBACK_CHANNEL } type; |
2390c573 RL |
170 | BIO *bio; |
171 | char *prefix; | |
172 | char *suffix; | |
173 | } trace_channels[OSSL_TRACE_CATEGORY_NUM] = { | |
174 | { 0, NULL, NULL, NULL }, | |
175 | }; | |
176 | ||
16a9d374 RL |
177 | #endif |
178 | ||
3b9e1a39 | 179 | #ifndef OPENSSL_NO_TRACE |
e474a286 DMSP |
180 | |
181 | enum { | |
182 | CHANNEL, | |
183 | PREFIX, | |
184 | SUFFIX | |
185 | }; | |
186 | ||
3b9e1a39 RL |
187 | static int trace_attach_cb(int category, int type, const void *data) |
188 | { | |
189 | switch (type) { | |
e474a286 | 190 | case CHANNEL: |
3b9e1a39 RL |
191 | OSSL_TRACE2(TRACE, "Attach channel %p to category '%s'\n", |
192 | data, trace_categories[category].name); | |
193 | break; | |
e474a286 | 194 | case PREFIX: |
3b9e1a39 RL |
195 | OSSL_TRACE2(TRACE, "Attach prefix \"%s\" to category '%s'\n", |
196 | (const char *)data, trace_categories[category].name); | |
197 | break; | |
e474a286 | 198 | case SUFFIX: |
3b9e1a39 RL |
199 | OSSL_TRACE2(TRACE, "Attach suffix \"%s\" to category '%s'\n", |
200 | (const char *)data, trace_categories[category].name); | |
201 | break; | |
202 | default: /* No clue */ | |
203 | break; | |
204 | } | |
205 | return 1; | |
206 | } | |
207 | ||
208 | static int trace_detach_cb(int category, int type, const void *data) | |
209 | { | |
210 | switch (type) { | |
e474a286 | 211 | case CHANNEL: |
3b9e1a39 RL |
212 | OSSL_TRACE2(TRACE, "Detach channel %p from category '%s'\n", |
213 | data, trace_categories[category].name); | |
214 | break; | |
e474a286 | 215 | case PREFIX: |
3b9e1a39 RL |
216 | OSSL_TRACE2(TRACE, "Detach prefix \"%s\" from category '%s'\n", |
217 | (const char *)data, trace_categories[category].name); | |
218 | break; | |
e474a286 | 219 | case SUFFIX: |
3b9e1a39 RL |
220 | OSSL_TRACE2(TRACE, "Detach suffix \"%s\" from category '%s'\n", |
221 | (const char *)data, trace_categories[category].name); | |
222 | break; | |
223 | default: /* No clue */ | |
224 | break; | |
225 | } | |
226 | return 1; | |
227 | } | |
228 | ||
cf0932cd DDO |
229 | static int do_ossl_trace_init(void); |
230 | static CRYPTO_ONCE trace_inited = CRYPTO_ONCE_STATIC_INIT; | |
231 | DEFINE_RUN_ONCE_STATIC(ossl_trace_init) | |
232 | { | |
233 | return do_ossl_trace_init(); | |
234 | } | |
235 | ||
fe50e115 | 236 | static int set_trace_data(int category, int type, BIO **channel, |
3b9e1a39 RL |
237 | const char **prefix, const char **suffix, |
238 | int (*attach_cb)(int, int, const void *), | |
239 | int (*detach_cb)(int, int, const void *)) | |
240 | { | |
fe26f798 RL |
241 | BIO *curr_channel = NULL; |
242 | char *curr_prefix = NULL; | |
243 | char *curr_suffix = NULL; | |
244 | ||
cf0932cd DDO |
245 | /* Ensure do_ossl_trace_init() is called once */ |
246 | if (!RUN_ONCE(&trace_inited, ossl_trace_init)) | |
247 | return 0; | |
fe26f798 RL |
248 | |
249 | curr_channel = trace_channels[category].bio; | |
250 | curr_prefix = trace_channels[category].prefix; | |
251 | curr_suffix = trace_channels[category].suffix; | |
3b9e1a39 RL |
252 | |
253 | /* Make sure to run the detach callback first on all data */ | |
254 | if (prefix != NULL && curr_prefix != NULL) { | |
e474a286 | 255 | detach_cb(category, PREFIX, curr_prefix); |
3b9e1a39 RL |
256 | } |
257 | ||
258 | if (suffix != NULL && curr_suffix != NULL) { | |
e474a286 | 259 | detach_cb(category, SUFFIX, curr_suffix); |
3b9e1a39 RL |
260 | } |
261 | ||
262 | if (channel != NULL && curr_channel != NULL) { | |
e474a286 | 263 | detach_cb(category, CHANNEL, curr_channel); |
3b9e1a39 RL |
264 | } |
265 | ||
266 | /* After detach callbacks are done, clear data where appropriate */ | |
267 | if (prefix != NULL && curr_prefix != NULL) { | |
268 | OPENSSL_free(curr_prefix); | |
269 | trace_channels[category].prefix = NULL; | |
270 | } | |
271 | ||
272 | if (suffix != NULL && curr_suffix != NULL) { | |
273 | OPENSSL_free(curr_suffix); | |
274 | trace_channels[category].suffix = NULL; | |
275 | } | |
276 | ||
277 | if (channel != NULL && curr_channel != NULL) { | |
278 | BIO_free(curr_channel); | |
fe50e115 | 279 | trace_channels[category].type = 0; |
3b9e1a39 RL |
280 | trace_channels[category].bio = NULL; |
281 | } | |
282 | ||
283 | /* Before running callbacks are done, set new data where appropriate */ | |
284 | if (channel != NULL && *channel != NULL) { | |
fe50e115 | 285 | trace_channels[category].type = type; |
3b9e1a39 RL |
286 | trace_channels[category].bio = *channel; |
287 | } | |
288 | ||
289 | if (prefix != NULL && *prefix != NULL) { | |
290 | if ((curr_prefix = OPENSSL_strdup(*prefix)) == NULL) | |
291 | return 0; | |
292 | trace_channels[category].prefix = curr_prefix; | |
293 | } | |
294 | ||
295 | if (suffix != NULL && *suffix != NULL) { | |
296 | if ((curr_suffix = OPENSSL_strdup(*suffix)) == NULL) | |
297 | return 0; | |
298 | trace_channels[category].suffix = curr_suffix; | |
299 | } | |
300 | ||
301 | /* Finally, run the attach callback on the new data */ | |
302 | if (channel != NULL && *channel != NULL) { | |
e474a286 | 303 | attach_cb(category, CHANNEL, *channel); |
3b9e1a39 RL |
304 | } |
305 | ||
306 | if (prefix != NULL && *prefix != NULL) { | |
e474a286 | 307 | attach_cb(category, PREFIX, *prefix); |
3b9e1a39 RL |
308 | } |
309 | ||
310 | if (suffix != NULL && *suffix != NULL) { | |
e474a286 | 311 | attach_cb(category, SUFFIX, *suffix); |
3b9e1a39 RL |
312 | } |
313 | ||
314 | return 1; | |
315 | } | |
3b9e1a39 | 316 | |
cf0932cd | 317 | static int do_ossl_trace_init(void) |
2390c573 RL |
318 | { |
319 | trace_lock = CRYPTO_THREAD_lock_new(); | |
cf0932cd | 320 | return trace_lock != NULL; |
2390c573 RL |
321 | } |
322 | ||
cf0932cd DDO |
323 | #endif |
324 | ||
2390c573 RL |
325 | void ossl_trace_cleanup(void) |
326 | { | |
16a9d374 | 327 | #ifndef OPENSSL_NO_TRACE |
2390c573 | 328 | int category; |
3b9e1a39 RL |
329 | BIO *channel = NULL; |
330 | const char *prefix = NULL; | |
331 | const char *suffix = NULL; | |
332 | ||
333 | for (category = 0; category < OSSL_TRACE_CATEGORY_NUM; category++) { | |
334 | /* We force the TRACE category to be treated last */ | |
335 | if (category == OSSL_TRACE_CATEGORY_TRACE) | |
336 | continue; | |
fe50e115 | 337 | set_trace_data(category, 0, &channel, &prefix, &suffix, |
3b9e1a39 RL |
338 | trace_attach_cb, trace_detach_cb); |
339 | } | |
fe50e115 DMSP |
340 | set_trace_data(OSSL_TRACE_CATEGORY_TRACE, 0, &channel, |
341 | &prefix, &suffix, | |
3b9e1a39 | 342 | trace_attach_cb, trace_detach_cb); |
2390c573 | 343 | CRYPTO_THREAD_lock_free(trace_lock); |
16a9d374 | 344 | #endif |
2390c573 RL |
345 | } |
346 | ||
347 | int OSSL_trace_set_channel(int category, BIO *channel) | |
348 | { | |
16a9d374 | 349 | #ifndef OPENSSL_NO_TRACE |
0fda9f7c DMSP |
350 | if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM) |
351 | return set_trace_data(category, SIMPLE_CHANNEL, &channel, NULL, NULL, | |
02bd2d7f | 352 | trace_attach_cb, trace_detach_cb); |
16a9d374 | 353 | #endif |
0fda9f7c | 354 | return 0; |
2390c573 RL |
355 | } |
356 | ||
3b9e1a39 RL |
357 | #ifndef OPENSSL_NO_TRACE |
358 | static int trace_attach_w_callback_cb(int category, int type, const void *data) | |
359 | { | |
360 | switch (type) { | |
e474a286 | 361 | case CHANNEL: |
3b9e1a39 RL |
362 | OSSL_TRACE2(TRACE, |
363 | "Attach channel %p to category '%s' (with callback)\n", | |
364 | data, trace_categories[category].name); | |
365 | break; | |
e474a286 | 366 | case PREFIX: |
3b9e1a39 RL |
367 | OSSL_TRACE2(TRACE, "Attach prefix \"%s\" to category '%s'\n", |
368 | (const char *)data, trace_categories[category].name); | |
369 | break; | |
e474a286 | 370 | case SUFFIX: |
3b9e1a39 RL |
371 | OSSL_TRACE2(TRACE, "Attach suffix \"%s\" to category '%s'\n", |
372 | (const char *)data, trace_categories[category].name); | |
373 | break; | |
374 | default: /* No clue */ | |
375 | break; | |
376 | } | |
377 | return 1; | |
378 | } | |
379 | #endif | |
380 | ||
2390c573 RL |
381 | int OSSL_trace_set_callback(int category, OSSL_trace_cb callback, void *data) |
382 | { | |
16a9d374 | 383 | #ifndef OPENSSL_NO_TRACE |
3b9e1a39 | 384 | BIO *channel = NULL; |
2390c573 RL |
385 | struct trace_data_st *trace_data = NULL; |
386 | ||
3b9e1a39 | 387 | if (category < 0 || category >= OSSL_TRACE_CATEGORY_NUM) |
0fda9f7c | 388 | return 0; |
2390c573 | 389 | |
3b9e1a39 RL |
390 | if (callback != NULL) { |
391 | if ((channel = BIO_new(&trace_method)) == NULL | |
392 | || (trace_data = | |
393 | OPENSSL_zalloc(sizeof(struct trace_data_st))) == NULL) | |
394 | goto err; | |
2390c573 | 395 | |
3b9e1a39 RL |
396 | trace_data->callback = callback; |
397 | trace_data->category = category; | |
398 | trace_data->data = data; | |
2390c573 | 399 | |
3b9e1a39 RL |
400 | BIO_set_data(channel, trace_data); |
401 | } | |
2390c573 | 402 | |
fe50e115 | 403 | if (!set_trace_data(category, CALLBACK_CHANNEL, &channel, NULL, NULL, |
3b9e1a39 RL |
404 | trace_attach_w_callback_cb, trace_detach_cb)) |
405 | goto err; | |
2390c573 | 406 | |
0fda9f7c | 407 | return 1; |
2390c573 RL |
408 | |
409 | err: | |
410 | BIO_free(channel); | |
411 | OPENSSL_free(trace_data); | |
d33d7616 | 412 | #endif |
0fda9f7c DMSP |
413 | |
414 | return 0; | |
2390c573 RL |
415 | } |
416 | ||
417 | int OSSL_trace_set_prefix(int category, const char *prefix) | |
418 | { | |
16a9d374 | 419 | #ifndef OPENSSL_NO_TRACE |
0fda9f7c | 420 | if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM) |
fe50e115 | 421 | return set_trace_data(category, 0, NULL, &prefix, NULL, |
3b9e1a39 | 422 | trace_attach_cb, trace_detach_cb); |
16a9d374 | 423 | #endif |
0fda9f7c | 424 | return 0; |
2390c573 RL |
425 | } |
426 | ||
427 | int OSSL_trace_set_suffix(int category, const char *suffix) | |
428 | { | |
16a9d374 | 429 | #ifndef OPENSSL_NO_TRACE |
0fda9f7c | 430 | if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM) |
fe50e115 | 431 | return set_trace_data(category, 0, NULL, NULL, &suffix, |
3b9e1a39 | 432 | trace_attach_cb, trace_detach_cb); |
16a9d374 | 433 | #endif |
0fda9f7c | 434 | return 0; |
2390c573 RL |
435 | } |
436 | ||
16a9d374 | 437 | #ifndef OPENSSL_NO_TRACE |
2390c573 RL |
438 | static int ossl_trace_get_category(int category) |
439 | { | |
440 | if (category < 0 || category >= OSSL_TRACE_CATEGORY_NUM) | |
441 | return -1; | |
442 | if (trace_channels[category].bio != NULL) | |
443 | return category; | |
3a8269b3 | 444 | return OSSL_TRACE_CATEGORY_ALL; |
2390c573 | 445 | } |
16a9d374 | 446 | #endif |
2390c573 RL |
447 | |
448 | int OSSL_trace_enabled(int category) | |
449 | { | |
450 | int ret = 0; | |
16a9d374 | 451 | #ifndef OPENSSL_NO_TRACE |
2390c573 | 452 | category = ossl_trace_get_category(category); |
6a411436 DMSP |
453 | if (category >= 0) |
454 | ret = trace_channels[category].bio != NULL; | |
16a9d374 | 455 | #endif |
2390c573 RL |
456 | return ret; |
457 | } | |
458 | ||
459 | BIO *OSSL_trace_begin(int category) | |
460 | { | |
461 | BIO *channel = NULL; | |
16a9d374 | 462 | #ifndef OPENSSL_NO_TRACE |
2390c573 RL |
463 | char *prefix = NULL; |
464 | ||
465 | category = ossl_trace_get_category(category); | |
6a411436 DMSP |
466 | if (category < 0) |
467 | return NULL; | |
468 | ||
2390c573 RL |
469 | channel = trace_channels[category].bio; |
470 | prefix = trace_channels[category].prefix; | |
471 | ||
472 | if (channel != NULL) { | |
cd3f8c1b RS |
473 | if (!CRYPTO_THREAD_write_lock(trace_lock)) |
474 | return NULL; | |
2390c573 RL |
475 | current_channel = channel; |
476 | switch (trace_channels[category].type) { | |
5afb177c | 477 | case SIMPLE_CHANNEL: |
2390c573 RL |
478 | if (prefix != NULL) { |
479 | (void)BIO_puts(channel, prefix); | |
480 | (void)BIO_puts(channel, "\n"); | |
481 | } | |
482 | break; | |
5afb177c | 483 | case CALLBACK_CHANNEL: |
2390c573 RL |
484 | (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_BEGIN, |
485 | prefix == NULL ? 0 : strlen(prefix), prefix); | |
486 | break; | |
487 | } | |
488 | } | |
16a9d374 | 489 | #endif |
2390c573 RL |
490 | return channel; |
491 | } | |
492 | ||
493 | void OSSL_trace_end(int category, BIO * channel) | |
494 | { | |
16a9d374 | 495 | #ifndef OPENSSL_NO_TRACE |
2390c573 RL |
496 | char *suffix = NULL; |
497 | ||
498 | category = ossl_trace_get_category(category); | |
ee8a61e1 MC |
499 | if (category < 0) |
500 | return; | |
2390c573 RL |
501 | suffix = trace_channels[category].suffix; |
502 | if (channel != NULL | |
503 | && ossl_assert(channel == current_channel)) { | |
504 | (void)BIO_flush(channel); | |
505 | switch (trace_channels[category].type) { | |
5afb177c | 506 | case SIMPLE_CHANNEL: |
2390c573 RL |
507 | if (suffix != NULL) { |
508 | (void)BIO_puts(channel, suffix); | |
509 | (void)BIO_puts(channel, "\n"); | |
510 | } | |
511 | break; | |
5afb177c | 512 | case CALLBACK_CHANNEL: |
2390c573 RL |
513 | (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_END, |
514 | suffix == NULL ? 0 : strlen(suffix), suffix); | |
515 | break; | |
516 | } | |
517 | current_channel = NULL; | |
518 | CRYPTO_THREAD_unlock(trace_lock); | |
519 | } | |
16a9d374 | 520 | #endif |
2390c573 | 521 | } |