aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-01-16 22:04:58 -0600
committerAlex Gaynor <alex.gaynor@gmail.com>2014-01-16 22:04:58 -0600
commit675577bdb921c08bc604138050ce26c877d3f36e (patch)
tree8badaabb13b3c0ee127eba52a9ee574f4b3408e3
parent5950fe9bbb4ddd3a3b285afc0c91fad26e21b191 (diff)
downloadcryptography-675577bdb921c08bc604138050ce26c877d3f36e.tar.gz
cryptography-675577bdb921c08bc604138050ce26c877d3f36e.tar.bz2
cryptography-675577bdb921c08bc604138050ce26c877d3f36e.zip
Expose the nids for the various eliptical curve things. I don't understand what these mean.
-rw-r--r--cryptography/hazmat/bindings/openssl/ec.py28
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",
+ ],
}