aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/openssl
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-08-26 20:02:03 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2016-08-26 08:02:03 -0400
commit9736716017aac1d9da14b858903b20bb65b426e6 (patch)
tree0d76be26503a6a41867d9cbb93217e82f851b3ad /src/_cffi_src/openssl
parentfea3b129b5013d251f31de18b2642c22317b6ba3 (diff)
downloadcryptography-9736716017aac1d9da14b858903b20bb65b426e6.tar.gz
cryptography-9736716017aac1d9da14b858903b20bb65b426e6.tar.bz2
cryptography-9736716017aac1d9da14b858903b20bb65b426e6.zip
be a bit more robust about detecting locking callback declarations (#3107)
Diffstat (limited to 'src/_cffi_src/openssl')
-rw-r--r--src/_cffi_src/openssl/crypto.py14
1 files changed, 11 insertions, 3 deletions
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
"""