aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
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 /cryptography
parent95888742992f54e5b03ba2963695762bb7aed53f (diff)
downloadcryptography-92838d1c1a17988ad0db2fdf7450e9b717065153.tar.gz
cryptography-92838d1c1a17988ad0db2fdf7450e9b717065153.tar.bz2
cryptography-92838d1c1a17988ad0db2fdf7450e9b717065153.zip
Unknown algorithm test for PKCS8
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index ce4963be..d25ac0d1 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -835,6 +835,13 @@ class Backend(object):
raise UnsupportedAlgorithm(
"PEM data is encrypted with an unsupported cipher")
+ elif errors[0][1:] == (
+ self._lib.ERR_LIB_EVP,
+ self._lib.EVP_F_EVP_PKCS82PKEY,
+ self._lib.EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM
+ ):
+ raise ValueError("Unsupported private key algorithm.")
+
else:
assert errors[0][1] in (
self._lib.ERR_LIB_EVP,