summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Christophe Fergeau2017-04-25 16:59:15 +0200
committerGravatar Christophe Fergeau2017-04-26 15:21:02 +0200
commitb89e4823ef9528936072f5f195d7fdab9e1f838b (patch)
tree800e290660f43fef73a458a32c6bd8ef63abdb95 /src
parentf635812ccc9b2eb63f5bc2b494d7fdae9c9e1ef3 (diff)
downloadlibimobiledevice-b89e4823ef9528936072f5f195d7fdab9e1f838b.tar.gz
libimobiledevice-b89e4823ef9528936072f5f195d7fdab9e1f838b.tar.bz2
#ifdef out code which is a no-op with OpenSSL 1.1.0
CRYPTO_set_id_callback CRYPTO_set_locking_callback EVP_cleanup CRYPTO_cleanup_all_ex_data SSL_COMP_free_compression_methods are all no-ops with OpenSSL 1.1.0, so we can #ifdef out the corresponding code. This cleans up some warnings about id_function/locking_function being defined but unused (as the calls to CRYPTO_set_id_callback and CRYPTO_set_locking_callback disappear at preprocessing time). Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/idevice.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/idevice.c b/src/idevice.c
index 1c43269..89724ff 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -69,6 +69,7 @@ static void openssl_remove_thread_state(void)
#endif
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
static mutex_t *mutex_buf = NULL;
static void locking_function(int mode, int n, const char* file, int line)
{
@@ -83,10 +84,12 @@ static unsigned long id_function(void)
return ((unsigned long)THREAD_ID);
}
#endif
+#endif
static void internal_idevice_init(void)
{
#ifdef HAVE_OPENSSL
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
int i;
SSL_library_init();
@@ -98,6 +101,7 @@ static void internal_idevice_init(void)
CRYPTO_set_id_callback(id_function);
CRYPTO_set_locking_callback(locking_function);
+#endif
#else
gnutls_global_init();
#endif
@@ -106,6 +110,7 @@ static void internal_idevice_init(void)
static void internal_idevice_deinit(void)
{
#ifdef HAVE_OPENSSL
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
int i;
if (mutex_buf) {
CRYPTO_set_id_callback(NULL);
@@ -120,6 +125,7 @@ static void internal_idevice_deinit(void)
CRYPTO_cleanup_all_ex_data();
SSL_COMP_free_compression_methods();
openssl_remove_thread_state();
+#endif
#else
gnutls_global_deinit();
#endif