Skip to content

Commit

Permalink
Fix compilation with newer wolfSSL (#499)
Browse files Browse the repository at this point in the history
Patch taken from OpenWrt.

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb authored Feb 20, 2021
1 parent 05f9955 commit 94c8816
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
1 change: 1 addition & 0 deletions src/ippool.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ int ippool_print(int fd, struct ippool_t *this) {
char * sep = "-- %-15s ------------------------------------------------------------\n";

#define ERR 0
#undef USED /* defined in <wolfssl/wolfcrypt/integer.h> */
#define USED 1
#define FREE 2
#define LIST 3
Expand Down
1 change: 0 additions & 1 deletion src/md5.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#define MD5Update MD5_Update
#define MD5Final MD5_Final

typedef struct CYASSL_MD5_CTX MD5_CTX;
#else

struct MD5Context {
Expand Down
2 changes: 1 addition & 1 deletion src/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ typedef struct {
#include <time.h>
#include <string.h>

#define OPENSSL_NO_ENGINE
#include <cyassl/options.h>
#include <cyassl/ssl.h>
#include <cyassl/openssl/bio.h>
#include <cyassl/openssl/crypto.h>
Expand Down

0 comments on commit 94c8816

Please sign in to comment.