From 6bca12ffdac94bc3ad0865c27ead1f5e9bba5325 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 8 May 2014 10:09:37 -0700 Subject: Add load_rsa_numbers support to MultiBackend. --- tests/hazmat/backends/test_multibackend.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/hazmat/backends/test_multibackend.py') diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py index 3fa364e2..d4c89be3 100644 --- a/tests/hazmat/backends/test_multibackend.py +++ b/tests/hazmat/backends/test_multibackend.py @@ -23,7 +23,7 @@ from cryptography.hazmat.backends.interfaces import ( ) from cryptography.hazmat.backends.multibackend import MultiBackend from cryptography.hazmat.primitives import cmac, hashes, hmac -from cryptography.hazmat.primitives.asymmetric import padding +from cryptography.hazmat.primitives.asymmetric import padding, rsa from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from ...utils import raises_unsupported_algorithm @@ -111,6 +111,8 @@ class DummyRSABackend(object): pass def encrypt_rsa(self, public_key, plaintext, padding): + + def load_rsa_numbers(self, numbers): pass @@ -236,6 +238,8 @@ class TestMultiBackend(object): backend.decrypt_rsa("private_key", "encrypted", padding.PKCS1v15()) + backend.load_rsa_numbers(rsa.RSAPublicNumbers(e=3, n=1)) + backend = MultiBackend([]) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM @@ -279,6 +283,11 @@ class TestMultiBackend(object): ): backend.decrypt_rsa("private_key", "encrypted", padding.PKCS1v15()) + with raises_unsupported_algorithm( + _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM + ): + backend.load_rsa_numbers(rsa.RSAPublicNumbers(e=3, n=1)) + def test_dsa(self): backend = MultiBackend([ DummyDSABackend() -- cgit v1.2.3