Changed excpetion name based on feedback from dreid
diff --git a/cryptography/exceptions.py b/cryptography/exceptions.py
index f0a7baf..391bed8 100644
--- a/cryptography/exceptions.py
+++ b/cryptography/exceptions.py
@@ -12,5 +12,5 @@
# limitations under the License.
-class NoSuchAlgorithm(Exception):
+class UnsupportedAlgorithm(Exception):
pass
diff --git a/cryptography/hazmat/bindings/openssl/backend.py b/cryptography/hazmat/bindings/openssl/backend.py
index ce8c6a5..32adfed 100644
--- a/cryptography/hazmat/bindings/openssl/backend.py
+++ b/cryptography/hazmat/bindings/openssl/backend.py
@@ -18,7 +18,7 @@
import cffi
-from cryptography.exceptions import NoSuchAlgorithm
+from cryptography.exceptions import UnsupportedAlgorithm
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.block.ciphers import (
AES, Blowfish, Camellia, CAST5, TripleDES,
@@ -132,7 +132,7 @@
try:
adapter = registry[type(cipher), type(mode)]
except KeyError:
- raise NoSuchAlgorithm
+ raise UnsupportedAlgorithm
evp_cipher = adapter(self._backend, cipher, mode)
assert evp_cipher != self._backend.ffi.NULL
diff --git a/docs/exceptions.rst b/docs/exceptions.rst
index b391e62..6ac11b3 100644
--- a/docs/exceptions.rst
+++ b/docs/exceptions.rst
@@ -3,7 +3,7 @@
.. currentmodule:: cryptography.exceptions
-.. class:: NoSuchAlgorithm
+.. class:: UnsupportedAlgorithm
This is raised when a backend doesn't support the requested algorithm (or
combination of algorithms).
diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst
index 48bad92..c1c8d24 100644
--- a/docs/hazmat/primitives/symmetric-encryption.rst
+++ b/docs/hazmat/primitives/symmetric-encryption.rst
@@ -43,8 +43,8 @@
provider.
If the backend doesn't support the requested combination of ``cipher``
- and ``mode`` a :class:`cryptography.exceptions.NoSuchAlgorithm` will
- be raised.
+ and ``mode`` an :class:`cryptography.exceptions.UnsupportedAlgorithm`
+ will be raised.
.. method:: decryptor()
@@ -53,8 +53,8 @@
provider.
If the backend doesn't support the requested combination of ``cipher``
- and ``mode`` a :class:`cryptography.exceptions.NoSuchAlgorithm` will
- be raised.
+ and ``mode`` an :class:`cryptography.exceptions.UnsupportedAlgorithm`
+ will be raised.
.. currentmodule:: cryptography.hazmat.primitives.interfaces
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py
index 2c0be1b..dd9c54c 100644
--- a/tests/hazmat/primitives/test_block.py
+++ b/tests/hazmat/primitives/test_block.py
@@ -17,7 +17,7 @@
import pytest
-from cryptography.exceptions import NoSuchAlgorithm
+from cryptography.exceptions import UnsupportedAlgorithm
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.block import BlockCipher, ciphers, modes
@@ -90,8 +90,8 @@
cipher = BlockCipher(
object(), object(), backend
)
- with pytest.raises(NoSuchAlgorithm):
+ with pytest.raises(UnsupportedAlgorithm):
cipher.encryptor()
- with pytest.raises(NoSuchAlgorithm):
+ with pytest.raises(UnsupportedAlgorithm):
cipher.decryptor()