aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cryptography/exceptions.py2
-rw-r--r--cryptography/hazmat/bindings/openssl/backend.py4
-rw-r--r--docs/exceptions.rst2
-rw-r--r--docs/hazmat/primitives/symmetric-encryption.rst8
-rw-r--r--tests/hazmat/primitives/test_block.py6
5 files changed, 11 insertions, 11 deletions
diff --git a/cryptography/exceptions.py b/cryptography/exceptions.py
index f0a7baf2..391bed82 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 ce8c6a55..32adfed9 100644
--- a/cryptography/hazmat/bindings/openssl/backend.py
+++ b/cryptography/hazmat/bindings/openssl/backend.py
@@ -18,7 +18,7 @@ import sys
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 @@ class _CipherContext(object):
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 b391e620..6ac11b3c 100644
--- a/docs/exceptions.rst
+++ b/docs/exceptions.rst
@@ -3,7 +3,7 @@ Exceptions
.. 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 48bad928..c1c8d247 100644
--- a/docs/hazmat/primitives/symmetric-encryption.rst
+++ b/docs/hazmat/primitives/symmetric-encryption.rst
@@ -43,8 +43,8 @@ where the encrypter and decrypter both use the same key.
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 @@ where the encrypter and decrypter both use the same key.
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 2c0be1b5..dd9c54c9 100644
--- a/tests/hazmat/primitives/test_block.py
+++ b/tests/hazmat/primitives/test_block.py
@@ -17,7 +17,7 @@ import binascii
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 @@ class TestBlockCipherContext(object):
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()