1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

add autotools bits for cyassl

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-02-06 15:43:00 +09:00
parent 68a672bb44
commit 23c5f2ecd0
6 changed files with 38 additions and 5 deletions

View file

@ -73,6 +73,12 @@ Configure script options
There are several other possible configure options
--enable-openssl Builds in the SSL support
--with-cyassl Use cyassl instead of OpenSSL... you will need CyaSSL
to have been configured with --enable-opensslExtra
\ when it was built.
--enable-libcrypto by default libwebsockets uses its own
built-in md5 and sha-1 implementation for
simplicity. However the libcrypto ones

View file

@ -190,6 +190,18 @@ CFLAGS="$CFLAGS -DLWS_BUILTIN_GETIFADDRS"
fi
AM_CONDITIONAL(USE_BUILTIN_GETIFADDRS, test x$builtin_getifaddrs = xyes)
#
#
#
AC_ARG_WITH(cyassl,
[ --with-cyassl Use CyaSSL instead of OpenSSL ],
[ use_cyassl=yes
])
if test "x$use_cyassl" = "xyes" ; then
CFLAGS="$CFLAGS -DUSE_CYASSL -DLWS_OPENSSL_SUPPORT"
fi
AM_CONDITIONAL(USE_CYASSL, test x$use_cyassl = xyes)
# Checks for header files.

View file

@ -47,6 +47,10 @@ endif
libwebsockets_la_CFLAGS=-Wall -std=gnu99 -pedantic
libwebsockets_la_LDFLAGS=
if USE_CYASSL
libwebsockets_la_LDFLAGS+= -lcyassl
endif
if DISABLE_DEBUG
libwebsockets_la_CFLAGS+= -O4
else

View file

@ -1691,10 +1691,15 @@ libwebsocket_create_context(int port, const char *interf,
#ifdef LWS_OPENSSL_SUPPORT
context->use_ssl = ssl_cert_filepath != NULL &&
ssl_private_key_filepath != NULL;
#ifdef USE_CYASSL
lwsl_notice(" Compiled with CYASSL support\n");
#else
lwsl_notice(" Compiled with OpenSSL support\n");
#endif
if (context->use_ssl)
lwsl_notice(" Compiled with SSL support, using it\n");
lwsl_notice(" Using SSL mode\n");
else
lwsl_notice(" Compiled with SSL support, not using it\n");
lwsl_notice(" Using non-SSL mode\n");
#else
if (ssl_cert_filepath != NULL &&

View file

@ -93,11 +93,18 @@
#endif
#ifdef LWS_OPENSSL_SUPPORT
#ifdef USE_CYASSL
#include <cyassl/openssl/ssl.h>
#include <cyassl/error.h>
unsigned char *
SHA1(const unsigned char *d, size_t n, unsigned char *md);
#else
#include <openssl/ssl.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/md5.h>
#include <openssl/sha.h>
#endif /* not USE_CYASSL */
#endif
#include "libwebsockets.h"
@ -487,7 +494,4 @@ user_callback_handle_rxflow(callback_function, struct libwebsocket_context * con
unsigned char *
SHA1(const unsigned char *d, size_t n, unsigned char *md);
void
MD5(const unsigned char *input, int ilen, unsigned char *output);
#endif

View file

@ -137,7 +137,9 @@ int lws_server_socket_service(struct libwebsocket_context *context,
ssize_t len;
#ifdef LWS_OPENSSL_SUPPORT
int m;
#ifndef USE_CYASSL
BIO *bio;
#endif
#endif
switch (wsi->mode) {