diff options
author | bcook <> | 2018-11-11 06:41:28 +0000 |
---|---|---|
committer | bcook <> | 2018-11-11 06:41:28 +0000 |
commit | c3082ab78ba758ef51c552b6a91bdf1236de0cf8 (patch) | |
tree | 6d18ff101148258c403e820ff423d10a65fba89e /src/lib/libcrypto/crypto_init.c | |
parent | 32ccc9aa9f3dd1c0efa02d4b21376521a91e4705 (diff) | |
download | openbsd-c3082ab78ba758ef51c552b6a91bdf1236de0cf8.tar.gz openbsd-c3082ab78ba758ef51c552b6a91bdf1236de0cf8.tar.bz2 openbsd-c3082ab78ba758ef51c552b6a91bdf1236de0cf8.zip |
Add automatic threading initialization for libcrypto.
This implements automatic thread support initialization in libcrypto.
This does not remove any functions from the ABI, but does turn them into
no-ops. Stub implementations of pthread_mutex_(init|lock|unlock) are
provided for ramdisks.
This does not implement the new OpenSSL 1.1 thread API internally,
keeping the original CRYTPO_lock / CRYPTO_add_lock functions for library
locking. For -portable, crypto_lock.c can be reimplemented with
OS-specific primitives as needed.
ok beck@, tb@, looks sane guenther@
Diffstat (limited to 'src/lib/libcrypto/crypto_init.c')
-rw-r--r-- | src/lib/libcrypto/crypto_init.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/libcrypto/crypto_init.c b/src/lib/libcrypto/crypto_init.c index 08fb55ffd5..3745e2e718 100644 --- a/src/lib/libcrypto/crypto_init.c +++ b/src/lib/libcrypto/crypto_init.c | |||
@@ -30,6 +30,8 @@ int OpenSSL_no_config(void); | |||
30 | 30 | ||
31 | static pthread_t crypto_init_thread; | 31 | static pthread_t crypto_init_thread; |
32 | 32 | ||
33 | void crypto_init_locks(void); | ||
34 | |||
33 | static void | 35 | static void |
34 | OPENSSL_init_crypto_internal(void) | 36 | OPENSSL_init_crypto_internal(void) |
35 | { | 37 | { |
@@ -38,6 +40,7 @@ OPENSSL_init_crypto_internal(void) | |||
38 | ERR_load_crypto_strings(); | 40 | ERR_load_crypto_strings(); |
39 | OpenSSL_add_all_ciphers(); | 41 | OpenSSL_add_all_ciphers(); |
40 | OpenSSL_add_all_digests(); | 42 | OpenSSL_add_all_digests(); |
43 | crypto_init_locks(); | ||
41 | } | 44 | } |
42 | 45 | ||
43 | int | 46 | int |