aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcyli <cyli@twistedmatrix.com>2013-11-10 18:08:14 -0800
committercyli <cyli@twistedmatrix.com>2013-12-20 13:39:44 -0800
commite0562502d3006c9bc4968e76f02274ec7ed80582 (patch)
tree34c7c158c23572421cfc43dcb8c397e3065c381b
parentdb7a91138a4883de00917d862e69fe4414dac7b7 (diff)
downloadcryptography-e0562502d3006c9bc4968e76f02274ec7ed80582.tar.gz
cryptography-e0562502d3006c9bc4968e76f02274ec7ed80582.tar.bz2
cryptography-e0562502d3006c9bc4968e76f02274ec7ed80582.zip
Put customizations back in after rebase
-rw-r--r--cryptography/hazmat/backends/openssl/ssl.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/cryptography/hazmat/backends/openssl/ssl.py b/cryptography/hazmat/backends/openssl/ssl.py
index 1d22ded8..d91c89a6 100644
--- a/cryptography/hazmat/backends/openssl/ssl.py
+++ b/cryptography/hazmat/backends/openssl/ssl.py
@@ -16,6 +16,12 @@ INCLUDES = """
"""
TYPES = """
+/* Internally invented symbol to tell us if SSLv2 is supported */
+static const int PYOPENSSL_NO_SSL2;
+
+/* Internally invented symbol to tell us if SNI is supported */
+static const int PYOPENSSL_TLSEXT_HOSTNAME;
+
static const int SSL_FILETYPE_PEM;
static const int SSL_FILETYPE_ASN1;
static const int SSL_ERROR_NONE;
@@ -285,4 +291,23 @@ long SSL_CTX_get_timeout(const SSL_CTX *);
"""
CUSTOMIZATIONS = """
+#ifdef OPENSSL_NO_SSL2
+static const int PYOPENSSL_NO_SSL2 = 1;
+SSL_METHOD* (*SSLv2_method)() = NULL;
+SSL_METHOD* (*SSLv2_client_method)() = NULL;
+SSL_METHOD* (*SSLv2_server_method)() = NULL;
+#else
+static const int PYOPENSSL_NO_SSL2 = 0;
+#endif
+
+#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+static const int PYOPENSSL_TLSEXT_HOSTNAME = 1;
+#else
+static const int PYOPENSSL_TLSEXT_HOSTNAME = 0;
+void (*SSL_set_tlsext_host_name)(SSL *, char *) = NULL;
+const char* (*SSL_get_servername)(const SSL *, const int) = NULL;
+void (*SSL_CTX_set_tlsext_servername_callback)(
+ SSL_CTX *,
+ int (*cb)(const SSL *, int *, void *)) = NULL;
+#endif
"""