diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-03-21 10:58:19 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-03-21 11:23:38 -0400 |
commit | 10312c1768ebeb59106d2c1538e4fb491462088b (patch) | |
tree | 9cb598bd49a3d7f11489699db6cc2731dbf463ce | |
parent | 23c641dad201446a019d4a5f1181908744fd347a (diff) | |
download | cryptography-10312c1768ebeb59106d2c1538e4fb491462088b.tar.gz cryptography-10312c1768ebeb59106d2c1538e4fb491462088b.tar.bz2 cryptography-10312c1768ebeb59106d2c1538e4fb491462088b.zip |
workaround a netbsd bug where they did not compile with d1_meth.c
-rw-r--r-- | cryptography/hazmat/bindings/openssl/ssl.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cryptography/hazmat/bindings/openssl/ssl.py b/cryptography/hazmat/bindings/openssl/ssl.py index 9735ae6a..4749ab44 100644 --- a/cryptography/hazmat/bindings/openssl/ssl.py +++ b/cryptography/hazmat/bindings/openssl/ssl.py @@ -41,6 +41,7 @@ static const long Cryptography_HAS_OP_NO_COMPRESSION; static const long Cryptography_HAS_SSL_OP_MSIE_SSLV2_RSA_PADDING; static const long Cryptography_HAS_SSL_SET_SSL_CTX; static const long Cryptography_HAS_SSL_OP_NO_TICKET; +static const long Cryptography_HAS_NETBSD_D1_METH; static const long SSL_FILETYPE_PEM; static const long SSL_FILETYPE_ASN1; @@ -401,6 +402,24 @@ static const long Cryptography_HAS_SSL_SET_SSL_CTX = 0; static const long TLSEXT_NAMETYPE_host_name = 0; SSL_CTX *(*SSL_set_SSL_CTX)(SSL *, SSL_CTX *) = NULL; #endif + +/* NetBSD shipped without including d1_meth.c. This workaround checks to see + if the version of NetBSD we're currently running on is old enough to + have the bug and provides an empty implementation so we can link and + then remove the function from the ffi object. */ +#ifdef __NetBSD__ +# include <sys/param.h> +# if (__NetBSD_Version__ < 699003800) +static const long Cryptography_HAS_NETBSD_D1_METH = 0; +const SSL_METHOD *DTLSv1_method)(void) { + return NULL; +} +# else +static const long Cryptography_HAS_NETBSD_D1_METH = 1; +# endif +#else +static const long Cryptography_HAS_NETBSD_D1_METH = 1; +#endif """ CONDITIONAL_NAMES = { @@ -454,4 +473,8 @@ CONDITIONAL_NAMES = { "SSL_set_SSL_CTX", "TLSEXT_NAMETYPE_host_name", ], + + "Cryptography_HAS_NETBSD_D1_METH": [ + "DTLSv1_method", + ], } |