From 02461e9fbcb0698b412e1c623432fd6dad2aa524 Mon Sep 17 00:00:00 2001 From: Steffen Moser Date: Tue, 23 Aug 2022 08:58:45 +0200 Subject: [PATCH] First step to re-enable compilation with OpenSSL 1.0.x --- src/apps/relay/netengine.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/apps/relay/netengine.c b/src/apps/relay/netengine.c index 3921412..bd95625 100644 --- a/src/apps/relay/netengine.c +++ b/src/apps/relay/netengine.c @@ -30,6 +30,17 @@ #include "mainrelay.h" +//////////// Backward compatibility with OpenSSL 1.0.x ////////////// +#define HAVE_OPENSSL11_API (!(OPENSSL_VERSION_NUMBER < 0x10100001L || defined LIBRESSL_VERSION_NUMBER)) + +#ifndef HAVE_SSL_CTX_UP_REF +#define HAVE_SSL_CTX_UP_REF HAVE_OPENSSL11_API +#endif + +#if !HAVE_SSL_CTX_UP_REF +#define SSL_CTX_up_ref(ctx) CRYPTO_add(&(ctx)->references, 1, CRYPTO_LOCK_SSL_CTX) +#endif + //////////// Barrier for the threads ////////////// #if !defined(TURN_NO_THREAD_BARRIERS)