diff options
Diffstat (limited to 'src/lib/libcrypto/crypto_init.c')
-rw-r--r-- | src/lib/libcrypto/crypto_init.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/libcrypto/crypto_init.c b/src/lib/libcrypto/crypto_init.c index f3d1a2bce9..ed2b5d4810 100644 --- a/src/lib/libcrypto/crypto_init.c +++ b/src/lib/libcrypto/crypto_init.c | |||
@@ -25,6 +25,9 @@ | |||
25 | #include <openssl/err.h> | 25 | #include <openssl/err.h> |
26 | #include "cryptlib.h" | 26 | #include "cryptlib.h" |
27 | 27 | ||
28 | int OpenSSL_config(char *); | ||
29 | int OpenSSL_no_config(char *); | ||
30 | |||
28 | static pthread_t crypto_init_thread; | 31 | static pthread_t crypto_init_thread; |
29 | 32 | ||
30 | static void | 33 | static void |
@@ -35,7 +38,6 @@ OPENSSL_init_crypto_internal(void) | |||
35 | ERR_load_crypto_strings(); | 38 | ERR_load_crypto_strings(); |
36 | OpenSSL_add_all_ciphers(); | 39 | OpenSSL_add_all_ciphers(); |
37 | OpenSSL_add_all_digests(); | 40 | OpenSSL_add_all_digests(); |
38 | OPENSSL_config(NULL); | ||
39 | } | 41 | } |
40 | 42 | ||
41 | int | 43 | int |
@@ -46,11 +48,16 @@ OPENSSL_init_crypto(uint64_t opts, const void *settings) | |||
46 | if (pthread_equal(pthread_self(), crypto_init_thread)) | 48 | if (pthread_equal(pthread_self(), crypto_init_thread)) |
47 | return 1; /* don't recurse */ | 49 | return 1; /* don't recurse */ |
48 | 50 | ||
49 | if (opts & OPENSSL_INIT_NO_LOAD_CONFIG) | ||
50 | OPENSSL_no_config(); | ||
51 | |||
52 | if (pthread_once(&once, OPENSSL_init_crypto_internal) != 0) | 51 | if (pthread_once(&once, OPENSSL_init_crypto_internal) != 0) |
53 | return 0; | 52 | return 0; |
54 | 53 | ||
54 | if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG) && | ||
55 | (OpenSSL_no_config(NULL) == 0)) | ||
56 | return 0; | ||
57 | |||
58 | if ((opts & OPENSSL_INIT_LOAD_CONFIG) && | ||
59 | (OpenSSL_config(NULL) == 0)) | ||
60 | return 0; | ||
61 | |||
55 | return 1; | 62 | return 1; |
56 | } | 63 | } |