From: Tzafrir Cohen Date: Sat, 21 Jan 2017 05:57:33 +0000 (+0200) Subject: openssl 1.1 support: use OPENSSL_VERSION_NUMBER X-Git-Tag: 14.4.0-rc1~93^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c572e172665647abd27ea65a4c45f893161c8c44;p=thirdparty%2Fasterisk.git openssl 1.1 support: use OPENSSL_VERSION_NUMBER Use OPENSSL_VERSION_NUMBER instead of OPENSSL_API_COMPAT to detect the openssl 1.1 API. ASTERISK-26109 #close Change-Id: I4e448f55ef516aedf6ad154037c35577a421a458 --- diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c index 4e6ea1a133..33fcf4f2e7 100644 --- a/main/libasteriskssl.c +++ b/main/libasteriskssl.c @@ -74,7 +74,7 @@ static void ssl_lock(int mode, int n, const char *file, int line) } } -#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L +#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L int SSL_library_init(void) { #if defined(AST_DEVMODE) @@ -116,7 +116,7 @@ void ERR_free_strings(void) { /* we can't allow this to be called, ever */ } -#endif /* !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L */ +#endif /* !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L */ #endif /* HAVE_OPENSSL */ diff --git a/main/tcptls.c b/main/tcptls.c index 513676c926..c49379cbfd 100644 --- a/main/tcptls.c +++ b/main/tcptls.c @@ -399,19 +399,19 @@ static int tcptls_stream_close(void *cookie) SSL_get_error(stream->ssl, res)); } -#if defined(OPENSSL_API_COMPAT) && OPENSSL_API_COMPAT >= 0x10100000L +#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L if (!SSL_is_server(stream->ssl)) { #else if (!stream->ssl->server) { #endif /* For client threads, ensure that the error stack is cleared */ -#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L -#if OPENSSL_VERSION_NUMBER >= 0x10000000L +#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L +#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER >= 0x10000000L ERR_remove_thread_state(NULL); #else ERR_remove_state(0); -#endif /* OPENSSL_VERSION_NUMBER >= 0x10000000L */ -#endif /* !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L */ +#endif /* openssl = 1.0 */ +#endif /* openssl < 1.1 */ } SSL_free(stream->ssl);