diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-12-27 23:55:39 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-12-27 23:55:39 -0600 |
commit | c809360573fc2ef659c154740c32e98f35fc5da9 (patch) | |
tree | 82a4420511ddab15d1667cb8095266b5bdeb4920 | |
parent | 7721785f388fbbfa3072e600931eefbf019442b7 (diff) | |
download | cryptography-c809360573fc2ef659c154740c32e98f35fc5da9.tar.gz cryptography-c809360573fc2ef659c154740c32e98f35fc5da9.tar.bz2 cryptography-c809360573fc2ef659c154740c32e98f35fc5da9.zip |
RSA_R_OAEP_DECODING_ERROR is pretty ubiquitous
-rw-r--r-- | src/_cffi_src/openssl/err.py | 8 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/rsa.py | 4 | ||||
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/_conditional.py | 3 |
3 files changed, 1 insertions, 14 deletions
diff --git a/src/_cffi_src/openssl/err.py b/src/_cffi_src/openssl/err.py index 3eb783ee..9d97be16 100644 --- a/src/_cffi_src/openssl/err.py +++ b/src/_cffi_src/openssl/err.py @@ -14,7 +14,6 @@ static const int Cryptography_HAS_098H_ERROR_CODES; static const int Cryptography_HAS_098C_CAMELLIA_CODES; static const int Cryptography_HAS_EC_CODES; static const int Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR; -static const int Cryptography_HAS_RSA_R_OAEP_DECODING_ERROR; struct ERR_string_data_st { unsigned long error; @@ -336,11 +335,4 @@ static const long Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR = 1; static const long Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR = 0; static const long RSA_R_PKCS_DECODING_ERROR = 0; #endif - -#ifdef RSA_R_OAEP_DECODING_ERROR -static const long Cryptography_HAS_RSA_R_OAEP_DECODING_ERROR = 1; -#else -static const long Cryptography_HAS_RSA_R_OAEP_DECODING_ERROR = 0; -static const long RSA_R_OAEP_DECODING_ERROR = 0; -#endif """ diff --git a/src/cryptography/hazmat/backends/openssl/rsa.py b/src/cryptography/hazmat/backends/openssl/rsa.py index 1be6f059..033cd3b1 100644 --- a/src/cryptography/hazmat/backends/openssl/rsa.py +++ b/src/cryptography/hazmat/backends/openssl/rsa.py @@ -138,13 +138,11 @@ def _handle_rsa_enc_dec_error(backend, key): decoding_errors = [ backend._lib.RSA_R_BLOCK_TYPE_IS_NOT_01, backend._lib.RSA_R_BLOCK_TYPE_IS_NOT_02, + backend._lib.RSA_R_OAEP_DECODING_ERROR, ] if backend._lib.Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR: decoding_errors.append(backend._lib.RSA_R_PKCS_DECODING_ERROR) - if backend._lib.Cryptography_HAS_RSA_R_OAEP_DECODING_ERROR: - decoding_errors.append(backend._lib.RSA_R_OAEP_DECODING_ERROR) - assert errors[0].reason in decoding_errors raise ValueError("Decryption failed.") diff --git a/src/cryptography/hazmat/bindings/openssl/_conditional.py b/src/cryptography/hazmat/bindings/openssl/_conditional.py index c4e39db9..206c2915 100644 --- a/src/cryptography/hazmat/bindings/openssl/_conditional.py +++ b/src/cryptography/hazmat/bindings/openssl/_conditional.py @@ -219,9 +219,6 @@ CONDITIONAL_NAMES = { "Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR": [ "RSA_R_PKCS_DECODING_ERROR" ], - "Cryptography_HAS_RSA_R_OAEP_DECODING_ERROR": [ - "RSA_R_OAEP_DECODING_ERROR" - ], "Cryptography_HAS_GCM": [ "EVP_CTRL_GCM_GET_TAG", "EVP_CTRL_GCM_SET_TAG", |