aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_serialization.py
diff options
context:
space:
mode:
authorAlex Stapleton <alex@ly.st>2014-05-27 11:58:33 +0100
committerAlex Stapleton <alexs@prol.etari.at>2014-05-27 21:50:31 +0100
commit92838d1c1a17988ad0db2fdf7450e9b717065153 (patch)
tree33830a458616b8f3b7802c29de3a47b29d54addd /tests/hazmat/primitives/test_serialization.py
parent95888742992f54e5b03ba2963695762bb7aed53f (diff)
downloadcryptography-92838d1c1a17988ad0db2fdf7450e9b717065153.tar.gz
cryptography-92838d1c1a17988ad0db2fdf7450e9b717065153.tar.bz2
cryptography-92838d1c1a17988ad0db2fdf7450e9b717065153.zip
Unknown algorithm test for PKCS8
Diffstat (limited to 'tests/hazmat/primitives/test_serialization.py')
-rw-r--r--tests/hazmat/primitives/test_serialization.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py
index 36dbfcd8..b1789631 100644
--- a/tests/hazmat/primitives/test_serialization.py
+++ b/tests/hazmat/primitives/test_serialization.py
@@ -476,3 +476,19 @@ class TestPKCS8Serialisation(object):
assert key
assert isinstance(key, dsa.DSAPrivateKey)
+
+ @pytest.mark.parametrize(
+ ("key_file", "password"),
+ [
+ ("bad-oid-dsa-key.pem", None),
+ ]
+ )
+ def test_load_bad_oid_key(self, key_file, password, backend):
+ with pytest.raises(ValueError):
+ key = load_vectors_from_file(
+ os.path.join(
+ "asymmetric", "PKCS8", key_file),
+ lambda pemfile: load_pem_traditional_openssl_private_key(
+ pemfile.read().encode(), password, backend
+ )
+ )