mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
Changed excpetion name based on feedback from dreid
This commit is contained in:
parent
738ac5a8e9
commit
3949f11710
5 changed files with 11 additions and 11 deletions
|
|
@ -12,5 +12,5 @@
|
|||
# limitations under the License.
|
||||
|
||||
|
||||
class NoSuchAlgorithm(Exception):
|
||||
class UnsupportedAlgorithm(Exception):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue