diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-03-01 22:52:52 -0500 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-03-01 22:52:52 -0500 |
commit | 741175ef2bf965c9439dc4525df7e48c8a4ff72c (patch) | |
tree | 87274187e90b16431473b6c06403e6142aaabdd1 /tests/hazmat | |
parent | ab1b4236401b89320bda457117a8e6758c14e42f (diff) | |
parent | db9d97f94df125dfc684ae069ee1a2a54ac2d426 (diff) | |
download | cryptography-741175ef2bf965c9439dc4525df7e48c8a4ff72c.tar.gz cryptography-741175ef2bf965c9439dc4525df7e48c8a4ff72c.tar.bz2 cryptography-741175ef2bf965c9439dc4525df7e48c8a4ff72c.zip |
Merge pull request #1711 from reaperhulk/serialize-format-private-format
s/Format/PrivateFormat
Diffstat (limited to 'tests/hazmat')
-rw-r--r-- | tests/hazmat/backends/test_openssl.py | 4 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_rsa.py | 17 |
2 files changed, 12 insertions, 9 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index 4f44f686..8ee9d246 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -504,7 +504,7 @@ class TestRSAPEMSerialization(object): with pytest.raises(ValueError): key.private_bytes( serialization.Encoding.PEM, - serialization.Format.PKCS8, + serialization.PrivateFormat.PKCS8, serialization.BestAvailableEncryption(password) ) @@ -513,6 +513,6 @@ class TestRSAPEMSerialization(object): with pytest.raises(ValueError): key.private_bytes( serialization.Encoding.DER, - serialization.Format.PKCS8, + serialization.PrivateFormat.PKCS8, serialization.NoEncryption() ) diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index 0cf94afe..890a1d4e 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -1753,8 +1753,8 @@ class TestRSAPEMWriter(object): ("fmt", "password"), itertools.product( [ - serialization.Format.TraditionalOpenSSL, - serialization.Format.PKCS8 + serialization.PrivateFormat.TraditionalOpenSSL, + serialization.PrivateFormat.PKCS8 ], [ b"s", @@ -1781,7 +1781,10 @@ class TestRSAPEMWriter(object): @pytest.mark.parametrize( "fmt", - [serialization.Format.TraditionalOpenSSL, serialization.Format.PKCS8], + [ + serialization.PrivateFormat.TraditionalOpenSSL, + serialization.PrivateFormat.PKCS8 + ], ) def test_private_bytes_unencrypted_pem(self, backend, fmt): key = RSA_KEY_2048.private_key(backend) @@ -1810,7 +1813,7 @@ class TestRSAPEMWriter(object): key = serialization.load_pem_private_key(key_bytes, None, backend) serialized = key.private_bytes( serialization.Encoding.PEM, - serialization.Format.TraditionalOpenSSL, + serialization.PrivateFormat.TraditionalOpenSSL, serialization.NoEncryption() ) assert serialized == key_bytes @@ -1821,7 +1824,7 @@ class TestRSAPEMWriter(object): with pytest.raises(TypeError): key.private_bytes( "notencoding", - serialization.Format.PKCS8, + serialization.PrivateFormat.PKCS8, serialization.NoEncryption() ) @@ -1841,7 +1844,7 @@ class TestRSAPEMWriter(object): with pytest.raises(TypeError): key.private_bytes( serialization.Encoding.PEM, - serialization.Format.TraditionalOpenSSL, + serialization.PrivateFormat.TraditionalOpenSSL, "notanencalg" ) @@ -1851,6 +1854,6 @@ class TestRSAPEMWriter(object): with pytest.raises(ValueError): key.private_bytes( serialization.Encoding.PEM, - serialization.Format.TraditionalOpenSSL, + serialization.PrivateFormat.TraditionalOpenSSL, DummyKeyEncryption() ) |