Merge "openssl 1.1 support: use OPENSSL_VERSION_NUMBER"

This commit is contained in:
zuul 2017-02-14 12:33:01 -06:00 committed by Gerrit Code Review
commit d4f512e7d9
2 changed files with 5 additions and 5 deletions

View File

@ -465,19 +465,19 @@ int ast_iostream_close(struct ast_iostream *stream)
SSL_get_error(stream->ssl, res)); 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)) { if (!SSL_is_server(stream->ssl)) {
#else #else
if (!stream->ssl->server) { if (!stream->ssl->server) {
#endif #endif
/* For client threads, ensure that the error stack is cleared */ /* For client threads, ensure that the error stack is cleared */
#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L #if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER >= 0x10000000L #if OPENSSL_VERSION_NUMBER >= 0x10000000L
ERR_remove_thread_state(NULL); ERR_remove_thread_state(NULL);
#else #else
ERR_remove_state(0); ERR_remove_state(0);
#endif /* OPENSSL_VERSION_NUMBER >= 0x10000000L */ #endif /* OPENSSL_VERSION_NUMBER >= 0x10000000L */
#endif /* !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L */ #endif /* !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L */
} }
SSL_free(stream->ssl); SSL_free(stream->ssl);

View File

@ -72,7 +72,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) int SSL_library_init(void)
{ {
#if defined(AST_DEVMODE) #if defined(AST_DEVMODE)
@ -114,7 +114,7 @@ void ERR_free_strings(void)
{ {
/* we can't allow this to be called, ever */ /* 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 */ #endif /* HAVE_OPENSSL */