From 4bb1381cfb5f00e31318c129a10610db79c6590a Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 25 Feb 2019 10:38:12 -0500 Subject: [PATCH] compile fixes for older openssl versions closes #711 Change-Id: I04925a0cf105bf70d63dd7b1ed3297aceecac5a5 --- lib/auxlib.h | 1 + lib/ssllib.c | 1 + recording-daemon/Makefile | 2 +- recording-daemon/packet.c | 4 ++++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/auxlib.h b/lib/auxlib.h index 59f17b1e9..20e0de3cf 100644 --- a/lib/auxlib.h +++ b/lib/auxlib.h @@ -5,6 +5,7 @@ #include #include "compat.h" #include +#include #define THREAD_BUF_SIZE 64 diff --git a/lib/ssllib.c b/lib/ssllib.c index bdecb8183..f5f1e2a8b 100644 --- a/lib/ssllib.c +++ b/lib/ssllib.c @@ -1,6 +1,7 @@ #include "ssllib.h" #include #include +#include "auxlib.h" #if OPENSSL_VERSION_NUMBER < 0x10100000L diff --git a/recording-daemon/Makefile b/recording-daemon/Makefile index f686b92df..88dda5681 100644 --- a/recording-daemon/Makefile +++ b/recording-daemon/Makefile @@ -1,7 +1,7 @@ TARGET= rtpengine-recording CFLAGS= -g -Wall -pthread -I. -I../lib/ -I../kernel-module/ -CFLAGS+= -std=c99 +CFLAGS+= -std=c99 -fno-strict-aliasing CFLAGS+= -D_GNU_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE CFLAGS+= $(shell pkg-config --cflags glib-2.0) CFLAGS+= $(shell pkg-config --cflags gthread-2.0) diff --git a/recording-daemon/packet.c b/recording-daemon/packet.c index 6a3e6dc38..ba60d2564 100644 --- a/recording-daemon/packet.c +++ b/recording-daemon/packet.c @@ -186,7 +186,11 @@ out: // initialise the connection ZERO(ret->tls_fwd_poller); dbg("Starting TLS connection to %s", endpoint_print_buf(&tls_send_to_ep)); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L ret->ssl_ctx = SSL_CTX_new(TLS_client_method()); +#else + ret->ssl_ctx = SSL_CTX_new(SSLv23_client_method()); +#endif if (!ret->ssl_ctx) { ilog(LOG_ERR, "Failed to create TLS context"); ssrc_tls_shutdown(ret);