aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-01-07 17:11:29 -0800
committerPaul Kehrer <paul.l.kehrer@gmail.com>2016-01-07 21:27:00 -0800
commit3a2ae678710e7f61c7fe374e1ebc76e0b4705ecb (patch)
tree4c13c6a72f9fce1cba9bcb70b8507b6ddadf929a
parentff90806ea1c62212f77a4d040fe491d05fdf3462 (diff)
downloadcryptography-3a2ae678710e7f61c7fe374e1ebc76e0b4705ecb.tar.gz
cryptography-3a2ae678710e7f61c7fe374e1ebc76e0b4705ecb.tar.bz2
cryptography-3a2ae678710e7f61c7fe374e1ebc76e0b4705ecb.zip
use EVP_PKEY_id where we can
-rw-r--r--src/_cffi_src/openssl/evp.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/_cffi_src/openssl/evp.py b/src/_cffi_src/openssl/evp.py
index 5d631a69..1d37b814 100644
--- a/src/_cffi_src/openssl/evp.py
+++ b/src/_cffi_src/openssl/evp.py
@@ -229,8 +229,13 @@ 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 RHEL5 0.9.8e so we'll define our own */
+/* 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) {
- return key->type;
+ #if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ return EVP_PKEY_id(key);
+ #else
+ return key->type;
+ #endif
}
"""