aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2014-03-05 00:35:00 -0500
committerDonald Stufft <donald@stufft.io>2014-03-05 00:35:00 -0500
commite889cc2161d044303ae7ba682fa9c341aa1c99f5 (patch)
tree7f7dbb54c416f60a267148a67bdf3f887f9e41ae
parent8760bb0725010783d76b0fa6f6fd28935b1baa4a (diff)
parent27898f4fcc560e9bf01b88d8083ad7a6f0e77592 (diff)
downloadcryptography-e889cc2161d044303ae7ba682fa9c341aa1c99f5.tar.gz
cryptography-e889cc2161d044303ae7ba682fa9c341aa1c99f5.tar.bz2
cryptography-e889cc2161d044303ae7ba682fa9c341aa1c99f5.zip
Merge pull request #733 from alex/more-ec-names
Expose EC_get_builtin_curves
-rw-r--r--cryptography/hazmat/bindings/openssl/ec.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/cryptography/hazmat/bindings/openssl/ec.py
index c054a3b4..22de56d2 100644
--- a/cryptography/hazmat/bindings/openssl/ec.py
+++ b/cryptography/hazmat/bindings/openssl/ec.py
@@ -23,6 +23,7 @@ TYPES = """
static const int Cryptography_HAS_EC;
typedef ... EC_KEY;
+typedef ... EC_builtin_curve;
static const int NID_X9_62_c2pnb163v1;
static const int NID_X9_62_c2pnb163v2;
@@ -175,16 +176,27 @@ FUNCTIONS = """
MACROS = """
EC_KEY *EC_KEY_new_by_curve_name(int);
void EC_KEY_free(EC_KEY *);
+
+size_t EC_get_builtin_curves(EC_builtin_curve *, size_t);
+
+int Cryptography_EC_builtin_curve_get_nid(EC_builtin_curve *);
"""
CUSTOMIZATIONS = """
#ifdef OPENSSL_NO_EC
static const long Cryptography_HAS_EC = 0;
typedef void EC_KEY;
+typedef void EC_builtin_curve;
EC_KEY* (*EC_KEY_new_by_curve_name)(int) = NULL;
void (*EC_KEY_free)(EC_KEY *) = NULL;
+size_t (*EC_get_builtin_curves)(EC_builtin_curve *, size_t) = NULL;
+int (*Cryptography_EC_builtin_curve_get_nid)(EC_builtin_curve *) = NULL;
#else
static const long Cryptography_HAS_EC = 1;
+
+int Cryptography_EC_builtin_curve_get_nid(EC_builtin_curve *c) {
+ return c->nid;
+}
#endif
"""
@@ -192,5 +204,8 @@ CONDITIONAL_NAMES = {
"Cryptography_HAS_EC": [
"EC_KEY_new_by_curve_name",
"EC_KEY_free",
+ "EC_get_builtin_curves",
+
+ "Cryptography_EC_builtin_curve_get_nid",
],
}