summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-12-23 09:58:36 -0500
committerNick Mathewson <nickm@torproject.org>2015-12-23 09:58:36 -0500
commit63658598250a906346d260c70678700e22c0fe01 (patch)
treed50f5c48f72e2988e589b80294fe9b3b82f35e5b
parentd7c841f4679521d423eb029d7307f10e15dbe133 (diff)
downloadtor-63658598250a906346d260c70678700e22c0fe01.tar.gz
tor-63658598250a906346d260c70678700e22c0fe01.zip
Disable the dynlock functions we were giving openssl.
OpenSSL doesn't use them, and fwict they were never called. If some version of openssl *does* start using them, we should test them before we turn them back on. See ticket 17926
-rw-r--r--changes/179263
-rw-r--r--src/common/crypto.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/changes/17926 b/changes/17926
new file mode 100644
index 0000000000..09bdbbeae7
--- /dev/null
+++ b/changes/17926
@@ -0,0 +1,3 @@
+ o Removed code:
+ - Remove code for OpenSSL dynamic locks; OpenSSL doesn't use them.
+ Closes ticket 17926.
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 22d938fec7..3a73b67c65 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -2973,6 +2973,10 @@ openssl_locking_cb_(int mode, int n, const char *file, int line)
tor_mutex_release(openssl_mutexes_[n]);
}
+#if 0
+/* This code is disabled, because OpenSSL never actually uses these callbacks.
+ */
+
/** OpenSSL helper type: wraps a Tor mutex so that OpenSSL can use it
* as a lock. */
struct CRYPTO_dynlock_value {
@@ -3017,6 +3021,7 @@ openssl_dynlock_destroy_cb_(struct CRYPTO_dynlock_value *v,
tor_mutex_free(v->lock);
tor_free(v);
}
+#endif
static void
tor_set_openssl_thread_id(CRYPTO_THREADID *threadid)
@@ -3038,9 +3043,11 @@ setup_openssl_threading(void)
openssl_mutexes_[i] = tor_mutex_new();
CRYPTO_set_locking_callback(openssl_locking_cb_);
CRYPTO_THREADID_set_callback(tor_set_openssl_thread_id);
+#if 0
CRYPTO_set_dynlock_create_callback(openssl_dynlock_create_cb_);
CRYPTO_set_dynlock_lock_callback(openssl_dynlock_lock_cb_);
CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy_cb_);
+#endif
return 0;
}