Skip to content

Commit 6a18258

Browse files
committed
simple_http: Convert to WolfSSL
Fully convert to WolfSSL as recent version of WolfSSL dropped the support shims for CyaSSL. Travis.yml scripts updated to use and cache the new WolfSSL library. Signed-off-by: Christian Marangi <[email protected]>
1 parent d7b9a21 commit 6a18258

File tree

4 files changed

+101
-106
lines changed

4 files changed

+101
-106
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
- secure: fiVVKcMM8Cz8WAj6PB6eD/b+Y77klXOe9jbpehf6QwjFwf6paEHoMsrZ0aFXogm2Uej47GlTdRb3UkBqonbK4ANbu0ewsWCW0RGClZz5ghaSnfwdxEhuXsrFIax7DvJCStk2V84Keb+tSVemx4opxqZAlZ/Nen28S91KSDoJeRA=
1414
matrix:
1515
- BUILD_TYPE=normal
16-
- CYASSL="3.3.2" BUILD_TYPE=cyassl
16+
- WOLFSSL="5.6.4" BUILD_TYPE=wolfssl
1717
cache:
1818
directories:
1919
- dependencies-src

.travis_configure_wrapper.sh

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,47 @@ if [[ "$BUILD_TYPE" == "normal" ]]; then
1010
echo "Running Wifidog configure"
1111
./configure $@
1212

13-
elif [[ "$BUILD_TYPE" == "cyassl" ]]; then
14-
if [[ -z "$CYASSL" ]]; then
15-
echo "CYASSL not set."
13+
elif [[ "$BUILD_TYPE" == "wolfssl" ]]; then
14+
if [[ -z "$WOLFSSL" ]]; then
15+
echo "WOLFSSL not set."
1616
exit 1
1717
fi
1818
CUR=`pwd`
1919
mkdir -p dependencies-src || true
2020
mkdir -p dependencies-installed || true
21-
if [[ ! -f dependencies-installed/include/cyassl/ssl.h ]]; then
22-
echo "Cached CyaSSL install not found. Installing."
21+
if [[ ! -f dependencies-installed/include/wolfssl/ssl.h ]]; then
22+
echo "Cached WolfSSL install not found. Installing."
2323
cd dependencies-src
2424
# Check if travis cache is there
25-
if [[ -f cyassl-${CYASSL}/autogen.sh ]]; then
26-
echo "Found cached CyaSSL package"
25+
if [[ -f wolfssl-${WOLFSSL}/autogen.sh ]]; then
26+
echo "Found cached WolfSSL package"
2727
else
28-
echo "No cache, downloading CyaSSL"
29-
wget https://github.com/cyassl/cyassl/archive/v${CYASSL}.tar.gz \
30-
-O cyassl-${CYASSL}.tar.gz
31-
tar -xzf cyassl-${CYASSL}.tar.gz
28+
echo "No cache, downloading WolfSSL"
29+
wget https://github.com/wolfSSL/wolfssl/archive/v${WOLFSSL}-stable.tar.gz \
30+
-O wolfssl-${WOLFSSL}.tar.gz
31+
tar -xzf wolfssl-${WOLFSSL}.tar.gz
3232
fi
33-
cd cyassl-${CYASSL}
34-
echo "Content of cyassl-${CYASSL}:"
33+
cd wolfssl-${WOLFSSL}
34+
echo "Content of wolfssl-${WOLFSSL}:"
3535
ls
36-
echo "Running CyaSSL autogen.sh"
36+
echo "Running WolfSSL autogen.sh"
3737
./autogen.sh
38-
echo "Running CyaSSL configure"
38+
echo "Running WolfSSL configure"
3939
./configure --prefix="$CUR"/dependencies-installed/ --enable-ecc
4040
# make will pick up the cached object files - real savings
4141
# happen here
42-
echo "Running CyaSSL make"
42+
echo "Running WolfSSL make"
4343
make
44-
echo "Running CyaSSL make install"
44+
echo "Running WolfSSL make install"
4545
make install
4646
cd "$CUR"
4747
else
48-
echo "Cached CyaSSL install found."
48+
echo "Cached WolfSSL install found."
4949
fi
5050
echo "Running Wifidog configure"
5151
export CFLAGS="-I${CUR}/dependencies-installed/include/"
5252
export LDFLAGS="-L${CUR}/dependencies-installed/lib/"
53-
./configure --enable-cyassl $@
53+
./configure --enable-wolfssl $@
5454
else
5555
echo "Unknow BUILD_TYPE $BUILD_TYPE"
5656
exit 1

configure.in

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -85,48 +85,45 @@ AC_SUBST(enable_latex_docs)
8585
# Acutally perform the doxygen check
8686
BB_ENABLE_DOXYGEN
8787

88-
# Enable cyassl?
89-
AC_DEFUN([BB_CYASSL],
88+
# Enable wolfssl?
89+
AC_DEFUN([BB_WOLFSSL],
9090
[
91-
AC_ARG_ENABLE(cyassl, [ --enable-cyassl enable TLS support for auth server communication (no)], [], [enable_cyassl=no])
92-
if test "x$enable_cyassl" = xyes; then
93-
# CyaSSL has been renamed wolfSSL. Old method names are still available
94-
# via cyassl/ssl.h, which maps old methods to new methods via macros.
95-
# To find the proper lib to link against (cyassl or wolfssl), we do have
96-
# the use the new naming scheme below as cyassl/ssl.h is not available for
97-
# AC_SEARCH_LIBS
98-
AC_CHECK_HEADERS(cyassl/ssl.h)
99-
AC_SEARCH_LIBS([CyaTLSv1_client_method], [cyassl], [], [
100-
AC_SEARCH_LIBS([wolfTLSv1_client_method], [wolfssl], [], [
101-
AC_MSG_ERROR([unable to locate SSL lib: either wolfSSL or CyaSSL needed.])
102-
])
91+
AC_ARG_ENABLE(wolfssl, [ --enable-wolfssl enable TLS support for auth server communication (no)], [], [enable_wolfssl=no])
92+
if test "x$enable_wolfssl" = xyes; then
93+
AC_CHECK_HEADERS(wolfssl/ssl.h, [], [],
94+
[
95+
#include <wolfssl/options.h>
96+
])
97+
AC_SEARCH_LIBS([wolfTLSv1_client_method], [wolfssl], [], [
98+
AC_MSG_ERROR([unable to locate SSL lib: wolfSSL needed.])
10399
])
104100
105-
AC_MSG_CHECKING([for the CyaSSL SNI enabled])
101+
AC_MSG_CHECKING([for the Wolfssl SNI enabled])
106102
AC_LINK_IFELSE([AC_LANG_PROGRAM(
107103
[[
108104
#define HAVE_SNI
109-
#include <cyassl/ssl.h>
105+
#include <wolfssl/options.h>
106+
#include <wolfssl/ssl.h>
110107
]], [[
111-
CYASSL_CTX *ctx;
112-
CyaSSL_Init();
113-
ctx = CyaSSL_CTX_new(CyaTLSv1_client_method());
114-
CyaSSL_CTX_UseSNI(ctx, CYASSL_SNI_HOST_NAME, "wifidog.org", 11);
108+
WOLFSSL_CTX *ctx;
109+
wolfSSL_Init();
110+
ctx = wolfSSL_CTX_new(wolfTLSv1_client_method());
111+
wolfSSL_CTX_UseSNI(ctx, WOLFSSL_SNI_HOST_NAME, "wifidog.org", 11);
115112
]])], [enabled_sni=yes], [enabled_sni=no])
116113
117114
if test "x$enabled_sni" = xyes; then
118115
AC_MSG_RESULT([yes])
119-
AC_DEFINE([HAVE_SNI],, "Compile with CyaSSL SNI support")
116+
AC_DEFINE([HAVE_SNI],, "Compile with wolfssl SNI support")
120117
else
121118
AC_MSG_RESULT([no])
122119
fi
123120
124-
AC_DEFINE(USE_CYASSL,, "Compile with CyaSSL support")
121+
AC_DEFINE(USE_WOLFSSL,, "Compile with wolfssl support")
125122
fi
126123
])
127124

128-
# Actually perform the cyassl check
129-
BB_CYASSL
125+
# Actually perform the wolfssl check
126+
BB_WOLFSSL
130127

131128

132129

0 commit comments

Comments
 (0)