From 0f49e6ee2e270ef2e6df18c990fcf24f679eba44 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Thu, 27 Jul 2017 21:58:22 -0400 Subject: Fix compiler warnings on Fedora 26 / GCC 7. GCC 7 has added capability to produce warnings, this fixes most of those warnings. The specific warnings are disabled in a few places: * app_voicemail.c: truncation of paths more than 4096 chars in many places. * chan_mgcp.c: callid truncated to 80 chars. * cdr.c: two userfields are combined to cdr copy, fix would break ABI. * tcptls.c: ignore use of deprecated method SSLv3_client_method(). ASTERISK-27156 #close Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88 --- main/libasteriskssl.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'main/libasteriskssl.c') diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c index dcb3f88bb..a89f19125 100644 --- a/main/libasteriskssl.c +++ b/main/libasteriskssl.c @@ -31,20 +31,21 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") +#include "asterisk/_private.h" /* ast_ssl_init() */ + #ifdef HAVE_OPENSSL #include #include #endif -#include +#if defined(HAVE_OPENSSL) && \ + !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) -#include "asterisk/_private.h" /* ast_ssl_init() */ +#include #include "asterisk/utils.h" #include "asterisk/lock.h" -#ifdef HAVE_OPENSSL - #define get_OpenSSL_function(func) do { real_##func = dlsym(RTLD_NEXT, __stringify(func)); } while(0) static int startup_complete; @@ -74,7 +75,6 @@ static void ssl_lock(int mode, int n, const char *file, int line) } } -#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) int SSL_library_init(void) { #if defined(AST_DEVMODE) @@ -116,9 +116,6 @@ void ERR_free_strings(void) { /* we can't allow this to be called, ever */ } -#endif /* !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L */ - -#endif /* HAVE_OPENSSL */ /*! * \internal @@ -128,8 +125,6 @@ void ERR_free_strings(void) */ int ast_ssl_init(void) { -#if defined(HAVE_OPENSSL) && defined(OPENSSL_VERSION_NUMBER) && \ - (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)) unsigned int i; int (*real_SSL_library_init)(void); void (*real_CRYPTO_set_id_callback)(unsigned long (*)(void)); @@ -194,7 +189,14 @@ int ast_ssl_init(void) startup_complete = 1; -#endif /* HAVE_OPENSSL and its version < 1.1 */ return 0; } +#else + +int ast_ssl_init(void) +{ + return 0; +} + +#endif -- cgit v1.2.3