aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-16 15:42:40 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-16 15:46:48 -0500
commit2b49e3456e14e7a85983571a12070dc8cecbb7c5 (patch)
treef21c42b6b38161d2c11db487ec2f39ebe6182447 /cryptography
parentac466747a7e8d15d9136c394e7337f0432fc0541 (diff)
downloadcryptography-2b49e3456e14e7a85983571a12070dc8cecbb7c5.tar.gz
cryptography-2b49e3456e14e7a85983571a12070dc8cecbb7c5.tar.bz2
cryptography-2b49e3456e14e7a85983571a12070dc8cecbb7c5.zip
add conditional ERR_remove_thread_state. PyOpenSSL uses this
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/bindings/openssl/crypto.py2
-rw-r--r--cryptography/hazmat/bindings/openssl/err.py19
2 files changed, 20 insertions, 1 deletions
diff --git a/cryptography/hazmat/bindings/openssl/crypto.py b/cryptography/hazmat/bindings/openssl/crypto.py
index 189867bd..40d91bf2 100644
--- a/cryptography/hazmat/bindings/openssl/crypto.py
+++ b/cryptography/hazmat/bindings/openssl/crypto.py
@@ -16,6 +16,8 @@ INCLUDES = """
"""
TYPES = """
+typedef ... CRYPTO_THREADID;
+
static const int SSLEAY_VERSION;
static const int SSLEAY_CFLAGS;
static const int SSLEAY_PLATFORM;
diff --git a/cryptography/hazmat/bindings/openssl/err.py b/cryptography/hazmat/bindings/openssl/err.py
index 1b66bd2a..99808d41 100644
--- a/cryptography/hazmat/bindings/openssl/err.py
+++ b/cryptography/hazmat/bindings/openssl/err.py
@@ -16,6 +16,8 @@ INCLUDES = """
"""
TYPES = """
+static const int Cryptography_HAS_NEW_THREAD_METHOD;
+
struct ERR_string_data_st {
unsigned long error;
const char *string;
@@ -114,9 +116,24 @@ int ERR_GET_LIB(unsigned long);
int ERR_GET_FUNC(unsigned long);
int ERR_GET_REASON(unsigned long);
int ERR_FATAL_ERROR(unsigned long);
+/* introduced in 1.0.0 so we have to handle this specially to continue
+ * supporting 0.9.8
+ */
+void ERR_remove_thread_state(const CRYPTO_THREADID *);
"""
CUSTOMIZATIONS = """
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+static const long Cryptography_HAS_NEW_THREAD_METHOD = 1;
+#else
+static const long Cryptography_HAS_NEW_THREAD_METHOD = 0;
+typedef uint32_t CRYPTO_THREADID;
+void (*ERR_remove_thread_state)(const CRYPTO_THREADID *);
+#endif
"""
-CONDITIONAL_NAMES = {}
+CONDITIONAL_NAMES = {
+ "Cryptography_HAS_NEW_THREAD_METHOD": [
+ "ERR_remove_thread_state"
+ ],
+}