aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends/test_openssl.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/backends/test_openssl.py')
-rw-r--r--tests/hazmat/backends/test_openssl.py16
1 files changed, 12 insertions, 4 deletions
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):