ssl: Stop using deprecated Openssl APIs, by neheb.
This commit is contained in:
@@ -222,20 +222,22 @@ static int _smartdns_set_ecs_ip(void)
|
|||||||
|
|
||||||
static int _smartdns_init_ssl(void)
|
static int _smartdns_init_ssl(void)
|
||||||
{
|
{
|
||||||
|
#if OPENSSL_API_COMPAT < 0x10100000L
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
SSL_CRYPTO_thread_setup();
|
SSL_CRYPTO_thread_setup();
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _smartdns_destroy_ssl(void)
|
static int _smartdns_destroy_ssl(void)
|
||||||
{
|
{
|
||||||
|
#if OPENSSL_API_COMPAT < 0x10100000L
|
||||||
SSL_CRYPTO_thread_cleanup();
|
SSL_CRYPTO_thread_cleanup();
|
||||||
ERR_free_strings();
|
ERR_free_strings();
|
||||||
EVP_cleanup();
|
EVP_cleanup();
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -687,6 +687,7 @@ errout:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OPENSSL_API_COMPAT < 0x10100000
|
||||||
#define THREAD_STACK_SIZE (16 * 1024)
|
#define THREAD_STACK_SIZE (16 * 1024)
|
||||||
static pthread_mutex_t *lock_cs;
|
static pthread_mutex_t *lock_cs;
|
||||||
static long *lock_count;
|
static long *lock_count;
|
||||||
@@ -743,6 +744,7 @@ void SSL_CRYPTO_thread_cleanup(void)
|
|||||||
OPENSSL_free(lock_cs);
|
OPENSSL_free(lock_cs);
|
||||||
OPENSSL_free(lock_count);
|
OPENSSL_free(lock_count);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SERVER_NAME_LEN 256
|
#define SERVER_NAME_LEN 256
|
||||||
#define TLS_HEADER_LEN 5
|
#define TLS_HEADER_LEN 5
|
||||||
|
|||||||
Reference in New Issue
Block a user