From 861ddfc57fefba33a200356722f329fbfdb4da87 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 25 Sep 2014 15:01:53 -0500 Subject: multibackend deprecated method needs to call the backend deprecated method --- cryptography/hazmat/backends/multibackend.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/cryptography/hazmat/backends/multibackend.py b/cryptography/hazmat/backends/multibackend.py index 02b4b6d1..ce9e6dee 100644 --- a/cryptography/hazmat/backends/multibackend.py +++ b/cryptography/hazmat/backends/multibackend.py @@ -305,7 +305,16 @@ class MultiBackend(object): utils.DeprecatedIn06, stacklevel=2 ) - return self.load_elliptic_curve_private_numbers(numbers) + for b in self._filtered_backends(EllipticCurveBackend): + try: + return b.elliptic_curve_private_key_from_numbers(numbers) + except UnsupportedAlgorithm: + continue + + raise UnsupportedAlgorithm( + "This backend does not support this elliptic curve.", + _Reasons.UNSUPPORTED_ELLIPTIC_CURVE + ) def load_elliptic_curve_private_numbers(self, numbers): for b in self._filtered_backends(EllipticCurveBackend): @@ -326,7 +335,16 @@ class MultiBackend(object): utils.DeprecatedIn06, stacklevel=2 ) - return self.load_elliptic_curve_public_numbers(numbers) + for b in self._filtered_backends(EllipticCurveBackend): + try: + return b.elliptic_curve_public_key_from_numbers(numbers) + except UnsupportedAlgorithm: + continue + + raise UnsupportedAlgorithm( + "This backend does not support this elliptic curve.", + _Reasons.UNSUPPORTED_ELLIPTIC_CURVE + ) def load_elliptic_curve_public_numbers(self, numbers): for b in self._filtered_backends(EllipticCurveBackend): -- cgit v1.2.3