diff options
author | David Benjamin <davidben@google.com> | 2019-07-08 16:42:01 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2019-07-08 15:42:00 -0500 |
commit | 9a09f9690890c4b6fa6d4d1625e78dcbaffbf734 (patch) | |
tree | 8b5224be0decccc0efc22da14323c59dd6c5acea /tests/wycheproof | |
parent | 1e8c5a64190db6611889f45f7f8af543b291383b (diff) | |
download | cryptography-9a09f9690890c4b6fa6d4d1625e78dcbaffbf734.tar.gz cryptography-9a09f9690890c4b6fa6d4d1625e78dcbaffbf734.tar.bz2 cryptography-9a09f9690890c4b6fa6d4d1625e78dcbaffbf734.zip |
Fix some backend feature checks in tests (#4931)
* Remove irrelevant DHBackend test conditions
DHBackend provides functions for plain finite-field Diffie-Hellman.
X25519 and X448 are their own algorithms, and Ed25519 and Ed448 aren't
even Diffie-Hellman primitives.
* Add missing backend support checks.
Some new AES and EC tests did not check for whether the corresponding
mode or curve was supported by the backend.
* Add a DummyMode for coverage
Diffstat (limited to 'tests/wycheproof')
-rw-r--r-- | tests/wycheproof/test_eddsa.py | 2 | ||||
-rw-r--r-- | tests/wycheproof/test_x25519.py | 2 |
2 files changed, 0 insertions, 4 deletions
diff --git a/tests/wycheproof/test_eddsa.py b/tests/wycheproof/test_eddsa.py index 40cb49a3..5ae87e09 100644 --- a/tests/wycheproof/test_eddsa.py +++ b/tests/wycheproof/test_eddsa.py @@ -9,7 +9,6 @@ import binascii import pytest from cryptography.exceptions import InvalidSignature -from cryptography.hazmat.backends.interfaces import DHBackend from cryptography.hazmat.primitives.asymmetric.ed25519 import ( Ed25519PublicKey ) @@ -19,7 +18,6 @@ from cryptography.hazmat.primitives.asymmetric.ed25519 import ( only_if=lambda backend: backend.ed25519_supported(), skip_message="Requires OpenSSL with Ed25519 support" ) -@pytest.mark.requires_backend_interface(interface=DHBackend) @pytest.mark.wycheproof_tests( "eddsa_test.json", ) diff --git a/tests/wycheproof/test_x25519.py b/tests/wycheproof/test_x25519.py index 0727ec39..991daaa4 100644 --- a/tests/wycheproof/test_x25519.py +++ b/tests/wycheproof/test_x25519.py @@ -8,7 +8,6 @@ import binascii import pytest -from cryptography.hazmat.backends.interfaces import DHBackend from cryptography.hazmat.primitives.asymmetric.x25519 import ( X25519PrivateKey, X25519PublicKey ) @@ -18,7 +17,6 @@ from cryptography.hazmat.primitives.asymmetric.x25519 import ( only_if=lambda backend: backend.x25519_supported(), skip_message="Requires OpenSSL with X25519 support" ) -@pytest.mark.requires_backend_interface(interface=DHBackend) @pytest.mark.wycheproof_tests("x25519_test.json") def test_x25519(backend, wycheproof): assert list(wycheproof.testgroup.items()) == [("curve", "curve25519")] |