Skip to content

Instantly share code, notes, and snippets.

@reaperhulk
Created March 21, 2014 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reaperhulk/5e4d3d30ac1598473206 to your computer and use it in GitHub Desktop.
Save reaperhulk/5e4d3d30ac1598473206 to your computer and use it in GitHub Desktop.
diff --git a/cryptography/hazmat/bindings/openssl/ssl.py b/cryptography/hazmat/bindings/openssl/ssl.py
index 9735ae6..728bbab 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,19 @@ 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. Sad trombone.
+#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) = 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 +468,8 @@ CONDITIONAL_NAMES = {
"SSL_set_SSL_CTX",
"TLSEXT_NAMETYPE_host_name",
],
+
+ "Cryptography_HAS_NETBSD_D1_METH": [
+ "DTLSv1_method",
+ ],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment