diff options
-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", + ] } |