mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
cmake: Use configure check for CRYPTO_ctr128_encrypt
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -110,6 +110,10 @@ if (OPENSSL_FOUND)
|
|||||||
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
|
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
|
||||||
check_function_exists(CRYPTO_THREADID_set_callback HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK)
|
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_LIBRARY})
|
||||||
|
check_function_exists(CRYPTO_ctr128_encrypt HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_HAVE_PTHREAD_H)
|
if (CMAKE_HAVE_PTHREAD_H)
|
||||||
|
@@ -91,6 +91,9 @@
|
|||||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||||
#cmakedefine HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
#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
|
||||||
|
|
||||||
/* Define to 1 if you have the `snprintf' function. */
|
/* Define to 1 if you have the `snprintf' function. */
|
||||||
#cmakedefine HAVE_SNPRINTF 1
|
#cmakedefine HAVE_SNPRINTF 1
|
||||||
|
|
||||||
|
@@ -594,11 +594,11 @@ static void aes_ctr_encrypt(struct ssh_cipher_struct *cipher, void *in, void *ou
|
|||||||
* Same for num, which is being used to store the current offset in blocksize in CTR
|
* Same for num, which is being used to store the current offset in blocksize in CTR
|
||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
# if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
#ifdef HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT
|
||||||
CRYPTO_ctr128_encrypt(in, out, len, &cipher->aes_key->key, cipher->aes_key->IV, tmp_buffer, &num, (block128_f)AES_encrypt);
|
CRYPTO_ctr128_encrypt(in, out, len, &cipher->aes_key->key, cipher->aes_key->IV, tmp_buffer, &num, (block128_f)AES_encrypt);
|
||||||
# else
|
#else
|
||||||
AES_ctr128_encrypt(in, out, len, &cipher->aes_key->key, cipher->aes_key->IV, tmp_buffer, &num);
|
AES_ctr128_encrypt(in, out, len, &cipher->aes_key->key, cipher->aes_key->IV, tmp_buffer, &num);
|
||||||
# endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
|
#endif /* HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aes_ctr_cleanup(struct ssh_cipher_struct *cipher){
|
static void aes_ctr_cleanup(struct ssh_cipher_struct *cipher){
|
||||||
|
Reference in New Issue
Block a user