aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends/test_openssl.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/backends/test_openssl.py')
-rw-r--r--tests/hazmat/backends/test_openssl.py19
1 files changed, 19 insertions, 0 deletions
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