From 3376498e5e8bc133468a3e60427846e237f3b49d Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Sun, 6 Nov 2016 10:48:41 +0000 Subject: [PATCH] Update: completly abstracted OpenSSL into tls.[ch] --- src/connection.c | 6 +++--- src/tls.h | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/connection.c b/src/connection.c index ca5bc10a..bfd8862a 100644 --- a/src/connection.c +++ b/src/connection.c @@ -160,7 +160,7 @@ static unsigned long _next_connection_id(void) } -#ifdef HAVE_OPENSSL +#ifdef ICECAST_CAP_TLS static void get_ssl_certificate(ice_config_t *config) { config->tls_ok = ssl_ok = 0; @@ -213,7 +213,7 @@ static void get_ssl_certificate(ice_config_t *config) ICECAST_LOG_INFO("No TLS capability. " "Rebuild Icecast with openSSL support to enable this."); } -#endif /* HAVE_OPENSSL */ +#endif /* ICECAST_CAP_TLS */ /* handlers (default) for reading and writing a connection_t, no encrpytion @@ -263,7 +263,7 @@ connection_t *connection_create (sock_t sock, sock_t serversock, char *ip) */ void connection_uses_ssl(connection_t *con) { -#ifdef HAVE_OPENSSL +#ifdef ICECAST_CAP_TLS if (con->tls) return; diff --git a/src/tls.h b/src/tls.h index 62fe6fb2..0aaef553 100644 --- a/src/tls.h +++ b/src/tls.h @@ -16,6 +16,12 @@ #include "common/net/sock.h" +/* Do we have TLS Support? */ +#if defined(HAVE_OPENSSL) +#define ICECAST_CAP_TLS +#endif + + typedef struct tls_ctx_tag tls_ctx_t; typedef struct tls_tag tls_t;