From bc1667791eedfe9d77d56dd9014e26481f571ff5 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 29 Aug 2018 20:50:05 -0400 Subject: 1.1.0 locks (#4420) * Do conditional compiling of Cryptography_setup_ssl_threads * Check Cryptography_HAS_LOCKING_CALLBACKS before initing static locks Check if compiling and initing locking callbacks is necessary PEP8 fix * Make test_crypto_lock_init more complete --- src/_cffi_src/openssl/callbacks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/_cffi_src/openssl') diff --git a/src/_cffi_src/openssl/callbacks.py b/src/_cffi_src/openssl/callbacks.py index 13c4e10c..75c62016 100644 --- a/src/_cffi_src/openssl/callbacks.py +++ b/src/_cffi_src/openssl/callbacks.py @@ -47,6 +47,7 @@ CUSTOMIZATIONS = """ using CPython APIs by Armin Rigo of the PyPy project. */ +#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 #ifdef _WIN32 typedef CRITICAL_SECTION Cryptography_mutex; static __inline void cryptography_mutex_init(Cryptography_mutex *mutex) { @@ -80,7 +81,6 @@ static inline void cryptography_mutex_unlock(Cryptography_mutex *mutex) { #endif - static unsigned int _ssl_locks_count = 0; static Cryptography_mutex *_ssl_locks = NULL; @@ -135,6 +135,9 @@ int Cryptography_setup_ssl_threads(void) { } return 1; } +#else +int (*Cryptography_setup_ssl_threads)(void) = NULL; +#endif typedef struct { char *password; -- cgit v1.2.3