diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-12-23 14:31:50 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-12-23 14:31:50 -0600 |
commit | 5bdf1a85323767c1654a702e884aa3f5d8720806 (patch) | |
tree | f3334cbc0ae7ffa9c42430034b59dd6050b78cd3 /tests | |
parent | 293852aaeca792d57f7335d0242320b8337c2cdd (diff) | |
parent | d2fbbc2c751c08d4ddb9af006dfcdf7ddb8b1665 (diff) | |
download | cryptography-5bdf1a85323767c1654a702e884aa3f5d8720806.tar.gz cryptography-5bdf1a85323767c1654a702e884aa3f5d8720806.tar.bz2 cryptography-5bdf1a85323767c1654a702e884aa3f5d8720806.zip |
Merge pull request #1572 from alex/delete-duplicate
Combined duplicated serialization tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hazmat/primitives/test_serialization.py | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py index 80a802d9..0eca8a67 100644 --- a/tests/hazmat/primitives/test_serialization.py +++ b/tests/hazmat/primitives/test_serialization.py @@ -52,6 +52,11 @@ class TestPEMSerialization(object): (["PKCS8", "pkcs12_s2k_pem-X_9930.pem"], b"123456"), (["PKCS8", "pkcs12_s2k_pem-X_9931.pem"], b"123456"), (["PKCS8", "pkcs12_s2k_pem-X_9932.pem"], b"123456"), + (["Traditional_OpenSSL_Serialization", "key1.pem"], b"123456"), + (["Traditional_OpenSSL_Serialization", "key2.pem"], b"a123456"), + (["Traditional_OpenSSL_Serialization", "testrsa.pem"], None), + (["Traditional_OpenSSL_Serialization", "testrsa-encrypted.pem"], + b"password"), ] ) def test_load_pem_rsa_private_key(self, key_file, password, backend): @@ -171,29 +176,6 @@ class TestPEMSerialization(object): interface=PEMSerializationBackend ) class TestTraditionalOpenSSLSerialization(object): - @pytest.mark.parametrize( - ("key_file", "password"), - [ - ("key1.pem", b"123456"), - ("key2.pem", b"a123456"), - ("testrsa.pem", None), - ("testrsa-encrypted.pem", b"password"), - ] - ) - def test_load_pem_rsa_private_key(self, key_file, password, backend): - key = load_vectors_from_file( - os.path.join( - "asymmetric", "Traditional_OpenSSL_Serialization", key_file), - lambda pemfile: load_pem_private_key( - pemfile.read().encode(), password, backend - ) - ) - - assert key - assert isinstance(key, interfaces.RSAPrivateKey) - if isinstance(key, interfaces.RSAPrivateKeyWithNumbers): - _check_rsa_private_numbers(key.private_numbers()) - def test_key1_pem_encrypted_values(self, backend): pkey = load_vectors_from_file( os.path.join( |