mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-31 00:03:07 +03:00
Remove no longer needed compatibility check
CRYPTO_THREADID_set_callback is available since 1.0.1 which is the oldest supported version. This means the check and compatibility code can be removed. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Jakub Jelen
parent
38806e1dd8
commit
816f06e172
@ -112,10 +112,6 @@ if (OPENSSL_FOUND)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES})
|
||||
check_function_exists(EVP_aes_128_gcm HAVE_OPENSSL_EVP_AES_GCM)
|
||||
|
||||
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES})
|
||||
check_function_exists(CRYPTO_THREADID_set_callback HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK)
|
||||
|
||||
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARIES})
|
||||
check_function_exists(CRYPTO_ctr128_encrypt HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT)
|
||||
|
@ -123,9 +123,6 @@
|
||||
/* Define to 1 if you have the `EVP_chacha20' function. */
|
||||
#cmakedefine HAVE_OPENSSL_EVP_CHACHA20 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||
#cmakedefine HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
|
||||
#cmakedefine HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
|
||||
|
||||
|
@ -57,14 +57,12 @@ void libcrypto_lock_callback(int mode, int i, const char *file, int line)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK
|
||||
static void libcrypto_THREADID_callback(CRYPTO_THREADID *id)
|
||||
{
|
||||
unsigned long thread_id = (*user_callbacks->thread_id)();
|
||||
|
||||
CRYPTO_THREADID_set_numeric(id, thread_id);
|
||||
}
|
||||
#endif /* HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK */
|
||||
|
||||
int crypto_thread_init(struct ssh_threads_callbacks_struct *cb)
|
||||
{
|
||||
@ -96,12 +94,7 @@ int crypto_thread_init(struct ssh_threads_callbacks_struct *cb)
|
||||
user_callbacks->mutex_init(&libcrypto_mutexes[i]);
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK
|
||||
CRYPTO_THREADID_set_callback(libcrypto_THREADID_callback);
|
||||
#else
|
||||
CRYPTO_set_id_callback(user_callbacks->thread_id);
|
||||
#endif
|
||||
|
||||
CRYPTO_set_locking_callback(libcrypto_lock_callback);
|
||||
|
||||
return SSH_OK;
|
||||
@ -116,12 +109,7 @@ void crypto_thread_finalize(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK
|
||||
CRYPTO_THREADID_set_callback(NULL);
|
||||
#else
|
||||
CRYPTO_set_id_callback(NULL);
|
||||
#endif
|
||||
|
||||
CRYPTO_set_locking_callback(NULL);
|
||||
|
||||
for (i = 0; i < n; ++i) {
|
||||
|
Reference in New Issue
Block a user