]>
Commit | Line | Data |
---|---|---|
71a5516d | 1 | /* |
83cf7abf | 2 | * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. |
71a5516d | 3 | * |
5c0d0c86 | 4 | * Licensed under the Apache License 2.0 (the "License"). You may not use |
71a5516d RL |
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 <openssl/err.h> | |
25f2138b | 11 | #include "crypto/store.h" |
706457b7 | 12 | #include "store_local.h" |
71a5516d RL |
13 | |
14 | static CRYPTO_ONCE store_init = CRYPTO_ONCE_STATIC_INIT; | |
15 | DEFINE_RUN_ONCE_STATIC(do_store_init) | |
16 | { | |
9c6da42d RL |
17 | return OPENSSL_init_crypto(0, NULL) |
18 | && ossl_store_file_loader_init(); | |
71a5516d RL |
19 | } |
20 | ||
3cb7c5cf | 21 | int ossl_store_init_once(void) |
71a5516d RL |
22 | { |
23 | if (!RUN_ONCE(&store_init, do_store_init)) { | |
24 | OSSL_STOREerr(OSSL_STORE_F_OSSL_STORE_INIT_ONCE, ERR_R_MALLOC_FAILURE); | |
25 | return 0; | |
26 | } | |
27 | return 1; | |
28 | } | |
29 | ||
30 | void ossl_store_cleanup_int(void) | |
31 | { | |
32 | ossl_store_destroy_loaders_int(); | |
33 | } |