DEFINE_RUN_ONCE_STATIC(do_bio_lookup_init)
{
- if (!OPENSSL_init_crypto(0, NULL))
- return 0;
bio_lookup_lock = CRYPTO_THREAD_lock_new();
return bio_lookup_lock != NULL;
}
DEFINE_RUN_ONCE(do_engine_lock_init)
{
- if (!OPENSSL_init_crypto(0, NULL))
- return 0;
global_engine_lock = CRYPTO_THREAD_lock_new();
return global_engine_lock != NULL;
}
DEFINE_RUN_ONCE_STATIC(do_err_strings_init)
{
- if (!OPENSSL_init_crypto(0, NULL))
+ if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
return 0;
err_string_lock = CRYPTO_THREAD_lock_new();
if (err_string_lock == NULL)
* We need to ensure that base libcrypto thread handling has been
* initialised.
*/
- OPENSSL_init_crypto(0, NULL);
+ OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
#endif
dgbl->lock = CRYPTO_THREAD_lock_new();
* https://www.openssl.org/source/license.html
*/
-#include <openssl/err.h>
#include "crypto/store.h"
#include "store_local.h"
-static CRYPTO_ONCE store_init = CRYPTO_ONCE_STATIC_INIT;
-DEFINE_RUN_ONCE_STATIC(do_store_init)
-{
- return OPENSSL_init_crypto(0, NULL);
-}
-
-int ossl_store_init_once(void)
-{
- if (!RUN_ONCE(&store_init, do_store_init)) {
- ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_MALLOC_FAILURE);
- return 0;
- }
- return 1;
-}
-
void ossl_store_cleanup_int(void)
{
ossl_store_destroy_loaders_int();
struct ossl_passphrase_data_st pwdata;
};
-/*-
- * OSSL_STORE init stuff
- * ---------------------
- */
-
-int ossl_store_init_once(void);
-
/*-
* 'file' scheme stuff
* -------------------
}
int OSSL_STORE_register_loader(OSSL_STORE_LOADER *loader)
{
- if (!ossl_store_init_once())
- return 0;
return ossl_store_register_loader_int(loader);
}
template.close = NULL;
template.open_ex = NULL;
- if (!ossl_store_init_once())
- return NULL;
-
if (!RUN_ONCE(®istry_init, do_registry_init)) {
ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_MALLOC_FAILURE);
return NULL;
}
OSSL_STORE_LOADER *OSSL_STORE_unregister_loader(const char *scheme)
{
- if (!ossl_store_init_once())
- return 0;
return ossl_store_unregister_loader_int(scheme);
}