diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-17 09:40:38 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-17 14:39:55 -0400 |
commit | d30e267c29ba03157a9551aba013c6725dfd650d (patch) | |
tree | 4972d16631dcf5a55aac18f7b188592c031be9ea /src | |
parent | 854e2789f9e1fbb672656a8b9a9f4fd857b1d920 (diff) | |
download | cryptography-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')
-rw-r--r-- | src/_cffi_src/openssl/crypto.py | 11 | ||||
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/_conditional.py | 4 |
2 files changed, 15 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 """ diff --git a/src/cryptography/hazmat/bindings/openssl/_conditional.py b/src/cryptography/hazmat/bindings/openssl/_conditional.py index 148534da..436fcebd 100644 --- a/src/cryptography/hazmat/bindings/openssl/_conditional.py +++ b/src/cryptography/hazmat/bindings/openssl/_conditional.py @@ -412,4 +412,8 @@ CONDITIONAL_NAMES = { "TLS_ST_BEFORE", "TLS_ST_OK", ], + "Cryptography_HAS_LOCKING_CALLBACKS": [ + "CRYPTO_LOCK", + "CRYPTO_UNLOCK", + ] } |