diff options
| author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2021-11-03 19:29:57 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-03 07:29:57 -0400 |
| commit | 9d10f1f47d6a67d32a3ce2452a67f31fa214c075 (patch) | |
| tree | dc63a59d971e47f0fb054938deaeb3af73328a25 /tests/hazmat | |
| parent | 4ab8ccea5ba3bf78d8e865954c9eb3c306cef25d (diff) | |
| download | cryptography-9d10f1f47d6a67d32a3ce2452a67f31fa214c075.tar.gz | |
deprecate backend part 14 of...probably 15? (#6534)
* * CMAC
* HMAC
* * hashes
* * keywrap
Diffstat (limited to 'tests/hazmat')
| -rw-r--r-- | tests/hazmat/primitives/test_cmac.py | 10 | ||||
| -rw-r--r-- | tests/hazmat/primitives/test_hashes.py | 7 | ||||
| -rw-r--r-- | tests/hazmat/primitives/test_hmac.py | 9 |
3 files changed, 0 insertions, 26 deletions
diff --git a/tests/hazmat/primitives/test_cmac.py b/tests/hazmat/primitives/test_cmac.py index 1d6892540..1dfd2b3fd 100644 --- a/tests/hazmat/primitives/test_cmac.py +++ b/tests/hazmat/primitives/test_cmac.py @@ -10,7 +10,6 @@ import pytest from cryptography.exceptions import ( AlreadyFinalized, InvalidSignature, - _Reasons, ) from cryptography.hazmat.primitives.ciphers.algorithms import ( AES, @@ -22,7 +21,6 @@ from cryptography.hazmat.primitives.cmac import CMAC from ...utils import ( load_nist_vectors, load_vectors_from_file, - raises_unsupported_algorithm, ) @@ -210,11 +208,3 @@ class TestCMAC(object): assert cmac.finalize() == binascii.unhexlify( b"a21e6e647bfeaf5ca0a5e1bcd957dfad" ) - - -def test_invalid_backend(): - key = b"2b7e151628aed2a6abf7158809cf4f3c" - pretend_backend = object() - - with raises_unsupported_algorithm(_Reasons.BACKEND_MISSING_INTERFACE): - CMAC(AES(key), pretend_backend) # type: ignore[arg-type] diff --git a/tests/hazmat/primitives/test_hashes.py b/tests/hazmat/primitives/test_hashes.py index e433d9c01..50875807f 100644 --- a/tests/hazmat/primitives/test_hashes.py +++ b/tests/hazmat/primitives/test_hashes.py @@ -155,13 +155,6 @@ class TestBLAKE2s(object): hashes.BLAKE2s(digest_size=-1) -def test_invalid_backend(): - pretend_backend = object() - - with raises_unsupported_algorithm(_Reasons.BACKEND_MISSING_INTERFACE): - hashes.Hash(hashes.SHA1(), pretend_backend) # type:ignore[arg-type] - - def test_buffer_protocol_hash(backend): data = binascii.unhexlify(b"b4190e") h = hashes.Hash(hashes.SHA256(), backend) diff --git a/tests/hazmat/primitives/test_hmac.py b/tests/hazmat/primitives/test_hmac.py index 44dd94e05..5215b096d 100644 --- a/tests/hazmat/primitives/test_hmac.py +++ b/tests/hazmat/primitives/test_hmac.py @@ -88,12 +88,3 @@ class TestHMAC(object): assert h.finalize() == binascii.unhexlify( b"a1bf7169c56a501c6585190ff4f07cad6e492a3ee187c0372614fb444b9fc3f0" ) - - -def test_invalid_backend(): - pretend_backend = object() - - with raises_unsupported_algorithm(_Reasons.BACKEND_MISSING_INTERFACE): - hmac.HMAC( - b"key", hashes.SHA1(), pretend_backend # type:ignore[arg-type] - ) |
