From 9a426a5003b324cfd77a33bcbe81d9763ea4ba95 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 1 Dec 2015 07:54:05 -0600 Subject: fix a warning in cffi cffi doesn't want to guess the type, so we'll deopaque the enum and strip the values out of the lib if EC is unavailable --- src/_cffi_src/openssl/ec.py | 6 +++++- src/cryptography/hazmat/bindings/openssl/_conditional.py | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/_cffi_src/openssl/ec.py b/src/_cffi_src/openssl/ec.py index 10c87c33..6a0aa720 100644 --- a/src/_cffi_src/openssl/ec.py +++ b/src/_cffi_src/openssl/ec.py @@ -29,7 +29,11 @@ typedef struct { int nid; const char *comment; } EC_builtin_curve; -typedef enum { ... } point_conversion_form_t; +typedef enum { + POINT_CONVERSION_COMPRESSED = 2, + POINT_CONVERSION_UNCOMPRESSED = 4, + POINT_CONVERSION_HYBRID = 6 +} point_conversion_form_t; """ FUNCTIONS = """ diff --git a/src/cryptography/hazmat/bindings/openssl/_conditional.py b/src/cryptography/hazmat/bindings/openssl/_conditional.py index f0ad1d5e..80a6dda3 100644 --- a/src/cryptography/hazmat/bindings/openssl/_conditional.py +++ b/src/cryptography/hazmat/bindings/openssl/_conditional.py @@ -141,6 +141,9 @@ CONDITIONAL_NAMES = { "i2o_ECPublicKey", "o2i_ECPublicKey", "SSL_CTX_set_tmp_ecdh", + "POINT_CONVERSION_COMPRESSED", + "POINT_CONVERSION_UNCOMPRESSED", + "POINT_CONVERSION_HYBRID", ], "Cryptography_HAS_EC_1_0_1": [ -- cgit v1.2.3