diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-09-25 15:01:53 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-09-27 10:18:25 -0500 |
commit | 861ddfc57fefba33a200356722f329fbfdb4da87 (patch) | |
tree | 22b136279e303c8819a4777b52616dbecd28f83b | |
parent | 25228af9ce544108927cc769e5cfcf6f215cbc89 (diff) | |
download | cryptography-861ddfc57fefba33a200356722f329fbfdb4da87.tar.gz cryptography-861ddfc57fefba33a200356722f329fbfdb4da87.tar.bz2 cryptography-861ddfc57fefba33a200356722f329fbfdb4da87.zip |
multibackend deprecated method needs to call the backend deprecated method
-rw-r--r-- | cryptography/hazmat/backends/multibackend.py | 22 |
1 files 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): |