diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2018-06-20 08:50:33 -0700 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2018-06-20 10:50:33 -0500 |
commit | 58fd9c412ad8e91f1453f86ba1fc16479f5b11d0 (patch) | |
tree | ccde66f0d6a14a9e12190d58b78f7382f1089b1c /src/_cffi_src/openssl | |
parent | 2d0afd3485a6349924f921d12dc94a302999ae20 (diff) | |
download | cryptography-58fd9c412ad8e91f1453f86ba1fc16479f5b11d0.tar.gz cryptography-58fd9c412ad8e91f1453f86ba1fc16479f5b11d0.tar.bz2 cryptography-58fd9c412ad8e91f1453f86ba1fc16479f5b11d0.zip |
Perform an OPENSSL_cleanup before checking the heap in our memleak tests (#4293)
* Perform an OPENSSL_cleanup before checking the heap in our memleak tests
* Make this binding conditional
* typo
* need to put this call before we reset the function ptrs
Diffstat (limited to 'src/_cffi_src/openssl')
-rw-r--r-- | src/_cffi_src/openssl/crypto.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/_cffi_src/openssl/crypto.py b/src/_cffi_src/openssl/crypto.py index 449fff5e..03672d55 100644 --- a/src/_cffi_src/openssl/crypto.py +++ b/src/_cffi_src/openssl/crypto.py @@ -11,6 +11,7 @@ INCLUDES = """ TYPES = """ static const long Cryptography_HAS_LOCKING_CALLBACKS; static const long Cryptography_HAS_MEM_FUNCTIONS; +static const long Cryptography_HAS_OPENSSL_CLEANUP; static const int SSLEAY_VERSION; static const int SSLEAY_CFLAGS; @@ -34,8 +35,9 @@ static const int CRYPTO_LOCK_SSL; FUNCTIONS = """ int CRYPTO_mem_ctrl(int); -/* CRYPTO_cleanup_all_ex_data became a macro in 1.1.0 */ + void CRYPTO_cleanup_all_ex_data(void); +void OPENSSL_cleanup(void); /* as of 1.1.0 OpenSSL does its own locking *angelic chorus*. These functions have become macros that are no ops */ @@ -112,6 +114,10 @@ void (*CRYPTO_lock)(int, int, const char *, int) = NULL; #endif #if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 +static const long Cryptography_HAS_OPENSSL_CLEANUP = 0; + +void (*OPENSSL_cleanup)(void) = NULL; + /* This function has a significantly different signature pre-1.1.0. since it is * for testing only, we don't bother to expose it on older OpenSSLs. */ @@ -122,6 +128,7 @@ int (*Cryptography_CRYPTO_set_mem_functions)( void (*)(void *, const char *, int)) = NULL; #else +static const long Cryptography_HAS_OPENSSL_CLEANUP = 1; static const long Cryptography_HAS_MEM_FUNCTIONS = 1; int Cryptography_CRYPTO_set_mem_functions( |