From 611c27d1ec36f29276072d484882376e87e92728 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 28 Jan 2014 10:40:46 -0800 Subject: Fixed #521 -- work on systems with no ec header at all --- cryptography/hazmat/bindings/openssl/ec.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/cryptography/hazmat/bindings/openssl/ec.py index 9f10365a..57da7634 100644 --- a/cryptography/hazmat/bindings/openssl/ec.py +++ b/cryptography/hazmat/bindings/openssl/ec.py @@ -12,7 +12,10 @@ # limitations under the License. INCLUDES = """ +#ifdef OPENSSL_NO_EC #include +#endif + #include """ -- cgit v1.2.3 From 0c782cf19a1c79e1b95c01876ac020784a058506 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 28 Jan 2014 11:03:45 -0800 Subject: Whoops, backwards --- cryptography/hazmat/bindings/openssl/ec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/cryptography/hazmat/bindings/openssl/ec.py index 57da7634..10bb011f 100644 --- a/cryptography/hazmat/bindings/openssl/ec.py +++ b/cryptography/hazmat/bindings/openssl/ec.py @@ -12,7 +12,7 @@ # limitations under the License. INCLUDES = """ -#ifdef OPENSSL_NO_EC +#ifndef OPENSSL_NO_EC #include #endif -- cgit v1.2.3 From af5536972e26415ad5f4d685e7774ceac28a06be Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 28 Jan 2014 13:37:42 -0800 Subject: This type is not defined either of course --- cryptography/hazmat/bindings/openssl/ec.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/cryptography/hazmat/bindings/openssl/ec.py index 10bb011f..90481b9b 100644 --- a/cryptography/hazmat/bindings/openssl/ec.py +++ b/cryptography/hazmat/bindings/openssl/ec.py @@ -46,6 +46,7 @@ CUSTOMIZATIONS = """ static const long Cryptography_HAS_EC = 0; EC_KEY* (*EC_KEY_new_by_curve_name)(int) = NULL; void (*EC_KEY_free)(EC_KEY *) = NULL; +typedef void EC_KEY; #else static const long Cryptography_HAS_EC = 1; #endif -- cgit v1.2.3 From e8f7766acdbf24646b475d4d5ffd213c30f355a9 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 28 Jan 2014 14:01:49 -0800 Subject: Doh, reorder --- cryptography/hazmat/bindings/openssl/ec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/cryptography/hazmat/bindings/openssl/ec.py index 90481b9b..06fd710c 100644 --- a/cryptography/hazmat/bindings/openssl/ec.py +++ b/cryptography/hazmat/bindings/openssl/ec.py @@ -44,9 +44,9 @@ MACROS = """ CUSTOMIZATIONS = """ #ifdef OPENSSL_NO_EC static const long Cryptography_HAS_EC = 0; +typedef void EC_KEY; EC_KEY* (*EC_KEY_new_by_curve_name)(int) = NULL; void (*EC_KEY_free)(EC_KEY *) = NULL; -typedef void EC_KEY; #else static const long Cryptography_HAS_EC = 1; #endif -- cgit v1.2.3 From 83b4eee23b78ac4b096099bad037bb89ce957a51 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 28 Jan 2014 14:11:01 -0800 Subject: This needs to be first --- cryptography/hazmat/bindings/openssl/ec.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/cryptography/hazmat/bindings/openssl/ec.py index 06fd710c..042026fa 100644 --- a/cryptography/hazmat/bindings/openssl/ec.py +++ b/cryptography/hazmat/bindings/openssl/ec.py @@ -14,6 +14,8 @@ INCLUDES = """ #ifndef OPENSSL_NO_EC #include +#else +typedef void EC_KEY; #endif #include @@ -44,7 +46,6 @@ MACROS = """ CUSTOMIZATIONS = """ #ifdef OPENSSL_NO_EC static const long Cryptography_HAS_EC = 0; -typedef void EC_KEY; EC_KEY* (*EC_KEY_new_by_curve_name)(int) = NULL; void (*EC_KEY_free)(EC_KEY *) = NULL; #else -- cgit v1.2.3 From 628a1c45412f70180b3786b001b159510d9bb545 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 28 Jan 2014 14:34:50 -0800 Subject: C is not a good programming language --- cryptography/hazmat/bindings/openssl/ec.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/cryptography/hazmat/bindings/openssl/ec.py index 042026fa..39403ff2 100644 --- a/cryptography/hazmat/bindings/openssl/ec.py +++ b/cryptography/hazmat/bindings/openssl/ec.py @@ -14,8 +14,6 @@ INCLUDES = """ #ifndef OPENSSL_NO_EC #include -#else -typedef void EC_KEY; #endif #include @@ -36,16 +34,17 @@ static const int NID_X9_62_prime256v1; """ FUNCTIONS = """ -EC_KEY *EC_KEY_new_by_curve_name(int); -void EC_KEY_free(EC_KEY *); """ MACROS = """ +EC_KEY *EC_KEY_new_by_curve_name(int); +void EC_KEY_free(EC_KEY *); """ CUSTOMIZATIONS = """ #ifdef OPENSSL_NO_EC static const long Cryptography_HAS_EC = 0; +typedef void EC_KEY; EC_KEY* (*EC_KEY_new_by_curve_name)(int) = NULL; void (*EC_KEY_free)(EC_KEY *) = NULL; #else -- cgit v1.2.3 From 67d5c24f263875920aa87bf4dbd5eb250c03328c Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 28 Jan 2014 14:42:41 -0800 Subject: Fuck, fix --- cryptography/hazmat/bindings/openssl/ssl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptography/hazmat/bindings/openssl/ssl.py b/cryptography/hazmat/bindings/openssl/ssl.py index cd872d18..2b4e54f1 100644 --- a/cryptography/hazmat/bindings/openssl/ssl.py +++ b/cryptography/hazmat/bindings/openssl/ssl.py @@ -393,6 +393,6 @@ CONDITIONAL_NAMES = { ], "Cryptography_HAS_EC": [ - "EC_KEY_new_by_curve_name", + "SSL_CTX_set_tmp_ecdh", ] } -- cgit v1.2.3