aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-03-20 18:43:04 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-03-20 18:43:04 -0400
commitcdd0d2f045816f007a44d56691a023dd25bcb47a (patch)
treea81524d68aa5af550a69772e94c22977d2811d29 /tests/hazmat/backends
parent798c03456d6f1fa8f27433a7e3928d583e1e120f (diff)
parent23c641dad201446a019d4a5f1181908744fd347a (diff)
downloadcryptography-cdd0d2f045816f007a44d56691a023dd25bcb47a.tar.gz
cryptography-cdd0d2f045816f007a44d56691a023dd25bcb47a.tar.bz2
cryptography-cdd0d2f045816f007a44d56691a023dd25bcb47a.zip
Merge branch 'master' into rsa-pss-signing
* master: add mgf1_hash_supported unsupported hash check more concise way of generating tests switch to a lambda rename some things add FIPS 186-2/3 signature verification tests for RSA PKCSv15 and PSS revert one import order change a few small fixes Add ASN1_TIME_free import order fixes for future automated checking Conflicts: tests/hazmat/primitives/test_rsa.py tests/hazmat/primitives/utils.py
Diffstat (limited to 'tests/hazmat/backends')
-rw-r--r--tests/hazmat/backends/test_commoncrypto.py2
-rw-r--r--tests/hazmat/backends/test_multibackend.py2
-rw-r--r--tests/hazmat/backends/test_openssl.py16
3 files changed, 14 insertions, 6 deletions
diff --git a/tests/hazmat/backends/test_commoncrypto.py b/tests/hazmat/backends/test_commoncrypto.py
index 1062b2ba..72ed61c0 100644
--- a/tests/hazmat/backends/test_commoncrypto.py
+++ b/tests/hazmat/backends/test_commoncrypto.py
@@ -16,7 +16,7 @@ from __future__ import absolute_import, division, print_function
import pytest
from cryptography import utils
-from cryptography.exceptions import UnsupportedCipher, InternalError
+from cryptography.exceptions import InternalError, UnsupportedCipher
from cryptography.hazmat.bindings.commoncrypto.binding import Binding
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.ciphers.algorithms import AES
diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py
index 31fb0a26..c5c0d82a 100644
--- a/tests/hazmat/backends/test_multibackend.py
+++ b/tests/hazmat/backends/test_multibackend.py
@@ -20,7 +20,7 @@ from cryptography.exceptions import (
UnsupportedAlgorithm, UnsupportedCipher, UnsupportedHash
)
from cryptography.hazmat.backends.interfaces import (
- CipherBackend, HashBackend, HMACBackend, PBKDF2HMACBackend, RSABackend
+ CipherBackend, HMACBackend, HashBackend, PBKDF2HMACBackend, RSABackend
)
from cryptography.hazmat.backends.multibackend import MultiBackend
from cryptography.hazmat.primitives import hashes, hmac
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index ebabd5f1..3747f436 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -17,11 +17,11 @@ import pytest
from cryptography import utils
from cryptography.exceptions import (
- UnsupportedCipher, UnsupportedHash, InternalError
+ InternalError, UnsupportedCipher, UnsupportedHash
)
-from cryptography.hazmat.backends.openssl.backend import backend, Backend
-from cryptography.hazmat.primitives import interfaces, hashes
-from cryptography.hazmat.primitives.asymmetric import rsa, padding
+from cryptography.hazmat.backends.openssl.backend import Backend, backend
+from cryptography.hazmat.primitives import hashes, interfaces
+from cryptography.hazmat.primitives.asymmetric import padding, rsa
from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from cryptography.hazmat.primitives.ciphers.modes import CBC
@@ -40,6 +40,11 @@ class DummyCipher(object):
name = "dummy-cipher"
+@utils.register_interface(interfaces.HashAlgorithm)
+class DummyHash(object):
+ name = "dummy-hash"
+
+
class TestOpenSSL(object):
def test_backend_exists(self):
assert backend
@@ -173,6 +178,9 @@ class TestOpenSSL(object):
backend
)
+ def test_unsupported_mgf1_hash_algorithm(self):
+ assert backend.mgf1_hash_supported(DummyHash()) is False
+
# This test is not in the next class because to check if it's really
# default we don't want to run the setup_method before it
def test_osrandom_engine_is_default(self):