diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-24 21:59:01 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-24 21:59:01 -0600 |
commit | b639ad43a2b43a233a92cfdd6afb61c9aac1f0a1 (patch) | |
tree | 7fd2978a224003657fb917e72c231cd12d8e0239 /tests | |
parent | 0fd652bb18e1925cae8302cfabe684381d3ebfab (diff) | |
parent | 97f475db84cbc4619d00a37cecb4a0acc28b77fd (diff) | |
download | cryptography-b639ad43a2b43a233a92cfdd6afb61c9aac1f0a1.tar.gz cryptography-b639ad43a2b43a233a92cfdd6afb61c9aac1f0a1.tar.bz2 cryptography-b639ad43a2b43a233a92cfdd6afb61c9aac1f0a1.zip |
Merge pull request #1696 from alex/rsa-dsa-tests-move
Updated RSA and DSA tests for moved classes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hazmat/primitives/test_dsa.py | 8 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_rsa.py | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/hazmat/primitives/test_dsa.py b/tests/hazmat/primitives/test_dsa.py index 8c0fb80c..95164923 100644 --- a/tests/hazmat/primitives/test_dsa.py +++ b/tests/hazmat/primitives/test_dsa.py @@ -10,7 +10,7 @@ import pytest from cryptography.exceptions import AlreadyFinalized, InvalidSignature from cryptography.hazmat.backends.interfaces import DSABackend -from cryptography.hazmat.primitives import hashes, interfaces +from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import dsa from cryptography.hazmat.primitives.asymmetric.utils import ( encode_rfc6979_signature @@ -30,7 +30,7 @@ from ...utils import ( class TestDSA(object): def test_generate_dsa_parameters(self, backend): parameters = dsa.generate_parameters(1024, backend) - assert isinstance(parameters, interfaces.DSAParameters) + assert isinstance(parameters, dsa.DSAParameters) def test_generate_invalid_dsa_parameters(self, backend): with pytest.raises(ValueError): @@ -51,7 +51,7 @@ class TestDSA(object): g=vector['g'] ).parameters(backend) skey = parameters.generate_private_key() - if isinstance(skey, interfaces.DSAPrivateKeyWithNumbers): + if isinstance(skey, dsa.DSAPrivateKeyWithNumbers): numbers = skey.private_numbers() skey_parameters = numbers.public_numbers.parameter_numbers pkey = skey.public_key() @@ -74,7 +74,7 @@ class TestDSA(object): def test_generate_dsa_private_key_and_parameters(self, backend): skey = dsa.generate_private_key(1024, backend) assert skey - if isinstance(skey, interfaces.DSAPrivateKeyWithNumbers): + if isinstance(skey, dsa.DSAPrivateKeyWithNumbers): numbers = skey.private_numbers() skey_parameters = numbers.public_numbers.parameter_numbers assert numbers.public_numbers.y == pow( diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index 6d8e6874..74183010 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -16,7 +16,7 @@ from cryptography.exceptions import ( AlreadyFinalized, InvalidSignature, _Reasons ) from cryptography.hazmat.backends.interfaces import RSABackend -from cryptography.hazmat.primitives import hashes, interfaces +from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import padding, rsa from cryptography.hazmat.primitives.asymmetric.rsa import ( RSAPrivateNumbers, RSAPublicNumbers @@ -91,7 +91,7 @@ class TestRSA(object): skey = rsa.generate_private_key(public_exponent, key_size, backend) assert skey.key_size == key_size - if isinstance(skey, interfaces.RSAPrivateKeyWithNumbers): + if isinstance(skey, rsa.RSAPrivateKeyWithNumbers): _check_rsa_private_numbers(skey.private_numbers()) pkey = skey.public_key() assert isinstance(pkey.public_numbers(), rsa.RSAPublicNumbers) |