Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ noinst_HEADERS =
check_PROGRAMS =
dist_noinst_SCRIPTS =
DISTCLEANFILES =
pkginclude_HEADERS =
EXTRA_DIST =

ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -I$(top_srcdir)/include

lib_LTLIBRARIES = libwolfprov.la

include src/include.am
include include/include.am
include test/include.am
include certs/include.am
#include scripts/include.am

#noinst_PROGRAMS += bench
Expand All @@ -22,3 +26,17 @@ include test/include.am
#DISTCLEANFILES += .libs/bench

test: check
# By default, make distcheck will only add wolfProvider/ as an include directory.
# So, for example, a file like unit.h that has #include
# <wolfprovider/we_logging.h> won't be able to find wp_logging.h, because
# wolfProvider/include isn't an include directory. We add it here.
#
# The OpenSSL lib and include directories won't be visible to make distcheck
# either because make distcheck runs ./configure with no other options. If
# OpenSSL isn't installed in a standard location, this naked configure command
# will fail to find it. We tell it where to find the include and lib directory
# for OpenSSL here.
AM_DISTCHECK_CONFIGURE_FLAGS=CPPFLAGS="-I@abs_top_srcdir@/include \
@OPENSSL_INCLUDES@" \
LDFLAGS="@OPENSSL_LDFLAGS@"

8 changes: 8 additions & 0 deletions certs/include.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# for test_rsa.c
dist_noinst_SCRIPTS += certs/server-key.pem
dist_noinst_SCRIPTS += certs/server-cert.pem

# for test_ecc.c
dist_noinst_SCRIPTS += certs/server-ecc.pem
dist_noinst_SCRIPTS += certs/ecc-key.pem
2 changes: 0 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ if test "x$have_wolfssl" = "xyes"; then
LDFLAGS="$LDFLAGS $WOLFSSL_LDFLAGS"
fi

AC_CHECK_HEADERS([wolfssl/wolfcrypt/kdf.h])

# DEBUG
DEBUG_CFLAGS="-g -O0 -DWOLFPROV_DEBUG"

Expand Down
16 changes: 7 additions & 9 deletions include/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
# All paths should be given relative to the root
#

noinst_HEADERS += include/wolfprovider/version.h
noinst_HEADERS += include/wolfprovider/alg_funcs.h
noinst_HEADERS += include/wolfprovider/internal.h
noinst_HEADERS += include/wolfprovider/settings.h
noinst_HEADERS += include/wolfprovider/wp_logging.h
noinst_HEADERS += include/wolfprovider/wp_fips.h
noinst_HEADERS += include/wolfprovider/wp_params.h
noinst_HEADERS += include/wolfprovider/wp_wolfprov.h

#pkginclude_HEADERS =

pkginclude_HEADERS += include/wolfprovider/version.h
pkginclude_HEADERS += include/wolfprovider/alg_funcs.h
pkginclude_HEADERS += include/wolfprovider/settings.h
pkginclude_HEADERS += include/wolfprovider/wp_logging.h
pkginclude_HEADERS += include/wolfprovider/wp_fips.h
pkginclude_HEADERS += include/wolfprovider/wp_params.h
pkginclude_HEADERS += include/wolfprovider/wp_wolfprov.h
4 changes: 2 additions & 2 deletions scripts/utils-wolfssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
WOLFSSL_GIT="https://github.com/wolfSSL/wolfssl.git"
WOLFSSL_GIT=${WOLFSSL_GIT:-"https://github.com/wolfSSL/wolfssl.git"}
WOLFSSL_TAG=${WOLFSSL_TAG:-"v5.6.3-stable"}
WOLFSSL_SOURCE_DIR=${SCRIPT_DIR}/../wolfssl-source
WOLFSSL_INSTALL_DIR=${SCRIPT_DIR}/../wolfssl-install
Expand All @@ -42,7 +42,7 @@ clone_wolfssl() {

if [ ! -d ${WOLFSSL_SOURCE_DIR} ]; then
printf "\tClone wolfSSL ${WOLFSSL_TAG} ... "
git clone --depth=1 -b ${WOLFSSL_TAG} ${WOLFSSL_GIT} \
git clone -b ${WOLFSSL_TAG} ${WOLFSSL_GIT} \
${WOLFSSL_SOURCE_DIR} >>$LOG_FILE 2>&1
if [ $? != 0 ]; then
printf "ERROR.\n"
Expand Down
2 changes: 2 additions & 0 deletions test/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ check_PROGRAMS += test/unit.test
noinst_PROGRAMS += test/unit.test
DISTCLEANFILES += test/.libs/unit.test

# Override the 'certs' directory with the toplevel source directory for 'make distcheck' to work
test_unit_test_CPPFLAGS = -DCERTS_DIR='"$(abs_top_srcdir)/certs"'
test_unit_test_SOURCES = \
test/test_aestag.c \
test/test_cipher.c \
Expand Down
4 changes: 2 additions & 2 deletions test/test_ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ int test_ec_load_key(void* data)
params[0] = OSSL_PARAM_construct_end();

PRINT_MSG("Open ECC private key");
ctx = OSSL_STORE_open_ex("./certs/ecc-key.pem", wpLibCtx, NULL, NULL, NULL,
ctx = OSSL_STORE_open_ex(CERTS_DIR "/ecc-key.pem", wpLibCtx, NULL, NULL, NULL,
params, NULL, NULL);
err = ctx == NULL;
if (err == 0) {
Expand Down Expand Up @@ -1446,7 +1446,7 @@ int test_ec_load_cert(void* data)
params[0] = OSSL_PARAM_construct_end();

PRINT_MSG("Open certificate with ECC public key");
ctx = OSSL_STORE_open_ex("./certs/server-ecc.pem", wpLibCtx, NULL, NULL,
ctx = OSSL_STORE_open_ex(CERTS_DIR "/server-ecc.pem", wpLibCtx, NULL, NULL,
NULL, params, NULL, NULL);
err = ctx == NULL;
if (err == 0) {
Expand Down
4 changes: 2 additions & 2 deletions test/test_rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ int test_rsa_load_key(void* data)
params[0] = OSSL_PARAM_construct_end();

PRINT_MSG("Open RSA private key");
ctx = OSSL_STORE_open_ex("./certs/server-key.pem", wpLibCtx, NULL, NULL,
ctx = OSSL_STORE_open_ex(CERTS_DIR "/server-key.pem", wpLibCtx, NULL, NULL,
NULL, params, NULL, NULL);
err = ctx == NULL;
if (err == 0) {
Expand Down Expand Up @@ -784,7 +784,7 @@ int test_rsa_load_cert(void* data)
params[0] = OSSL_PARAM_construct_end();

PRINT_MSG("Open certificate with RSA public key");
ctx = OSSL_STORE_open_ex("./certs/server-cert.pem", wpLibCtx, NULL, NULL,
ctx = OSSL_STORE_open_ex(CERTS_DIR "/server-cert.pem", wpLibCtx, NULL, NULL,
NULL, params, NULL, NULL);
err = ctx == NULL;
if (err == 0) {
Expand Down
4 changes: 4 additions & 0 deletions test/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ void print_buffer(const char *desc, const unsigned char *buffer, size_t len);
#define TEST_DECL(func, data) { #func, func, data, 0, 0, 0 }
#endif

#ifndef CERTS_DIR
#define CERTS_DIR "./certs"
#endif

typedef int (*TEST_FUNC)(void *data);
typedef struct TEST_CASE {
const char *name;
Expand Down