aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Reid <dreid@dreid.org>2014-03-05 15:40:30 -0800
committerDavid Reid <dreid@dreid.org>2014-03-05 15:40:30 -0800
commit01e8ac3da73200ad3ff080482733fcfeecaa655e (patch)
tree1cb005ae4d4a3deec1c55afbbb8e144d762f5779
parent138c12ca2fb7be92f8e2ab4594201f31a51b99a6 (diff)
parent05c37cce58aeef99ae8e011c5c0b672b87724dd5 (diff)
downloadcryptography-01e8ac3da73200ad3ff080482733fcfeecaa655e.tar.gz
cryptography-01e8ac3da73200ad3ff080482733fcfeecaa655e.tar.bz2
cryptography-01e8ac3da73200ad3ff080482733fcfeecaa655e.zip
Merge pull request #738 from alex/non-opaque-curve
Try to make this not-opaque. Might not work on CentOS
-rw-r--r--cryptography/hazmat/bindings/openssl/ec.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/cryptography/hazmat/bindings/openssl/ec.py
index 22de56d2..4a42960c 100644
--- a/cryptography/hazmat/bindings/openssl/ec.py
+++ b/cryptography/hazmat/bindings/openssl/ec.py
@@ -23,7 +23,10 @@ TYPES = """
static const int Cryptography_HAS_EC;
typedef ... EC_KEY;
-typedef ... EC_builtin_curve;
+typedef struct {
+ int nid;
+ const char *comment;
+} EC_builtin_curve;
static const int NID_X9_62_c2pnb163v1;
static const int NID_X9_62_c2pnb163v2;
@@ -179,24 +182,21 @@ 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;
+typedef struct {
+ int nid;
+ const char *comment;
+} 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
"""
@@ -205,7 +205,5 @@ CONDITIONAL_NAMES = {
"EC_KEY_new_by_curve_name",
"EC_KEY_free",
"EC_get_builtin_curves",
-
- "Cryptography_EC_builtin_curve_get_nid",
],
}