When config'd with "no-async" the ASYNC_NULL implementation is used, so
async symbols still exist. We should still init the NULL implementation so
that when we get the async ctx it is NULL rather than undefined.
Reviewed-by: Rich Salz <rsalz@openssl.org>
-#ifndef OPENSSL_NO_ASYNC
static CRYPTO_ONCE async = CRYPTO_ONCE_STATIC_INIT;
static int async_inited = 0;
static void ossl_init_async(void)
static CRYPTO_ONCE async = CRYPTO_ONCE_STATIC_INIT;
static int async_inited = 0;
static void ossl_init_async(void)
async_init();
async_inited = 1;
}
async_init();
async_inited = 1;
}
#ifndef OPENSSL_NO_ENGINE
static CRYPTO_ONCE engine_openssl = CRYPTO_ONCE_STATIC_INIT;
#ifndef OPENSSL_NO_ENGINE
static CRYPTO_ONCE engine_openssl = CRYPTO_ONCE_STATIC_INIT;
if (locals == NULL)
return;
if (locals == NULL)
return;
-#ifndef OPENSSL_NO_ASYNC
if (locals->async) {
#ifdef OPENSSL_INIT_DEBUG
fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_stop: "
if (locals->async) {
#ifdef OPENSSL_INIT_DEBUG
fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_stop: "
#endif
ASYNC_cleanup_thread();
}
#endif
ASYNC_cleanup_thread();
}
if (locals->err_state) {
#ifdef OPENSSL_INIT_DEBUG
if (locals->err_state) {
#ifdef OPENSSL_INIT_DEBUG
-#ifndef OPENSSL_NO_ASYNC
if (async_inited) {
# ifdef OPENSSL_INIT_DEBUG
fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
if (async_inited) {
# ifdef OPENSSL_INIT_DEBUG
fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
# endif
async_deinit();
}
# endif
async_deinit();
}
if (load_crypto_strings_inited) {
#ifdef OPENSSL_INIT_DEBUG
if (load_crypto_strings_inited) {
#ifdef OPENSSL_INIT_DEBUG
-#ifndef OPENSSL_NO_ASYNC
if ((opts & OPENSSL_INIT_ASYNC)
&& !CRYPTO_THREAD_run_once(&async, ossl_init_async))
return 0;
if ((opts & OPENSSL_INIT_ASYNC)
&& !CRYPTO_THREAD_run_once(&async, ossl_init_async))
return 0;
#ifndef OPENSSL_NO_ENGINE
if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
&& !CRYPTO_THREAD_run_once(&engine_openssl,
#ifndef OPENSSL_NO_ENGINE
if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
&& !CRYPTO_THREAD_run_once(&engine_openssl,