diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-17 05:46:27 -0800 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-17 05:46:27 -0800 |
commit | 29faafe7418dcb837ad9cddfbf57bddba681a22c (patch) | |
tree | 1ea0d90f94a0407b3fa63c6698fc5b09aac0956f | |
parent | 666bd2d7e162b3db0e6e74c6f4272d4dde2ac67f (diff) | |
parent | 675577bdb921c08bc604138050ce26c877d3f36e (diff) | |
download | cryptography-29faafe7418dcb837ad9cddfbf57bddba681a22c.tar.gz cryptography-29faafe7418dcb837ad9cddfbf57bddba681a22c.tar.bz2 cryptography-29faafe7418dcb837ad9cddfbf57bddba681a22c.zip |
Merge pull request #475 from alex/ecdhe-nids
Expose the nids for the various eliptical curve things. I don't understa...
-rw-r--r-- | cryptography/hazmat/bindings/openssl/ec.py | 28 |
1 files changed, 27 insertions, 1 deletions
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 <openssl/ec.h> +#include <openssl/obj_mac.h> """ 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", + ], } |