From 380e61372737dd9f90464900cf924965be9f5f2f Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Wed, 16 Apr 2014 14:13:49 -0400 Subject: Expose EVP_PKEY_EC and EVP_PKEY_assign_EC_KEY --- cryptography/hazmat/bindings/openssl/evp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cryptography/hazmat/bindings/openssl/evp.py b/cryptography/hazmat/bindings/openssl/evp.py index 88cf5c34..5ffbe43f 100644 --- a/cryptography/hazmat/bindings/openssl/evp.py +++ b/cryptography/hazmat/bindings/openssl/evp.py @@ -37,6 +37,7 @@ typedef struct evp_pkey_st { typedef ... EVP_PKEY_CTX; static const int EVP_PKEY_RSA; static const int EVP_PKEY_DSA; +static const int EVP_PKEY_EC; static const int EVP_MAX_MD_SIZE; static const int EVP_CTRL_GCM_SET_IVLEN; static const int EVP_CTRL_GCM_GET_TAG; @@ -122,6 +123,7 @@ MACROS = """ void OpenSSL_add_all_algorithms(void); int EVP_PKEY_assign_RSA(EVP_PKEY *, RSA *); int EVP_PKEY_assign_DSA(EVP_PKEY *, DSA *); +int EVP_PKEY_assign_EC_KEY(EVP_PKEY *, EC_KEY *); int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *); int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *, int, int, void *); -- cgit v1.2.3 From 5a7fd73a82310f949646127382055c8ccf9c7853 Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Wed, 16 Apr 2014 14:52:41 -0400 Subject: Add customizations for OPENSSL_NO_EC to EVP --- cryptography/hazmat/bindings/openssl/evp.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cryptography/hazmat/bindings/openssl/evp.py b/cryptography/hazmat/bindings/openssl/evp.py index 5ffbe43f..f2a7599d 100644 --- a/cryptography/hazmat/bindings/openssl/evp.py +++ b/cryptography/hazmat/bindings/openssl/evp.py @@ -213,6 +213,11 @@ int (*Cryptography_EVP_PKEY_encrypt)(EVP_PKEY_CTX *, unsigned char *, size_t *, int (*Cryptography_EVP_PKEY_decrypt)(EVP_PKEY_CTX *, unsigned char *, size_t *, const unsigned char *, size_t) = NULL; #endif +#ifdef OPENSSL_NO_EC +static const int EVP_PKEY_EC = 0; +int (*EVP_PKEY_assign_EC_KEY)(EVP_PKEY *, EC_KEY *) = NULL; +#endif + """ CONDITIONAL_NAMES = { @@ -238,5 +243,9 @@ CONDITIONAL_NAMES = { "Cryptography_EVP_PKEY_decrypt", "EVP_PKEY_decrypt_init", "EVP_PKEY_CTX_set_signature_md", + ], + "Cryptography_HAS_EC": [ + "EVP_PKEY_EC", + "EVP_PKEY_assign_EC_KEY", ] } -- cgit v1.2.3 From 1ebba9f420fa1f30ae8217ed901172a0cdc27689 Mon Sep 17 00:00:00 2001 From: Jeff Tang Date: Wed, 16 Apr 2014 15:26:31 -0400 Subject: Remove EVP_PKEY_EC from conditional --- cryptography/hazmat/bindings/openssl/evp.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/cryptography/hazmat/bindings/openssl/evp.py b/cryptography/hazmat/bindings/openssl/evp.py index f2a7599d..963537c8 100644 --- a/cryptography/hazmat/bindings/openssl/evp.py +++ b/cryptography/hazmat/bindings/openssl/evp.py @@ -214,7 +214,6 @@ int (*Cryptography_EVP_PKEY_decrypt)(EVP_PKEY_CTX *, unsigned char *, size_t *, const unsigned char *, size_t) = NULL; #endif #ifdef OPENSSL_NO_EC -static const int EVP_PKEY_EC = 0; int (*EVP_PKEY_assign_EC_KEY)(EVP_PKEY *, EC_KEY *) = NULL; #endif @@ -245,7 +244,6 @@ CONDITIONAL_NAMES = { "EVP_PKEY_CTX_set_signature_md", ], "Cryptography_HAS_EC": [ - "EVP_PKEY_EC", "EVP_PKEY_assign_EC_KEY", ] } -- cgit v1.2.3