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 --- tests/hazmat/bindings/test_openssl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/hazmat/bindings/test_openssl.py b/tests/hazmat/bindings/test_openssl.py index f317f07f..fb1e62fa 100644 --- a/tests/hazmat/bindings/test_openssl.py +++ b/tests/hazmat/bindings/test_openssl.py @@ -21,12 +21,15 @@ class TestOpenSSL(object): def test_crypto_lock_init(self): b = Binding() - if b.lib.CRYPTOGRAPHY_OPENSSL_110_OR_GREATER: - pytest.skip("Requires an older OpenSSL. Must be < 1.1.0") b.init_static_locks() lock_cb = b.lib.CRYPTO_get_locking_callback() - assert lock_cb != b.ffi.NULL + if b.lib.CRYPTOGRAPHY_OPENSSL_110_OR_GREATER: + assert lock_cb == b.ffi.NULL + assert b.lib.Cryptography_HAS_LOCKING_CALLBACKS == 0 + else: + assert lock_cb != b.ffi.NULL + assert b.lib.Cryptography_HAS_LOCKING_CALLBACKS == 1 def test_add_engine_more_than_once(self): b = Binding() -- cgit v1.2.3