From a2c17748aff57b015259deb6707f43c11ec49e73 Mon Sep 17 00:00:00 2001 From: Oleg Moskalenko Date: Sat, 27 Aug 2016 20:18:42 -0700 Subject: [PATCH] cleaning --- Makefile.in | 2 +- src/apps/common/apputils.h | 7 +--- src/apps/common/ns_turn_openssl.h | 50 ++++++++++++++++++++++++++ src/apps/relay/dtls_listener.c | 10 +----- src/apps/relay/mainrelay.h | 9 +---- src/apps/relay/ns_ioalib_engine_impl.c | 7 +--- src/apps/relay/ns_ioalib_impl.h | 2 +- src/apps/uclient/mainuclient.c | 9 +---- src/apps/uclient/session.h | 2 +- src/apps/uclient/startuclient.c | 2 +- src/apps/uclient/uclient.c | 3 +- src/apps/uclient/uclient.h | 4 +-- src/client/ns_turn_msg.c | 11 +----- src/ns_turn_defs.h | 5 --- 14 files changed, 62 insertions(+), 61 deletions(-) create mode 100644 src/apps/common/ns_turn_openssl.h diff --git a/Makefile.in b/Makefile.in index cde7dda..5bee418 100755 --- a/Makefile.in +++ b/Makefile.in @@ -16,7 +16,7 @@ SERVERTURN_HEADERS = src/server/ns_turn_allocation.h src/server/ns_turn_ioalib.h SERVERTURN_DEPS = ${LIBCLIENTTURN_HEADERS} ${SERVERTURN_HEADERS} ${MAKE_DEPS} SERVERTURN_MODS = ${LIBCLIENTTURN_MODS} src/server/ns_turn_allocation.c src/server/ns_turn_maps_rtcp.c src/server/ns_turn_maps.c src/server/ns_turn_server.c -COMMON_HEADERS = src/apps/common/apputils.h src/apps/common/ns_turn_utils.h src/apps/common/stun_buffer.h +COMMON_HEADERS = src/apps/common/apputils.h src/apps/common/ns_turn_openssl.h src/apps/common/ns_turn_utils.h src/apps/common/stun_buffer.h COMMON_MODS = src/apps/common/apputils.c src/apps/common/ns_turn_utils.c src/apps/common/stun_buffer.c COMMON_DEPS = ${LIBCLIENTTURN_DEPS} ${COMMON_MODS} ${COMMON_HEADERS} diff --git a/src/apps/common/apputils.h b/src/apps/common/apputils.h index f2994b5..f137ab0 100644 --- a/src/apps/common/apputils.h +++ b/src/apps/common/apputils.h @@ -33,17 +33,12 @@ #include -#include +#include "ns_turn_openssl.h" #include "ns_turn_ioaddr.h" #include "ns_turn_msg_defs.h" #include "ns_turn_ioalib.h" -#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L) -#undef OPENSSL_VERSION_NUMBER -#define OPENSSL_VERSION_NUMBER 0x1000107FL -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/src/apps/common/ns_turn_openssl.h b/src/apps/common/ns_turn_openssl.h new file mode 100644 index 0000000..eb33c14 --- /dev/null +++ b/src/apps/common/ns_turn_openssl.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011, 2012, 2013 Citrix Systems + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __NST_OPENSSL_LIB__ +#define __NST_OPENSSL_LIB__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L) +#undef OPENSSL_VERSION_NUMBER +#define OPENSSL_VERSION_NUMBER 0x1000107FL +#endif + +#endif //__NST_OPENSSL_LIB__ diff --git a/src/apps/relay/dtls_listener.c b/src/apps/relay/dtls_listener.c index bf19405..6f49d8d 100644 --- a/src/apps/relay/dtls_listener.c +++ b/src/apps/relay/dtls_listener.c @@ -34,15 +34,7 @@ #include "dtls_listener.h" #include "ns_ioalib_impl.h" -#include -#include -#include -#include - -#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L) -#undef OPENSSL_VERSION_NUMBER -#define OPENSSL_VERSION_NUMBER 0x1000107FL -#endif +#include "ns_turn_openssl.h" #include diff --git a/src/apps/relay/mainrelay.h b/src/apps/relay/mainrelay.h index 0f4a396..592a2db 100644 --- a/src/apps/relay/mainrelay.h +++ b/src/apps/relay/mainrelay.h @@ -59,14 +59,7 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ns_turn_openssl.h" #include "ns_turn_utils.h" #include "ns_turn_khash.h" diff --git a/src/apps/relay/ns_ioalib_engine_impl.c b/src/apps/relay/ns_ioalib_engine_impl.c index 56ae16c..80f1d13 100644 --- a/src/apps/relay/ns_ioalib_engine_impl.c +++ b/src/apps/relay/ns_ioalib_engine_impl.c @@ -44,7 +44,7 @@ #include -#include +#include "ns_turn_openssl.h" #if !defined(TURN_NO_HIREDIS) #include "hiredis_libevent2.h" @@ -54,11 +54,6 @@ #include TURN_SCTP_INCLUDE #endif -#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L) -#undef OPENSSL_VERSION_NUMBER -#define OPENSSL_VERSION_NUMBER 0x1000107FL -#endif - /* Compilation test: #if defined(IP_RECVTTL) #undef IP_RECVTTL diff --git a/src/apps/relay/ns_ioalib_impl.h b/src/apps/relay/ns_ioalib_impl.h index 4f373d7..cfb393a 100644 --- a/src/apps/relay/ns_ioalib_impl.h +++ b/src/apps/relay/ns_ioalib_impl.h @@ -41,7 +41,7 @@ #include -#include +#include "ns_turn_openssl.h" #include "ns_turn_ioalib.h" #include "turn_ports.h" diff --git a/src/apps/uclient/mainuclient.c b/src/apps/uclient/mainuclient.c index 0c3a728..5606f68 100644 --- a/src/apps/uclient/mainuclient.c +++ b/src/apps/uclient/mainuclient.c @@ -44,14 +44,7 @@ #include #include -#include -#include -#include - -#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L) -#undef OPENSSL_VERSION_NUMBER -#define OPENSSL_VERSION_NUMBER 0x1000107FL -#endif +#include "ns_turn_openssl.h" /////////////// extern definitions ///////////////////// diff --git a/src/apps/uclient/session.h b/src/apps/uclient/session.h index 6e394c8..33fb278 100644 --- a/src/apps/uclient/session.h +++ b/src/apps/uclient/session.h @@ -40,7 +40,7 @@ #include "stun_buffer.h" #include "apputils.h" -#include +#include "ns_turn_openssl.h" #ifdef __cplusplus extern "C" { diff --git a/src/apps/uclient/startuclient.c b/src/apps/uclient/startuclient.c index 74d6a97..7527dc6 100644 --- a/src/apps/uclient/startuclient.c +++ b/src/apps/uclient/startuclient.c @@ -37,7 +37,7 @@ #include "uclient.h" #include "session.h" -#include +#include "ns_turn_openssl.h" ///////////////////////////////////////// diff --git a/src/apps/uclient/uclient.c b/src/apps/uclient/uclient.c index b47cca4..aa9a008 100644 --- a/src/apps/uclient/uclient.c +++ b/src/apps/uclient/uclient.c @@ -37,8 +37,7 @@ #include #include -#include -#include +#include "ns_turn_openssl.h" #include diff --git a/src/apps/uclient/uclient.h b/src/apps/uclient/uclient.h index 5531a33..c7bc6d7 100644 --- a/src/apps/uclient/uclient.h +++ b/src/apps/uclient/uclient.h @@ -35,9 +35,7 @@ #include "stun_buffer.h" #include "session.h" -#include -#include -#include +#include "ns_turn_openssl.h" #ifdef __cplusplus extern "C" { diff --git a/src/client/ns_turn_msg.c b/src/client/ns_turn_msg.c index cf90598..1d5a7aa 100644 --- a/src/client/ns_turn_msg.c +++ b/src/client/ns_turn_msg.c @@ -33,16 +33,7 @@ ///////////// Security functions implementation from ns_turn_msg.h /////////// -#include -#include -#include -#include -#include - -#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L) -#undef OPENSSL_VERSION_NUMBER -#define OPENSSL_VERSION_NUMBER 0x1000107FL -#endif +#include "ns_turn_openssl.h" /////////// diff --git a/src/ns_turn_defs.h b/src/ns_turn_defs.h index bd02299..7ad1d5b 100644 --- a/src/ns_turn_defs.h +++ b/src/ns_turn_defs.h @@ -39,11 +39,6 @@ #include #endif -#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L) -#undef OPENSSL_VERSION_NUMBER -#define OPENSSL_VERSION_NUMBER 0x1000107FL -#endif - #include #include #include