aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-05-27 21:35:16 +0100
committerAlex Stapleton <alexs@prol.etari.at>2014-05-27 21:50:52 +0100
commit57496d9fe3991158569400599ab08d0f45a75eae (patch)
treed7a055f75fb78708208cac122baf64b2e2a93fad
parent584be8aa2b5b07cfc34f2d36cd6326d4f0458683 (diff)
downloadcryptography-57496d9fe3991158569400599ab08d0f45a75eae.tar.gz
cryptography-57496d9fe3991158569400599ab08d0f45a75eae.tar.bz2
cryptography-57496d9fe3991158569400599ab08d0f45a75eae.zip
Error codes are different in OpenSSL 1.0.1
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py11
-rw-r--r--cryptography/hazmat/bindings/openssl/err.py1
2 files changed, 8 insertions, 4 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index 5529f10c..a5f21787 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -845,10 +845,13 @@ class Backend(object):
_Reasons.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
+ elif any(
+ error[1:] == (
+ self._lib.ERR_LIB_EVP,
+ self._lib.EVP_F_EVP_PKCS82PKEY,
+ self._lib.EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM
+ )
+ for error in errors
):
raise UnsupportedAlgorithm(
"Unsupported public key algorithm.",
diff --git a/cryptography/hazmat/bindings/openssl/err.py b/cryptography/hazmat/bindings/openssl/err.py
index 7ec693cc..f685e494 100644
--- a/cryptography/hazmat/bindings/openssl/err.py
+++ b/cryptography/hazmat/bindings/openssl/err.py
@@ -135,6 +135,7 @@ static const int EVP_F_PKCS5_V2_PBE_KEYIVGEN;
static const int EVP_F_PKCS8_SET_BROKEN;
static const int EVP_F_RC2_MAGIC_TO_METH;
static const int EVP_F_RC5_CTRL;
+
static const int EVP_R_AES_KEY_SETUP_FAILED;
static const int EVP_R_ASN1_LIB;
static const int EVP_R_BAD_BLOCK_LENGTH;