From 9736716017aac1d9da14b858903b20bb65b426e6 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Fri, 26 Aug 2016 20:02:03 +0800 Subject: be a bit more robust about detecting locking callback declarations (#3107) --- src/_cffi_src/openssl/crypto.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/_cffi_src/openssl') diff --git a/src/_cffi_src/openssl/crypto.py b/src/_cffi_src/openssl/crypto.py index f5d53961..39a571eb 100644 --- a/src/_cffi_src/openssl/crypto.py +++ b/src/_cffi_src/openssl/crypto.py @@ -83,14 +83,22 @@ CUSTOMIZATIONS = """ # define OPENSSL_PLATFORM SSLEAY_PLATFORM # define OPENSSL_DIR SSLEAY_DIR #endif -#if !defined(CRYPTO_LOCK) +#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 || defined(LIBRESSL_VERSION_NUMBER) +static const long Cryptography_HAS_LOCKING_CALLBACKS = 1; +#else static const long Cryptography_HAS_LOCKING_CALLBACKS = 0; +#if !defined(CRYPTO_LOCK) static const long CRYPTO_LOCK = 0; +#endif +#if !defined(CRYPTO_UNLOCK) static const long CRYPTO_UNLOCK = 0; +#endif +#if !defined(CRYPTO_READ) static const long CRYPTO_READ = 0; +#endif +#if !defined(CRYPTO_LOCK_SSL) static const long CRYPTO_LOCK_SSL = 0; +#endif void (*CRYPTO_lock)(int, int, const char *, int) = NULL; -#else -static const long Cryptography_HAS_LOCKING_CALLBACKS = 1; #endif """ -- cgit v1.2.3