diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-12-24 15:20:34 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-12-24 15:20:34 -0800 |
commit | c360dee08d1661f5bb7a14da6f0e98f33804ff02 (patch) | |
tree | 0999fa7792de8ed01bd40ecb9f3796a8e1ad2eb5 | |
parent | 06f6a4e7b2e89e588c75c4bf755c1bd0563f9e28 (diff) | |
download | cryptography-c360dee08d1661f5bb7a14da6f0e98f33804ff02.tar.gz cryptography-c360dee08d1661f5bb7a14da6f0e98f33804ff02.tar.bz2 cryptography-c360dee08d1661f5bb7a14da6f0e98f33804ff02.zip |
Removed some deprecated code
-rw-r--r-- | src/cryptography/hazmat/primitives/asymmetric/ec.py | 10 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_ec.py | 19 |
2 files changed, 2 insertions, 27 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/ec.py b/src/cryptography/hazmat/primitives/asymmetric/ec.py index 202f1c97..c9124249 100644 --- a/src/cryptography/hazmat/primitives/asymmetric/ec.py +++ b/src/cryptography/hazmat/primitives/asymmetric/ec.py @@ -152,10 +152,7 @@ class EllipticCurvePublicNumbers(object): self._curve = curve def public_key(self, backend): - try: - return backend.load_elliptic_curve_public_numbers(self) - except AttributeError: - return backend.elliptic_curve_public_key_from_numbers(self) + return backend.load_elliptic_curve_public_numbers(self) curve = utils.read_only_property("_curve") x = utils.read_only_property("_x") @@ -191,10 +188,7 @@ class EllipticCurvePrivateNumbers(object): self._public_numbers = public_numbers def private_key(self, backend): - try: - return backend.load_elliptic_curve_private_numbers(self) - except AttributeError: - return backend.elliptic_curve_private_key_from_numbers(self) + return backend.load_elliptic_curve_private_numbers(self) private_value = utils.read_only_property("_private_value") public_numbers = utils.read_only_property("_public_numbers") diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py index 84c447c1..fd7f7ec5 100644 --- a/tests/hazmat/primitives/test_ec.py +++ b/tests/hazmat/primitives/test_ec.py @@ -63,14 +63,6 @@ class DummySignatureAlgorithm(object): algorithm = None -class DeprecatedDummyECBackend(object): - def elliptic_curve_private_key_from_numbers(self, numbers): - return b"private_key" - - def elliptic_curve_public_key_from_numbers(self, numbers): - return b"public_key" - - @pytest.mark.requires_backend_interface(interface=EllipticCurveBackend) def test_skip_curve_unsupported(backend): with pytest.raises(pytest.skip.Exception): @@ -350,17 +342,6 @@ class TestECDSAVectors(object): else: verifier.verify() - def test_deprecated_public_private_key_load(self): - b = DeprecatedDummyECBackend() - pub_numbers = ec.EllipticCurvePublicNumbers( - 2, - 3, - ec.SECT283K1() - ) - numbers = ec.EllipticCurvePrivateNumbers(1, pub_numbers) - assert numbers.private_key(b) == b"private_key" - assert pub_numbers.public_key(b) == b"public_key" - class TestECNumbersEquality(object): def test_public_numbers_eq(self): |