mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
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>
This commit is contained in:
parent
c2757c3774
commit
44a9ed7df2
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user