From afc1ccdcc86371588328c7894d230c9db3757359 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 19 Mar 2014 11:49:32 -0400 Subject: import order fixes for future automated checking --- tests/hazmat/backends/test_commoncrypto.py | 2 +- tests/hazmat/backends/test_multibackend.py | 2 +- tests/hazmat/backends/test_openssl.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/hazmat/backends') 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 c5d0a013..501ee0f6 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 -- cgit v1.2.3 From 4d8358fb50253bebdf637f517da8ba2406080d3f Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 19 Mar 2014 19:14:15 -0400 Subject: add mgf1_hash_supported unsupported hash check --- tests/hazmat/backends/test_openssl.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/hazmat/backends') diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index 501ee0f6..5c6efbaf 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -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 @@ -162,6 +167,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): -- cgit v1.2.3