diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-12-18 13:46:51 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-12-18 13:46:51 -0600 |
commit | 60657bbd2907e5116fac176079a3da31b2c56d3c (patch) | |
tree | a8954344e2ede283fe6433e6b93b5773dfe2a09b /tests/hazmat/backends/test_multibackend.py | |
parent | 9cde70ae840685f2bae6173b6beb192ae3866dc3 (diff) | |
download | cryptography-60657bbd2907e5116fac176079a3da31b2c56d3c.tar.gz cryptography-60657bbd2907e5116fac176079a3da31b2c56d3c.tar.bz2 cryptography-60657bbd2907e5116fac176079a3da31b2c56d3c.zip |
remove fully deprecated items from 0.6 deprecation cycle
Diffstat (limited to 'tests/hazmat/backends/test_multibackend.py')
-rw-r--r-- | tests/hazmat/backends/test_multibackend.py | 88 |
1 files changed, 1 insertions, 87 deletions
diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py index 03aa3cd8..43ecbf83 100644 --- a/tests/hazmat/backends/test_multibackend.py +++ b/tests/hazmat/backends/test_multibackend.py @@ -4,8 +4,6 @@ from __future__ import absolute_import, division, print_function -import pytest - from cryptography import utils from cryptography.exceptions import ( UnsupportedAlgorithm, _Reasons @@ -13,8 +11,7 @@ from cryptography.exceptions import ( from cryptography.hazmat.backends.interfaces import ( CMACBackend, CipherBackend, DSABackend, EllipticCurveBackend, HMACBackend, HashBackend, PBKDF2HMACBackend, PEMSerializationBackend, - PKCS8SerializationBackend, RSABackend, - TraditionalOpenSSLSerializationBackend, X509Backend + RSABackend, X509Backend ) from cryptography.hazmat.backends.multibackend import MultiBackend from cryptography.hazmat.primitives import cmac, hashes, hmac @@ -169,31 +166,11 @@ class DummyEllipticCurveBackend(object): if not self.elliptic_curve_supported(numbers.public_numbers.curve): raise UnsupportedAlgorithm(_Reasons.UNSUPPORTED_ELLIPTIC_CURVE) - def elliptic_curve_private_key_from_numbers(self, numbers): - if not self.elliptic_curve_supported(numbers.public_numbers.curve): - raise UnsupportedAlgorithm(_Reasons.UNSUPPORTED_ELLIPTIC_CURVE) - - def elliptic_curve_public_key_from_numbers(self, numbers): - if not self.elliptic_curve_supported(numbers.curve): - raise UnsupportedAlgorithm(_Reasons.UNSUPPORTED_ELLIPTIC_CURVE) - def load_elliptic_curve_public_numbers(self, numbers): if not self.elliptic_curve_supported(numbers.curve): raise UnsupportedAlgorithm(_Reasons.UNSUPPORTED_ELLIPTIC_CURVE) -@utils.register_interface(PKCS8SerializationBackend) -class DummyPKCS8SerializationBackend(object): - def load_pkcs8_pem_private_key(self, data, password): - pass - - -@utils.register_interface(TraditionalOpenSSLSerializationBackend) -class DummyTraditionalOpenSSLSerializationBackend(object): - def load_traditional_openssl_pem_private_key(self, data, password): - pass - - @utils.register_interface(PEMSerializationBackend) class DummyPEMSerializationBackend(object): def load_pem_private_key(self, data, password): @@ -457,69 +434,6 @@ class TestMultiBackend(object): ) ) - def test_deprecated_elliptic_curve(self): - backend = MultiBackend([ - DummyEllipticCurveBackend([ - ec.SECT283K1 - ]) - ]) - - assert backend.elliptic_curve_signature_algorithm_supported( - ec.ECDSA(hashes.SHA256()), - ec.SECT163K1() - ) is False - - pub_numbers = ec.EllipticCurvePublicNumbers(2, 3, ec.SECT283K1()) - numbers = ec.EllipticCurvePrivateNumbers(1, pub_numbers) - - pytest.deprecated_call( - backend.elliptic_curve_private_key_from_numbers, - numbers - ) - pytest.deprecated_call( - backend.elliptic_curve_public_key_from_numbers, - pub_numbers - ) - - with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_ELLIPTIC_CURVE): - backend.elliptic_curve_private_key_from_numbers( - ec.EllipticCurvePrivateNumbers( - 1, - ec.EllipticCurvePublicNumbers( - 2, - 3, - ec.SECT163K1() - ) - ) - ) - - with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_ELLIPTIC_CURVE): - backend.elliptic_curve_public_key_from_numbers( - ec.EllipticCurvePublicNumbers( - 2, - 3, - ec.SECT163K1() - ) - ) - - def test_pkcs8_serialization_backend(self): - backend = MultiBackend([DummyPKCS8SerializationBackend()]) - - backend.load_pkcs8_pem_private_key(b"keydata", None) - - backend = MultiBackend([]) - with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_SERIALIZATION): - backend.load_pkcs8_pem_private_key(b"keydata", None) - - def test_traditional_openssl_serialization_backend(self): - backend = MultiBackend([DummyTraditionalOpenSSLSerializationBackend()]) - - backend.load_traditional_openssl_pem_private_key(b"keydata", None) - - backend = MultiBackend([]) - with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_SERIALIZATION): - backend.load_traditional_openssl_pem_private_key(b"keydata", None) - def test_pem_serialization_backend(self): backend = MultiBackend([DummyPEMSerializationBackend()]) |