From cc31c4f99e9ff1c2fa5acd0eabbf19a671b06b1d Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 25 Feb 2019 20:43:45 +0800 Subject: reduce our engine bindings even more (#4768) --- tests/hazmat/backends/test_openssl.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/hazmat') diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index 20923792..b7c7e598 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -297,6 +297,25 @@ class TestOpenSSLRandomEngine(object): assert res == 1 +@pytest.mark.skipif( + backend._lib.Cryptography_HAS_ENGINE == 1, + reason="Requires OpenSSL without ENGINE support") +class TestOpenSSLNoEngine(object): + def test_no_engine_support(self): + assert backend._ffi.string( + backend._lib.Cryptography_osrandom_engine_id + ) == b"no-engine-support" + assert backend._ffi.string( + backend._lib.Cryptography_osrandom_engine_name + ) == b"osrandom_engine disabled due to no engine support" + + def test_activate_builtin_random_does_nothing(self): + backend.activate_builtin_random() + + def test_activate_osrandom_does_nothing(self): + backend.activate_osrandom_engine() + + class TestOpenSSLRSA(object): def test_generate_rsa_parameters_supported(self): assert backend.generate_rsa_parameters_supported(1, 1024) is False -- cgit v1.2.3