diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2018-02-01 16:42:30 +0100 |
---|---|---|
committer | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2018-02-01 16:42:30 +0100 |
commit | 44a9ed7df225adee4a69a0cb8d9395ad17d783d8 (patch) | |
tree | dbee248e99fa303a9998e2e47f36128cead8c1e7 /src/common/crypto.c | |
parent | c2757c3774c4f191bdca5684eec4833a228c00c2 (diff) | |
download | tor-44a9ed7df225adee4a69a0cb8d9395ad17d783d8.tar.gz tor-44a9ed7df225adee4a69a0cb8d9395ad17d783d8.zip |
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@riseup.net>
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 107b53ad29..57ef4f3e4f 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. |