From d50bb81c7d1f26c964340e4fdd6f8226194b3f5f Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 9 Apr 2019 10:40:54 +0200 Subject: [PATCH] travis: Run tests against wolfSSL Check for wolfssl/options.h because if it isn't included, checking other headers will trigger a warning about hardening the wolfSSL build, which will cause the check to fail with -Werror. If the file doesn't exist because user_settings.h is used, the check may be skipped by configuring with `ac_cv_header_wolfssl_options_h=yes`. --- .travis.yml | 2 ++ configure.ac | 2 +- scripts/test.sh | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7e70df553..3a62e2c15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,6 +81,8 @@ matrix: # the crypto plugins are build-tested with clang via "all" above - env: TEST=botan - env: TEST=botan LEAK_DETECTIVE=yes + - env: TEST=wolfssl + - env: TEST=wolfssl LEAK_DETECTIVE=yes - env: TEST=openssl - env: TEST=openssl LEAK_DETECTIVE=yes - env: TEST=openssl-1.0 diff --git a/configure.ac b/configure.ac index 08e830652..9a1c5a30d 100644 --- a/configure.ac +++ b/configure.ac @@ -1142,7 +1142,7 @@ if test x$wolfssl = xtrue; then AC_CHECK_LIB([$wolfssl_lib],[wolfSSL_Init],[LIBS="$LIBS"], [AC_MSG_ERROR([wolfSSL lib$wolfssl_lib not found])],[$DLLIB]) AC_SUBST(WOLFSSL_LIB, [-l$wolfssl_lib]) - AC_CHECK_HEADER([wolfssl/ssl.h],,[AC_MSG_ERROR([wolfSSL header wolfssl/ssl.h not found!])]) + AC_CHECK_HEADER([wolfssl/options.h],,[AC_MSG_ERROR([wolfSSL header wolfssl/options.h not found!])]) fi if test x$gcrypt = xtrue; then diff --git a/scripts/test.sh b/scripts/test.sh index b958db1a0..0f206b381 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -34,6 +34,33 @@ build_botan() cd - } +build_wolfssl() +{ + WOLFSSL_REV=v4.0.0-stable + WOLFSSL_DIR=$TRAVIS_BUILD_DIR/../wolfssl + + if test -d "$WOLFSSL_DIR"; then + return + fi + + echo "$ build_wolfssl()" + + WOLFSSL_CFLAGS="-DWOLFSSL_PUBLIC_MP -DWOLFSSL_DES_ECB" + WOLFSSL_CONFIG="--enable-keygen --enable-rsapss --enable-aesccm + --enable-aesctr --enable-des3 --enable-camellia + --enable-curve25519 --enable-ed25519" + + git clone https://github.com/wolfSSL/wolfssl.git $WOLFSSL_DIR && + cd $WOLFSSL_DIR && + git checkout -qf $WOLFSSL_REV && + ./autogen.sh && + ./configure C_EXTRA_FLAGS="$WOLFSSL_CFLAGS" $WOLFSSL_CONFIG && + make -j4 >/dev/null && + sudo make install >/dev/null && + sudo ldconfig || exit $? + cd - +} + build_tss2() { TSS2_REV=2.1.0 @@ -135,6 +162,14 @@ botan) build_botan fi ;; +wolfssl) + CONFIG="--disable-defaults --enable-pki --enable-wolfssl --enable-pem" + # build with custom options to enable all the features the plugin supports + DEPS="" + if test "$1" = "deps"; then + build_wolfssl + fi + ;; printf-builtin) CONFIG="--with-printf-hooks=builtin" ;; @@ -161,6 +196,7 @@ all|coverage|sonarcloud) PYDEPS="pytest" if test "$1" = "deps"; then build_botan + build_wolfssl build_tss2 fi use_custom_openssl $1