[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Remove commented functions in crypto module.



commit 44a9ed7df225adee4a69a0cb8d9395ad17d783d8
Author: Fernando Fernandez Mancera <ffmancera@xxxxxxxxxx>
Date:   Thu Feb 1 16:42:30 2018 +0100

    Remove commented functions in crypto module.
    
    OpenSSL never uses these callbacks anymore so the code is disabled.
    
    Fixes #25097.
    
    Signed-off-by: Fernando Fernandez Mancera <ffmancera@xxxxxxxxxx>
---
 src/common/crypto.c | 50 --------------------------------------------------
 1 file changed, 50 deletions(-)

diff --git a/src/common/crypto.c b/src/common/crypto.c
index 107b53ad2..57ef4f3e4 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -3273,56 +3273,6 @@ memwipe(void *mem, uint8_t byte, size_t sz)
   memset(mem, byte, sz);
 }
 
-#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 {
-  tor_mutex_t *lock;
-};
-
-/** OpenSSL callback function to allocate a lock: see CRYPTO_set_dynlock_*
- * documentation in OpenSSL's docs for more info. */
-static struct CRYPTO_dynlock_value *
-openssl_dynlock_create_cb_(const char *file, int line)
-{
-  struct CRYPTO_dynlock_value *v;
-  (void)file;
-  (void)line;
-  v = tor_malloc(sizeof(struct CRYPTO_dynlock_value));
-  v->lock = tor_mutex_new();
-  return v;
-}
-
-/** OpenSSL callback function to acquire or release a lock: see
- * CRYPTO_set_dynlock_* documentation in OpenSSL's docs for more info. */
-static void
-openssl_dynlock_lock_cb_(int mode, struct CRYPTO_dynlock_value *v,
-                         const char *file, int line)
-{
-  (void)file;
-  (void)line;
-  if (mode & CRYPTO_LOCK)
-    tor_mutex_acquire(v->lock);
-  else
-    tor_mutex_release(v->lock);
-}
-
-/** OpenSSL callback function to free a lock: see CRYPTO_set_dynlock_*
- * documentation in OpenSSL's docs for more info. */
-static void
-openssl_dynlock_destroy_cb_(struct CRYPTO_dynlock_value *v,
-                            const char *file, int line)
-{
-  (void)file;
-  (void)line;
-  tor_mutex_free(v->lock);
-  tor_free(v);
-}
-#endif /* 0 */
-
 /** @{ */
 /** Uninitialize the crypto library. Return 0 on success. Does not detect
  * failure.

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits