Skip to content

Commit

Permalink
remove unused locking functions (#4780)
Browse files Browse the repository at this point in the history
* remove unused locking functions

we do all this in C when necessary

* oops, need this
  • Loading branch information
reaperhulk authored and alex committed Feb 26, 2019
1 parent 177ba1c commit 8b2f548
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
26 changes: 2 additions & 24 deletions src/_cffi_src/openssl/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,15 @@
static const int CRYPTO_MEM_CHECK_OFF;
static const int CRYPTO_MEM_CHECK_ENABLE;
static const int CRYPTO_MEM_CHECK_DISABLE;
static const int CRYPTO_LOCK;
static const int CRYPTO_UNLOCK;
static const int CRYPTO_READ;
static const int CRYPTO_LOCK_SSL;
"""

FUNCTIONS = """
int CRYPTO_mem_ctrl(int);
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 */
int CRYPTO_num_locks(void);
void CRYPTO_set_locking_callback(void(*)(int, int, const char *, int));
/* as of 1.1.0 OpenSSL does its own locking *angelic chorus*. This function
is now a noop macro. We can delete this once we drop 1.0.2 support. */
void (*CRYPTO_get_locking_callback(void))(int, int, const char *, int);
/* SSLeay was removed in 1.1.0 */
Expand All @@ -56,8 +49,6 @@
void *OPENSSL_malloc(size_t);
void OPENSSL_free(void *);
/* This was removed in 1.1.0 */
void CRYPTO_lock(int, int, const char *, int);
/* Signature changed significantly in 1.1.0, only expose there for sanity */
int Cryptography_CRYPTO_set_mem_functions(
Expand Down Expand Up @@ -98,19 +89,6 @@
static const long Cryptography_HAS_LOCKING_CALLBACKS = 1;
#else
static const long Cryptography_HAS_LOCKING_CALLBACKS = 0;
#if !defined(CRYPTO_LOCK)
static const long CRYPTO_LOCK = 0;
#endif
#if !defined(CRYPTO_UNLOCK)
static const long CRYPTO_UNLOCK = 0;
#endif
#if !defined(CRYPTO_READ)
static const long CRYPTO_READ = 0;
#endif
#if !defined(CRYPTO_LOCK_SSL)
static const long CRYPTO_LOCK_SSL = 0;
#endif
void (*CRYPTO_lock)(int, int, const char *, int) = NULL;
#endif
#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110
Expand Down
5 changes: 0 additions & 5 deletions src/cryptography/hazmat/bindings/openssl/_conditional.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ def cryptography_has_tls_st():

def cryptography_has_locking_callbacks():
return [
"CRYPTO_LOCK",
"CRYPTO_UNLOCK",
"CRYPTO_READ",
"CRYPTO_LOCK_SSL",
"CRYPTO_lock",
"Cryptography_setup_ssl_threads",
]

Expand Down

0 comments on commit 8b2f548

Please sign in to comment.