diff options
author | Corey Farrell <git@cfware.com> | 2017-07-27 21:58:22 -0400 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2017-08-01 15:44:29 -0600 |
commit | 0f49e6ee2e270ef2e6df18c990fcf24f679eba44 (patch) | |
tree | e4649fa8837b425ae5a39464f36fc30cbcd431c4 /main/libasteriskssl.c | |
parent | 0d58fefa303f267eb8fa00d4aa1bcff12956111e (diff) |
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
Diffstat (limited to 'main/libasteriskssl.c')
-rw-r--r-- | main/libasteriskssl.c | 24 |
1 files changed, 13 insertions, 11 deletions
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 <openssl/ssl.h> #include <openssl/err.h> #endif -#include <dlfcn.h> +#if defined(HAVE_OPENSSL) && \ + !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) -#include "asterisk/_private.h" /* ast_ssl_init() */ +#include <dlfcn.h> #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 |