Merge pull request #522 from alex/no-ec-openssl

Fixed #521 -- work on systems with no ec header at all
diff --git a/cryptography/hazmat/bindings/openssl/ec.py b/cryptography/hazmat/bindings/openssl/ec.py
index 9f10365..39403ff 100644
--- a/cryptography/hazmat/bindings/openssl/ec.py
+++ b/cryptography/hazmat/bindings/openssl/ec.py
@@ -12,7 +12,10 @@
 # limitations under the License.
 
 INCLUDES = """
+#ifndef OPENSSL_NO_EC
 #include <openssl/ec.h>
+#endif
+
 #include <openssl/obj_mac.h>
 """
 
@@ -31,16 +34,17 @@
 """
 
 FUNCTIONS = """
-EC_KEY *EC_KEY_new_by_curve_name(int);
-void EC_KEY_free(EC_KEY *);
 """
 
 MACROS = """
+EC_KEY *EC_KEY_new_by_curve_name(int);
+void EC_KEY_free(EC_KEY *);
 """
 
 CUSTOMIZATIONS = """
 #ifdef OPENSSL_NO_EC
 static const long Cryptography_HAS_EC = 0;
+typedef void EC_KEY;
 EC_KEY* (*EC_KEY_new_by_curve_name)(int) = NULL;
 void (*EC_KEY_free)(EC_KEY *) = NULL;
 #else
diff --git a/cryptography/hazmat/bindings/openssl/ssl.py b/cryptography/hazmat/bindings/openssl/ssl.py
index cd872d1..2b4e54f 100644
--- a/cryptography/hazmat/bindings/openssl/ssl.py
+++ b/cryptography/hazmat/bindings/openssl/ssl.py
@@ -393,6 +393,6 @@
     ],
 
     "Cryptography_HAS_EC": [
-        "EC_KEY_new_by_curve_name",
+        "SSL_CTX_set_tmp_ecdh",
     ]
 }