]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
ERR_remove_state() is deprecated since OpenSSL 1.0.0.
authorYawning Angel <yawning@schwanenlied.me>
Thu, 23 Apr 2015 10:56:31 +0000 (10:56 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 13 May 2015 15:13:07 +0000 (11:13 -0400)
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.

src/common/crypto.c

index 218c7bea1ee988688164c9a19957ba9f4d39c21e..a68294a75672679d4ef982454dd399786a8f8b93 100644 (file)
@@ -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)