diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2016-06-19 23:27:11 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-06-19 22:27:11 -0500 |
commit | 41b4bce14260325348191044571c9808a77229aa (patch) | |
tree | 6743f96ed745af2955b586885fe44de9a3416e3c /src/_cffi_src | |
parent | 69e0cb798eca2337bf86812ae5a745ccf9f1600c (diff) | |
download | cryptography-41b4bce14260325348191044571c9808a77229aa.tar.gz cryptography-41b4bce14260325348191044571c9808a77229aa.tar.bz2 cryptography-41b4bce14260325348191044571c9808a77229aa.zip |
Simplify and remove some 0.9.8 code from the EVP bindings (#2996)
* Simplify and remove some 0.9.8 code from the EVP bindings
The Cryptography_ symbol remains because pyOpenSSL uses. There's still other 0.9.8isms in this file.
* only eclare this once
Diffstat (limited to 'src/_cffi_src')
-rw-r--r-- | src/_cffi_src/openssl/evp.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/_cffi_src/openssl/evp.py b/src/_cffi_src/openssl/evp.py index 62847265..7abf80d5 100644 --- a/src/_cffi_src/openssl/evp.py +++ b/src/_cffi_src/openssl/evp.py @@ -110,6 +110,7 @@ int EVP_PKEY_cmp(const EVP_PKEY *, const EVP_PKEY *); EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *); +int EVP_PKEY_id(const EVP_PKEY *); int Cryptography_EVP_PKEY_id(const EVP_PKEY *); /* in 1.1.0 _create and _destroy were renamed to _new and _free. The following @@ -153,7 +154,6 @@ int EVP_PKEY_verify(EVP_PKEY_CTX *, const unsigned char *, size_t, const unsigned char *, size_t); int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *); int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *); -int EVP_PKEY_id(const EVP_PKEY *); /* The following were macros in 0.9.8e. Once we drop support for RHEL/CentOS 5 we should move these back to FUNCTIONS. */ @@ -204,15 +204,11 @@ int (*EVP_PKEY_assign_EC_KEY)(EVP_PKEY *, EC_KEY *) = NULL; EC_KEY *(*EVP_PKEY_get1_EC_KEY)(EVP_PKEY *) = NULL; int (*EVP_PKEY_set1_EC_KEY)(EVP_PKEY *, EC_KEY *) = NULL; #endif -/* EVP_PKEY_id is not available on 0.9.8 so we'll define our own. This can - be removed when we remove 0.9.8 support. */ + int Cryptography_EVP_PKEY_id(const EVP_PKEY *key) { - #if OPENSSL_VERSION_NUMBER >= 0x10000000L - return EVP_PKEY_id(key); - #else - return key->type; - #endif + return EVP_PKEY_id(key); } + EVP_MD_CTX *Cryptography_EVP_MD_CTX_new(void) { #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) return EVP_MD_CTX_create(); |