diff options
author | Anderson Toshiyuki Sasaki <ansasaki@redhat.com> | 2018-11-13 11:35:28 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-11-30 18:57:39 +0100 |
commit | d5bc9a1aceb4c4286ac4bb368dc015ffbdb1af3c (patch) | |
tree | 3ff52faf655da8f535b711a283992775ebcda287 | |
parent | 80d3e10b47b6757b56e8bea9160608296de9b095 (diff) | |
download | libssh-d5bc9a1aceb4c4286ac4bb368dc015ffbdb1af3c.tar.gz libssh-d5bc9a1aceb4c4286ac4bb368dc015ffbdb1af3c.tar.xz libssh-d5bc9a1aceb4c4286ac4bb368dc015ffbdb1af3c.zip |
libcrypto: Fix access violation in ssh_init()
This fixes an access violation when ssh_init() was called after
ssh_finalize() in Windows when using OpenSSL 1.0.2 and libssh statically
linked.
Fixes T120
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 41b0d263d6e57276cc3e2a2457d8ae48e1f56301)
-rw-r--r-- | src/threads/libcrypto.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/threads/libcrypto.c b/src/threads/libcrypto.c index 156e5041..5786948b 100644 --- a/src/threads/libcrypto.c +++ b/src/threads/libcrypto.c @@ -116,6 +116,14 @@ void crypto_thread_finalize(void) return; } +#ifdef HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK + CRYPTO_THREADID_set_callback(NULL); +#else + CRYPTO_set_id_callback(NULL); +#endif + + CRYPTO_set_locking_callback(NULL); + for (i = 0; i < n; ++i) { user_callbacks->mutex_destroy(&libcrypto_mutexes[i]); } |