From 29c3008aa12d845850aae6d8f52aee6d3609dda0 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 1 May 2014 15:47:24 -0500 Subject: expand DSA multibackend support --- tests/hazmat/backends/test_multibackend.py | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'tests/hazmat/backends') diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py index d8c09bd7..c31b235e 100644 --- a/tests/hazmat/backends/test_multibackend.py +++ b/tests/hazmat/backends/test_multibackend.py @@ -107,6 +107,18 @@ class DummyDSABackend(object): def generate_dsa_private_key(self, parameters): pass + def create_dsa_signature_ctx(self, private_key, algorithm): + pass + + def create_dsa_verification_ctx(self, public_key, signature, algorithm): + pass + + def dsa_hash_supported(self, algorithm): + pass + + def dsa_parameters_supported(self, p, q, g): + pass + @utils.register_interface(CMACBackend) class DummyCMACBackend(object): @@ -238,6 +250,28 @@ class TestMultiBackend(object): ): backend.generate_dsa_private_key(parameters) + with raises_unsupported_algorithm( + _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM + ): + backend.create_dsa_signature_ctx("private_key", hashes.SHA1()) + + with raises_unsupported_algorithm( + _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM + ): + backend.create_dsa_verification_ctx( + "public_key", b"sig", hashes.SHA1() + ) + + with raises_unsupported_algorithm( + _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM + ): + backend.dsa_hash_supported(hashes.SHA1()) + + with raises_unsupported_algorithm( + _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM + ): + backend.dsa_parameters_supported('p', 'q', 'g') + def test_cmac(self): backend = MultiBackend([ DummyCMACBackend([algorithms.AES]) -- cgit v1.2.3