diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-05-03 13:33:14 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-05-03 13:33:14 -0400 |
commit | 89cafc4afac37ee3c9186f5c600cdf2fba1d7d1c (patch) | |
tree | e8820cb54aca9e61ec9c9343e89d29943ead2570 /src/common/crypto.c | |
parent | 5e0316142f14df890e34180dba087cd0264fba70 (diff) | |
download | tor-89cafc4afac37ee3c9186f5c600cdf2fba1d7d1c.tar.gz tor-89cafc4afac37ee3c9186f5c600cdf2fba1d7d1c.zip |
Use OPENSSL_1_1_API in place of raw OPENSSL_VERSION_NUMBER checks
This is needed for libressl-2.6.4 compatibility, which we broke when
we merged a15b2c57e1f901c53 to fix bug 19981. Fixes bug 26005; bug
not in any released Tor.
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index c98a968757..3943465020 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -205,7 +205,7 @@ crypto_early_init(void) crypto_early_initialized_ = 1; -#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,0) +#ifdef OPENSSL_1_1_API OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS | OPENSSL_INIT_ADD_ALL_CIPHERS | @@ -1668,13 +1668,13 @@ memwipe(void *mem, uint8_t byte, size_t sz) int crypto_global_cleanup(void) { -#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0) +#ifndef OPENSSL_1_1_API EVP_cleanup(); #endif #ifndef NEW_THREAD_API ERR_remove_thread_state(NULL); #endif -#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0) +#ifndef OPENSSL_1_1_API ERR_free_strings(); #endif @@ -1688,13 +1688,13 @@ crypto_global_cleanup(void) dh_param_p = dh_param_p_tls = dh_param_g = NULL; #ifndef DISABLE_ENGINES -#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0) +#ifndef OPENSSL_1_1_API ENGINE_cleanup(); #endif #endif CONF_modules_unload(1); -#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0) +#ifndef OPENSSL_1_1_API CRYPTO_cleanup_all_ex_data(); #endif |