aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven McDonald <steven.mcdonald@anchor.net.au>2015-02-18 16:18:29 +1100
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-02-19 09:17:37 -0600
commit6f711102f5549cb367bbd6c6e2222dc3d8847bbc (patch)
tree0b630e90d9b11c8f379a3a167038dccc4854b6bd
parent1165473f748ed8c1d661f9587963e99ad11fa51d (diff)
downloadcryptography-6f711102f5549cb367bbd6c6e2222dc3d8847bbc.tar.gz
cryptography-6f711102f5549cb367bbd6c6e2222dc3d8847bbc.tar.bz2
cryptography-6f711102f5549cb367bbd6c6e2222dc3d8847bbc.zip
Define COMP_METHOD when building against LibreSSL
LibreSSL no longer uses compression in ssl.h, so the case that was formerly activated by defining OPENSSL_NO_COMP is now the default, and COMP_METHOD isn't defined (it's defined in comp.h, but that's no longer included by ssl.h). In order to make all the type definitions here line up with what's actually in LibreSSL's ssl.h, define COMP_METHOD as void. This definition is still compatible with the later type declaration in ssl.py: typedef ... COMP_METHOD;
-rw-r--r--src/cryptography/hazmat/bindings/openssl/ssl.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/bindings/openssl/ssl.py b/src/cryptography/hazmat/bindings/openssl/ssl.py
index bf627139..2bbe4043 100644
--- a/src/cryptography/hazmat/bindings/openssl/ssl.py
+++ b/src/cryptography/hazmat/bindings/openssl/ssl.py
@@ -7,6 +7,14 @@ from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/ssl.h>
+/* LibreSSL has removed support for compression, and with it the
+ * COMP_METHOD use in ssl.h. This is a hack to make the function types
+ * in this code match those in ssl.h.
+ */
+#ifdef LIBRESSL_VERSION_NUMBER
+#define COMP_METHOD void
+#endif
+
typedef STACK_OF(SSL_CIPHER) Cryptography_STACK_OF_SSL_CIPHER;
"""