aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcyli <cyli@twistedmatrix.com>2013-10-19 23:19:10 -0700
committercyli <cyli@twistedmatrix.com>2013-12-20 13:39:43 -0800
commit02209c6045d8a5702f30c7401dfe6755208edef1 (patch)
tree519333a93605bb96ee22cafc6c3775d4821199ed
parent3a61d720d0d622d1a8c019db4fe5c512ccdf7c3e (diff)
downloadcryptography-02209c6045d8a5702f30c7401dfe6755208edef1.tar.gz
cryptography-02209c6045d8a5702f30c7401dfe6755208edef1.tar.bz2
cryptography-02209c6045d8a5702f30c7401dfe6755208edef1.zip
Unfortunate hack to make replacing some callback signature in the function definitions work
-rw-r--r--cryptography/hazmat/backends/openssl/ssl.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/cryptography/hazmat/backends/openssl/ssl.py b/cryptography/hazmat/backends/openssl/ssl.py
index 3a100f18..dee5edc5 100644
--- a/cryptography/hazmat/backends/openssl/ssl.py
+++ b/cryptography/hazmat/backends/openssl/ssl.py
@@ -13,6 +13,14 @@
INCLUDES = """
#include <openssl/ssl.h>
+
+/* This is a gross hack - if it is not here, as well as in the TYPES section,
+ * because it is needed to replace some function signatures in the FUNCTIONS
+ * section, and may be needed by PyOpenSSL
+ */
+typedef int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx);
+typedef void info_callback(const SSL *ssl, int where, int ret);
+typedef int tlsext_servername_callback(const SSL *ssl, int *alert, void *arg);
"""
TYPES = """