Blame crypto/store/store_init.c
|
Packit Service |
084de1 |
/*
|
|
Packit Service |
084de1 |
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
|
Packit Service |
084de1 |
*
|
|
Packit Service |
084de1 |
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
Packit Service |
084de1 |
* this file except in compliance with the License. You can obtain a copy
|
|
Packit Service |
084de1 |
* in the file LICENSE in the source distribution or at
|
|
Packit Service |
084de1 |
* https://www.openssl.org/source/license.html
|
|
Packit Service |
084de1 |
*/
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
#include <openssl/err.h>
|
|
Packit Service |
084de1 |
#include "crypto/store.h"
|
|
Packit Service |
084de1 |
#include "store_local.h"
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
static CRYPTO_ONCE store_init = CRYPTO_ONCE_STATIC_INIT;
|
|
Packit Service |
084de1 |
DEFINE_RUN_ONCE_STATIC(do_store_init)
|
|
Packit Service |
084de1 |
{
|
|
Packit Service |
084de1 |
return OPENSSL_init_crypto(0, NULL)
|
|
Packit Service |
084de1 |
&& ossl_store_file_loader_init();
|
|
Packit Service |
084de1 |
}
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
int ossl_store_init_once(void)
|
|
Packit Service |
084de1 |
{
|
|
Packit Service |
084de1 |
if (!RUN_ONCE(&store_init, do_store_init)) {
|
|
Packit Service |
084de1 |
OSSL_STOREerr(OSSL_STORE_F_OSSL_STORE_INIT_ONCE, ERR_R_MALLOC_FAILURE);
|
|
Packit Service |
084de1 |
return 0;
|
|
Packit Service |
084de1 |
}
|
|
Packit Service |
084de1 |
return 1;
|
|
Packit Service |
084de1 |
}
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
void ossl_store_cleanup_int(void)
|
|
Packit Service |
084de1 |
{
|
|
Packit Service |
084de1 |
ossl_store_destroy_loaders_int();
|
|
Packit Service |
084de1 |
}
|