aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/bindings/test_openssl.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2018-08-29 20:50:05 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2018-08-29 20:50:05 -0400
commitbc1667791eedfe9d77d56dd9014e26481f571ff5 (patch)
tree3a428e9a0cc3ce0a733947ea0b4300f524602bf0 /tests/hazmat/bindings/test_openssl.py
parent3d0f333deb4ffbc0d05ea096c57d090e46222fe3 (diff)
downloadcryptography-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 'tests/hazmat/bindings/test_openssl.py')
-rw-r--r--tests/hazmat/bindings/test_openssl.py9
1 files changed, 6 insertions, 3 deletions
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()