diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2018-08-29 20:50:05 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2018-08-29 20:50:05 -0400 |
commit | bc1667791eedfe9d77d56dd9014e26481f571ff5 (patch) | |
tree | 3a428e9a0cc3ce0a733947ea0b4300f524602bf0 /src/_cffi_src | |
parent | 3d0f333deb4ffbc0d05ea096c57d090e46222fe3 (diff) | |
download | cryptography-bc1667791eedfe9d77d56dd9014e26481f571ff5.tar.gz cryptography-bc1667791eedfe9d77d56dd9014e26481f571ff5.tar.bz2 cryptography-bc1667791eedfe9d77d56dd9014e26481f571ff5.zip |
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
Diffstat (limited to 'src/_cffi_src')
-rw-r--r-- | src/_cffi_src/openssl/callbacks.py | 5 |
1 files changed, 4 insertions, 1 deletions
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; |