diff options
author | Nikias Bassen | 2019-06-10 05:03:14 +0200 |
---|---|---|
committer | Nikias Bassen | 2019-06-10 05:03:14 +0200 |
commit | 34444782e22ebfd2abc9e5e9c27e170a839ff66b (patch) | |
tree | 6e73890be7d38f4b0bdc73c8268f6dff235a94ad /src | |
parent | eb61c7b660fb58f9edb0f7b5507ebaad28422361 (diff) | |
download | libimobiledevice-34444782e22ebfd2abc9e5e9c27e170a839ff66b.tar.gz libimobiledevice-34444782e22ebfd2abc9e5e9c27e170a839ff66b.tar.bz2 |
Make sure OpenSSL version checks don't fail when using LibreSSL
Diffstat (limited to 'src')
-rw-r--r-- | src/idevice.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/idevice.c b/src/idevice.c index cb9bb5c..be29884 100644 --- a/src/idevice.c +++ b/src/idevice.c @@ -2,8 +2,8 @@ * idevice.c * Device discovery and communication interface. * + * Copyright (c) 2009-2019 Nikias Bassen. All Rights Reserved. * Copyright (c) 2014 Martin Szulecki All Rights Reserved. - * Copyright (c) 2009-2014 Nikias Bassen. All Rights Reserved. * Copyright (c) 2008 Zach C. All Rights Reserved. * * This library is free software; you can redistribute it and/or @@ -37,7 +37,6 @@ #ifdef HAVE_OPENSSL #include <openssl/err.h> #include <openssl/ssl.h> - #else #include <gnutls/gnutls.h> #endif @@ -49,7 +48,7 @@ #ifdef HAVE_OPENSSL -#if OPENSSL_VERSION_NUMBER < 0x10002000L +#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER) static void SSL_COMP_free_compression_methods(void) { sk_SSL_COMP_free(SSL_COMP_get_compression_methods()); @@ -60,7 +59,7 @@ static void openssl_remove_thread_state(void) { /* ERR_remove_thread_state() is available since OpenSSL 1.0.0-beta1, but * deprecated in OpenSSL 1.1.0 */ -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) #if OPENSSL_VERSION_NUMBER >= 0x10000001L ERR_remove_thread_state(NULL); #else @@ -69,7 +68,7 @@ static void openssl_remove_thread_state(void) #endif } -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) static mutex_t *mutex_buf = NULL; static void locking_function(int mode, int n, const char* file, int line) { @@ -89,7 +88,7 @@ static unsigned long id_function(void) static void internal_idevice_init(void) { #ifdef HAVE_OPENSSL -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) int i; SSL_library_init(); @@ -110,7 +109,7 @@ static void internal_idevice_init(void) static void internal_idevice_deinit(void) { #ifdef HAVE_OPENSSL -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) int i; if (mutex_buf) { CRYPTO_set_id_callback(NULL); |