From 675577bdb921c08bc604138050ce26c877d3f36e Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 16 Jan 2014 22:04:58 -0600 Subject: Expose the nids for the various eliptical curve things. I don't understand what these mean. --- cryptography/hazmat/bindings/openssl/ec.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/cryptography/hazmat/bindings/openssl/ec.py index cbb03360..c9ca388f 100644 --- a/cryptography/hazmat/bindings/openssl/ec.py +++ b/cryptography/hazmat/bindings/openssl/ec.py @@ -12,12 +12,22 @@ # limitations under the License. INCLUDES = """ +#include +#include """ TYPES = """ static const int Cryptography_HAS_EC; typedef ... EC_KEY; + +static const int NID_X9_62_prime192v1; +static const int NID_X9_62_prime192v2; +static const int NID_X9_62_prime192v3; +static const int NID_X9_62_prime239v1; +static const int NID_X9_62_prime239v2; +static const int NID_X9_62_prime239v3; +static const int NID_X9_62_prime256v1; """ FUNCTIONS = """ @@ -31,6 +41,14 @@ CUSTOMIZATIONS = """ #ifdef OPENSSL_NO_EC static const long Cryptography_HAS_EC = 0; EC_KEY* (*EC_KEY_new_by_curve_name)(int) = NULL; + +static const long NID_X9_62_prime192v1 = -1; +static const long NID_X9_62_prime192v2 = -1; +static const long NID_X9_62_prime192v3 = -1; +static const long NID_X9_62_prime239v1 = -1; +static const long NID_X9_62_prime239v2 = -1; +static const long NID_X9_62_prime239v3 = -1; +static const long NID_X9_62_prime256v1 = -1; #else static const long Cryptography_HAS_EC = 1; #endif @@ -39,5 +57,13 @@ static const long Cryptography_HAS_EC = 1; CONDITIONAL_NAMES = { "Cryptography_HAS_EC": [ "EC_KEY_new_by_curve_name", - ] + + "NID_X9_62_prime192v1", + "NID_X9_62_prime192v2", + "NID_X9_62_prime192v3", + "NID_X9_62_prime239v1", + "NID_X9_62_prime239v2", + "NID_X9_62_prime239v3", + "NID_X9_62_prime256v1", + ], } -- cgit v1.2.3