aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-05-20 10:09:02 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2017-05-20 10:09:02 -0700
commit51032351297b9bf7d783b7138ac0c142d8e38918 (patch)
tree3a3ca718dbb0cf904d66b9046489185349ba508b /tests/hazmat/backends
parentd08ddd5af21de62088c0236bfac1d647a6cb84a2 (diff)
downloadcryptography-51032351297b9bf7d783b7138ac0c142d8e38918.tar.gz
cryptography-51032351297b9bf7d783b7138ac0c142d8e38918.tar.bz2
cryptography-51032351297b9bf7d783b7138ac0c142d8e38918.zip
time to remove commoncrypto, fare thee well (#3551)
* time to remove commoncrypto, fare thee well * remove even more * update the changelog * remove more things * don't need this function * remove CAST5 CTR tests since that was only supported in commoncrypto * assert a thing
Diffstat (limited to 'tests/hazmat/backends')
-rw-r--r--tests/hazmat/backends/test_backendinit.py17
-rw-r--r--tests/hazmat/backends/test_commoncrypto.py54
2 files changed, 0 insertions, 71 deletions
diff --git a/tests/hazmat/backends/test_backendinit.py b/tests/hazmat/backends/test_backendinit.py
deleted file mode 100644
index b930f99f..00000000
--- a/tests/hazmat/backends/test_backendinit.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography.hazmat.backends import _backend_import_fallback
-
-
-def test_backend_import_fallback_empty_backends():
- backends = _backend_import_fallback([])
- assert len(backends) >= 1
-
-
-def test_backend_import_fallback_existing_backends():
- backend_list = [1, 2, 3, 4]
- assert backend_list == _backend_import_fallback(backend_list)
diff --git a/tests/hazmat/backends/test_commoncrypto.py b/tests/hazmat/backends/test_commoncrypto.py
deleted file mode 100644
index 2b730e93..00000000
--- a/tests/hazmat/backends/test_commoncrypto.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import pytest
-
-from cryptography.exceptions import InternalError, _Reasons
-from cryptography.hazmat.backends import _available_backends
-from cryptography.hazmat.primitives.ciphers import Cipher
-from cryptography.hazmat.primitives.ciphers.algorithms import AES
-from cryptography.hazmat.primitives.ciphers.modes import CBC, GCM
-
-from ...doubles import DummyCipherAlgorithm
-from ...utils import raises_unsupported_algorithm
-
-
-@pytest.mark.skipif("commoncrypto" not in
- [i.name for i in _available_backends()],
- reason="CommonCrypto not available")
-class TestCommonCrypto(object):
- def test_supports_cipher(self):
- from cryptography.hazmat.backends.commoncrypto.backend import backend
- assert backend.cipher_supported(None, None) is False
-
- def test_register_duplicate_cipher_adapter(self):
- from cryptography.hazmat.backends.commoncrypto.backend import backend
- with pytest.raises(ValueError):
- backend._register_cipher_adapter(
- AES, backend._lib.kCCAlgorithmAES128,
- CBC, backend._lib.kCCModeCBC
- )
-
- def test_handle_response(self):
- from cryptography.hazmat.backends.commoncrypto.backend import backend
-
- with pytest.raises(ValueError):
- backend._check_cipher_response(backend._lib.kCCAlignmentError)
-
- with pytest.raises(InternalError):
- backend._check_cipher_response(backend._lib.kCCMemoryFailure)
-
- with pytest.raises(InternalError):
- backend._check_cipher_response(backend._lib.kCCDecodeError)
-
- def test_nonexistent_aead_cipher(self):
- from cryptography.hazmat.backends.commoncrypto.backend import Backend
- b = Backend()
- cipher = Cipher(
- DummyCipherAlgorithm(), GCM(b"fake_iv_here"), backend=b,
- )
- with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER):
- cipher.encryptor()