diff options
author | David Reid <dreid@dreid.org> | 2014-01-17 20:13:47 -0800 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2014-01-17 20:13:47 -0800 |
commit | f6ff9a73d2b223dada3fb862989ba9977e37bf24 (patch) | |
tree | fe4fd42399ba5a33dd5d8f6bb5e053e1e9d2f702 | |
parent | 5b5b5b7fe0eed883427632823f46c706a3917a88 (diff) | |
parent | e30d62cd9e2cf95259721b24bbf6d33aaf08161b (diff) | |
download | cryptography-f6ff9a73d2b223dada3fb862989ba9977e37bf24.tar.gz cryptography-f6ff9a73d2b223dada3fb862989ba9977e37bf24.tar.bz2 cryptography-f6ff9a73d2b223dada3fb862989ba9977e37bf24.zip |
Merge pull request #473 from reaperhulk/remove-thread-state
Add ERR_remove_thread_state
-rw-r--r-- | cryptography/hazmat/bindings/openssl/crypto.py | 2 | ||||
-rw-r--r-- | cryptography/hazmat/bindings/openssl/err.py | 19 |
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..5399b597 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_REMOVE_THREAD_STATE; + 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_REMOVE_THREAD_STATE = 1; +#else +static const long Cryptography_HAS_REMOVE_THREAD_STATE = 0; +typedef uint32_t CRYPTO_THREADID; +void (*ERR_remove_thread_state)(const CRYPTO_THREADID *); +#endif """ -CONDITIONAL_NAMES = {} +CONDITIONAL_NAMES = { + "Cryptography_HAS_REMOVE_THREAD_STATE": [ + "ERR_remove_thread_state" + ], +} |