summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2015-04-23 10:56:31 +0000
committerNick Mathewson <nickm@torproject.org>2015-05-13 11:13:07 -0400
commit53a347592aa5311f8910125cef1d1814cd7088d5 (patch)
tree32751b00715988fa3a8c56f076980f05a7a0c3ef /src
parent614d9bc9674cfb7807b0423bb43fc1c184501144 (diff)
downloadtor-53a347592aa5311f8910125cef1d1814cd7088d5.tar.gz
tor-53a347592aa5311f8910125cef1d1814cd7088d5.zip
ERR_remove_state() is deprecated since OpenSSL 1.0.0.
OpenSSL 1.1.0 must be built with "enable-deprecated", and compiled with `OPENSSL_USE_DEPRECATED` for this to work, so instead, use the newer routine as appropriate.
Diffstat (limited to 'src')
-rw-r--r--src/common/crypto.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 218c7bea1e..a68294a756 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -405,7 +405,11 @@ crypto_global_init(int useAccel, const char *accelName, const char *accelDir)
void
crypto_thread_cleanup(void)
{
+#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,0)
+ ERR_remove_thread_state(NULL);
+#else
ERR_remove_state(0);
+#endif
}
/** used by tortls.c: wrap an RSA* in a crypto_pk_t. */
@@ -3157,7 +3161,11 @@ int
crypto_global_cleanup(void)
{
EVP_cleanup();
+#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,0)
+ ERR_remove_thread_state(NULL);
+#else
ERR_remove_state(0);
+#endif
ERR_free_strings();
if (dh_param_p)