diff options
author | xebd <xeb@mail.ru> | 2019-07-26 12:15:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-26 12:15:18 +0300 |
commit | baf551ad3708bb87a991cafa0b1a9cd42aaa2a3a (patch) | |
tree | bf1672b7b4b813d6b51e89b34748006e679a0128 | |
parent | 3f32b4f345d4e7594a162ee0e2bed1037772dc7b (diff) | |
parent | bb095554ae74d21e87beddf156476571339fddb2 (diff) | |
download | accel-ppp-baf551ad3708bb87a991cafa0b1a9cd42aaa2a3a.tar.gz accel-ppp-baf551ad3708bb87a991cafa0b1a9cd42aaa2a3a.zip |
Merge pull request #88 from themiron/openssl-lock-warnings
fix warnings with openssl 1.1.0+
-rw-r--r-- | accel-pppd/main.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/accel-pppd/main.c b/accel-pppd/main.c index ecffb7c1..e31a81cd 100644 --- a/accel-pppd/main.c +++ b/accel-pppd/main.c @@ -43,6 +43,7 @@ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; #ifdef CRYPTO_OPENSSL +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) static pthread_mutex_t *ssl_lock_cs; static unsigned long ssl_thread_id(void) @@ -58,15 +59,10 @@ static void ssl_lock(int mode, int type, const char *file, int line) pthread_mutex_unlock(&ssl_lock_cs[type]); } -static void openssl_init(void) +static void ssl_lock_init(void) { int i; - SSL_library_init(); - SSL_load_error_strings(); - OpenSSL_add_all_algorithms(); - OpenSSL_add_all_digests(); - ssl_lock_cs = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); for (i = 0; i < CRYPTO_num_locks(); i++) @@ -77,6 +73,19 @@ static void openssl_init(void) } #endif +static void openssl_init(void) +{ + SSL_library_init(); + SSL_load_error_strings(); + OpenSSL_add_all_algorithms(); + OpenSSL_add_all_digests(); + +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + ssl_lock_init(); +#endif +} +#endif + static void change_limits(void) { FILE *f; |