Fixed #809 -- switch back to always using UnsupportedAlgorithm
diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst
index 57c8eec..182e35d 100644
--- a/docs/hazmat/primitives/asymmetric/rsa.rst
+++ b/docs/hazmat/primitives/asymmetric/rsa.rst
@@ -50,7 +50,7 @@
provider.
:return: A new instance of ``RSAPrivateKey``.
- :raises cryptography.exceptions.UnsupportedInterface: This is raised if
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if
the provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.RSABackend`
@@ -100,9 +100,16 @@
:returns:
:class:`~cryptography.hazmat.primitives.interfaces.AsymmetricSignatureContext`
- :raises cryptography.exceptions.UnsupportedInterface: This is raised if
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if
the provided ``backend`` does not implement
- :class:`~cryptography.hazmat.backends.interfaces.RSABackend`
+ :class:`~cryptography.hazmat.backends.interfaces.RSABackend` or if
+ the backend does not support the chosen hash or padding algorithm.
+ If the padding is
+ :class:`~cryptography.hazmat.primitives.asymmetric.padding.PSS`
+ with the
+ :class:`~cryptography.hazmat.primitives.asymmetric.padding.MGF1`
+ mask generation function it may also refer to the ``MGF1`` hash
+ algorithm.
:raises TypeError: This is raised when the padding is not an
:class:`~cryptography.hazmat.primitives.interfaces.AsymmetricPadding`
@@ -111,17 +118,6 @@
:raises ValueError: This is raised when the chosen hash algorithm is
too large for the key size.
- :raises UnsupportedHash: This is raised when the backend does not
- support the chosen hash algorithm. If the padding is
- :class:`~cryptography.hazmat.primitives.asymmetric.padding.PSS`
- with the
- :class:`~cryptography.hazmat.primitives.asymmetric.padding.MGF1`
- mask generation function it may also refer to the `MGF1` hash
- algorithm.
-
- :raises UnsupportedPadding: This is raised when the backend does not
- support the chosen padding.
-
.. class:: RSAPublicKey(public_exponent, modulus)
@@ -205,9 +201,16 @@
:returns:
:class:`~cryptography.hazmat.primitives.interfaces.AsymmetricVerificationContext`
- :raises cryptography.exceptions.UnsupportedInterface: This is raised if
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if
the provided ``backend`` does not implement
- :class:`~cryptography.hazmat.backends.interfaces.RSABackend`
+ :class:`~cryptography.hazmat.backends.interfaces.RSABackend` or if
+ the backend does not support the chosen hash or padding algorithm.
+ If the padding is
+ :class:`~cryptography.hazmat.primitives.asymmetric.padding.PSS`
+ with the
+ :class:`~cryptography.hazmat.primitives.asymmetric.padding.MGF1`
+ mask generation function it may also refer to the ``MGF1`` hash
+ algorithm.
:raises TypeError: This is raised when the padding is not an
:class:`~cryptography.hazmat.primitives.interfaces.AsymmetricPadding`
@@ -216,16 +219,6 @@
:raises ValueError: This is raised when the chosen hash algorithm is
too large for the key size.
- :raises UnsupportedHash: This is raised when the backend does not
- support the chosen hash algorithm. If the padding is
- :class:`~cryptography.hazmat.primitives.asymmetric.padding.PSS`
- with the
- :class:`~cryptography.hazmat.primitives.asymmetric.padding.MGF1`
- mask generation function it may also refer to the `MGF1` hash
- algorithm.
-
- :raises UnsupportedPadding: This is raised when the backend does not
- support the chosen padding.
.. _`RSA`: https://en.wikipedia.org/wiki/RSA_(cryptosystem)
.. _`public-key`: https://en.wikipedia.org/wiki/Public-key_cryptography
diff --git a/docs/hazmat/primitives/cryptographic-hashes.rst b/docs/hazmat/primitives/cryptographic-hashes.rst
index c318fee..773d97f 100644
--- a/docs/hazmat/primitives/cryptographic-hashes.rst
+++ b/docs/hazmat/primitives/cryptographic-hashes.rst
@@ -29,7 +29,8 @@
'l\xa1=R\xcap\xc8\x83\xe0\xf0\xbb\x10\x1eBZ\x89\xe8bM\xe5\x1d\xb2\xd29%\x93\xafj\x84\x11\x80\x90'
If the backend doesn't support the requested ``algorithm`` an
- :class:`~cryptography.exceptions.UnsupportedHash` exception will be raised.
+ :class:`~cryptography.exceptions.UnsupportedAlgorithm` exception will be
+ raised.
Keep in mind that attacks against cryptographic hashes only get stronger
with time, and that often algorithms that were once thought to be strong,
@@ -45,7 +46,7 @@
:class:`~cryptography.hazmat.backends.interfaces.HashBackend`
provider.
- :raises cryptography.exceptions.UnsupportedInterface: This is raised if the
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if the
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.HashBackend`
diff --git a/docs/hazmat/primitives/hmac.rst b/docs/hazmat/primitives/hmac.rst
index 5d511bc..11b1073 100644
--- a/docs/hazmat/primitives/hmac.rst
+++ b/docs/hazmat/primitives/hmac.rst
@@ -35,7 +35,8 @@
'#F\xdaI\x8b"e\xc4\xf1\xbb\x9a\x8fc\xff\xf5\xdex.\xbc\xcd/+\x8a\x86\x1d\x84\'\xc3\xa6\x1d\xd8J'
If the backend doesn't support the requested ``algorithm`` an
- :class:`~cryptography.exceptions.UnsupportedHash` exception will be raised.
+ :class:`~cryptography.exceptions.UnsupportedAlgorithm` exception will be
+ raised.
To check that a given signature is correct use the :meth:`verify` method.
You will receive an exception if the signature is wrong:
@@ -56,7 +57,7 @@
:class:`~cryptography.hazmat.backends.interfaces.HMACBackend`
provider.
- :raises cryptography.exceptions.UnsupportedInterface: This is raised if the
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if the
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.HMACBackend`
diff --git a/docs/hazmat/primitives/key-derivation-functions.rst b/docs/hazmat/primitives/key-derivation-functions.rst
index 6196d95..269f949 100644
--- a/docs/hazmat/primitives/key-derivation-functions.rst
+++ b/docs/hazmat/primitives/key-derivation-functions.rst
@@ -84,7 +84,7 @@
:class:`~cryptography.hazmat.backends.interfaces.PBKDF2HMACBackend`
provider.
- :raises cryptography.exceptions.UnsupportedInterface: This is raised if the
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if the
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.PBKDF2HMACBackend`
@@ -187,7 +187,7 @@
:class:`~cryptography.hazmat.backends.interfaces.HMACBackend`
provider.
- :raises cryptography.exceptions.UnsupportedInterface: This is raised if the
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if the
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.HMACBackend`
diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst
index f7e8d5b..28de611 100644
--- a/docs/hazmat/primitives/symmetric-encryption.rst
+++ b/docs/hazmat/primitives/symmetric-encryption.rst
@@ -56,7 +56,7 @@
:class:`~cryptography.hazmat.backends.interfaces.CipherBackend`
provider.
- :raises cryptography.exceptions.UnsupportedInterface: This is raised if the
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if the
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.CipherBackend`
@@ -67,7 +67,7 @@
provider.
If the backend doesn't support the requested combination of ``cipher``
- and ``mode`` an :class:`~cryptography.exceptions.UnsupportedCipher`
+ and ``mode`` an :class:`~cryptography.exceptions.UnsupportedAlgorithm`
exception will be raised.
.. method:: decryptor()
@@ -77,7 +77,7 @@
provider.
If the backend doesn't support the requested combination of ``cipher``
- and ``mode`` an :class:`cryptography.exceptions.UnsupportedCipher`
+ and ``mode`` an :class:`cryptography.exceptions.UnsupportedAlgorithm`
exception will be raised.
.. _symmetric-encryption-algorithms:
diff --git a/docs/hazmat/primitives/twofactor.rst b/docs/hazmat/primitives/twofactor.rst
index e9f5c7f..f19cf0e 100644
--- a/docs/hazmat/primitives/twofactor.rst
+++ b/docs/hazmat/primitives/twofactor.rst
@@ -52,7 +52,7 @@
:class:`~cryptography.hazmat.primitives.hashes.SHA256()` or
:class:`~cryptography.hazmat.primitives.hashes.SHA512()` or if the
``length`` parameter is not an integer.
- :raises cryptography.exceptions.UnsupportedInterface: This is raised if the
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if the
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.HMACBackend`
@@ -151,7 +151,7 @@
:class:`~cryptography.hazmat.primitives.hashes.SHA256()` or
:class:`~cryptography.hazmat.primitives.hashes.SHA512()` or if the
``length`` parameter is not an integer.
- :raises cryptography.exceptions.UnsupportedInterface: This is raised if the
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if the
provided ``backend`` does not implement
:class:`~cryptography.hazmat.backends.interfaces.HMACBackend`