From 94c8816ecdb5af8243defe541f9cf21944dd2eea Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 20 Feb 2021 14:19:52 -0800 Subject: [PATCH] Fix compilation with newer wolfSSL (#499) Patch taken from OpenWrt. Signed-off-by: Rosen Penev --- configure.ac | 2 +- src/ippool.c | 1 + src/md5.h | 1 - src/ssl.c | 2 +- src/ssl.h | 2 ++ 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index ef802be5..5a5600db 100644 --- a/configure.ac +++ b/configure.ac @@ -397,7 +397,7 @@ AC_ARG_WITH([cyassl], [AS_HELP_STRING([--with-cyassl], [enable support for cyassl])],[],[with_cyassl=no]) AS_IF([test x"$with_cyassl" != xno], - [AC_CHECK_LIB([cyassl], [CyaSSL_Init], + [AC_CHECK_LIB([cyassl], [wolfSSL_Init], [AC_SUBST([LIBSSL], ["-lcyassl"]) AC_DEFINE([HAVE_CYASSL], [1], [Define if you have cyassl]) diff --git a/src/ippool.c b/src/ippool.c index 142b02bb..2006b7c0 100644 --- a/src/ippool.c +++ b/src/ippool.c @@ -35,6 +35,7 @@ int ippool_print(int fd, struct ippool_t *this) { char * sep = "-- %-15s ------------------------------------------------------------\n"; #define ERR 0 +#undef USED /* defined in */ #define USED 1 #define FREE 2 #define LIST 3 diff --git a/src/md5.h b/src/md5.h index 1385fdc8..936af49b 100644 --- a/src/md5.h +++ b/src/md5.h @@ -35,7 +35,6 @@ #define MD5Update MD5_Update #define MD5Final MD5_Final -typedef struct CYASSL_MD5_CTX MD5_CTX; #else struct MD5Context { diff --git a/src/ssl.c b/src/ssl.c index a69a2f77..475c8327 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -131,7 +131,7 @@ _openssl_env_init(openssl_env *env, char *engine, int server) { */ const long options = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_COMPRESSION; env->meth = SSLv23_method(); - env->ctx = SSL_CTX_new(env->meth); + env->ctx = SSL_CTX_new((void *)env->meth); SSL_CTX_set_options(env->ctx, options); if (_options.sslciphers) { SSL_CTX_set_cipher_list(env->ctx, _options.sslciphers); diff --git a/src/ssl.h b/src/ssl.h index d401cb5f..55875e58 100644 --- a/src/ssl.h +++ b/src/ssl.h @@ -48,6 +48,8 @@ typedef struct { #include #include +#define OPENSSL_NO_ENGINE +#include #include #include #include