aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/openssl/crypto.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-03-17 09:40:38 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2016-03-17 14:39:55 -0400
commitd30e267c29ba03157a9551aba013c6725dfd650d (patch)
tree4972d16631dcf5a55aac18f7b188592c031be9ea /src/_cffi_src/openssl/crypto.py
parent854e2789f9e1fbb672656a8b9a9f4fd857b1d920 (diff)
downloadcryptography-d30e267c29ba03157a9551aba013c6725dfd650d.tar.gz
cryptography-d30e267c29ba03157a9551aba013c6725dfd650d.tar.bz2
cryptography-d30e267c29ba03157a9551aba013c6725dfd650d.zip
we need CRYPTO_LOCK & CRYPTO_UNLOCK on < 1.1.0 so conditionally bind them
Diffstat (limited to 'src/_cffi_src/openssl/crypto.py')
-rw-r--r--src/_cffi_src/openssl/crypto.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/crypto.py b/src/_cffi_src/openssl/crypto.py
index d610957a..d6e5de15 100644
--- a/src/_cffi_src/openssl/crypto.py
+++ b/src/_cffi_src/openssl/crypto.py
@@ -9,6 +9,8 @@ INCLUDES = """
"""
TYPES = """
+static const long Cryptography_HAS_LOCKING_CALLBACKS;
+
typedef ... CRYPTO_THREADID;
static const int SSLEAY_VERSION;
@@ -25,6 +27,8 @@ static const int CRYPTO_MEM_CHECK_ON;
static const int CRYPTO_MEM_CHECK_OFF;
static const int CRYPTO_MEM_CHECK_ENABLE;
static const int CRYPTO_MEM_CHECK_DISABLE;
+static const int CRYPTO_LOCK;
+static const int CRYPTO_UNLOCK;
"""
FUNCTIONS = """
@@ -80,4 +84,11 @@ CUSTOMIZATIONS = """
# define OPENSSL_PLATFORM SSLEAY_PLATFORM
# define OPENSSL_DIR SSLEAY_DIR
#endif
+#if !defined(CRYPTO_LOCK)
+static const long Cryptography_HAS_LOCKING_CALLBACKS = 0;
+static const long CRYPTO_LOCK = 0;
+static const long CRYPTO_UNLOCK = 0;
+#else
+static const long Cryptography_HAS_LOCKING_CALLBACKS = 1;
+#endif
"""