diff options
Diffstat (limited to 'src/lib/libcrypto/engine/eng_all.c')
-rw-r--r-- | src/lib/libcrypto/engine/eng_all.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/lib/libcrypto/engine/eng_all.c b/src/lib/libcrypto/engine/eng_all.c index 7640cf7fcd..403ca6865d 100644 --- a/src/lib/libcrypto/engine/eng_all.c +++ b/src/lib/libcrypto/engine/eng_all.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: eng_all.c,v 1.29 2015/07/19 22:34:27 doug Exp $ */ | 1 | /* $OpenBSD: eng_all.c,v 1.30 2018/03/17 16:20:01 beck Exp $ */ |
2 | /* Written by Richard Levitte <richard@levitte.org> for the OpenSSL | 2 | /* Written by Richard Levitte <richard@levitte.org> for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -56,17 +56,16 @@ | |||
56 | * | 56 | * |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <pthread.h> | ||
60 | |||
59 | #include <openssl/opensslconf.h> | 61 | #include <openssl/opensslconf.h> |
60 | 62 | ||
61 | #include "cryptlib.h" | 63 | #include "cryptlib.h" |
62 | #include "eng_int.h" | 64 | #include "eng_int.h" |
63 | 65 | ||
64 | void | 66 | void |
65 | ENGINE_load_builtin_engines(void) | 67 | ENGINE_load_builtin_engines_internal(void) |
66 | { | 68 | { |
67 | /* Some ENGINEs need this */ | ||
68 | OPENSSL_cpuid_setup(); | ||
69 | |||
70 | #ifndef OPENSSL_NO_STATIC_ENGINE | 69 | #ifndef OPENSSL_NO_STATIC_ENGINE |
71 | #ifndef OPENSSL_NO_HW | 70 | #ifndef OPENSSL_NO_HW |
72 | #ifndef OPENSSL_NO_HW_PADLOCK | 71 | #ifndef OPENSSL_NO_HW_PADLOCK |
@@ -76,3 +75,14 @@ ENGINE_load_builtin_engines(void) | |||
76 | #endif | 75 | #endif |
77 | ENGINE_register_all_complete(); | 76 | ENGINE_register_all_complete(); |
78 | } | 77 | } |
78 | |||
79 | void | ||
80 | ENGINE_load_builtin_engines(void) | ||
81 | { | ||
82 | static pthread_once_t once = PTHREAD_ONCE_INIT; | ||
83 | |||
84 | /* Prayer and clean living lets you ignore errors, OpenSSL style */ | ||
85 | (void) OPENSSL_init_crypto(0, NULL); | ||
86 | |||
87 | (void) pthread_once(&once, ENGINE_load_builtin_engines_internal); | ||
88 | } | ||