Skip to content

Commit 888e98e

Browse files
authored
Merge pull request #36 from bandi13/releaseFixes
Release fixes
2 parents f1c3baf + f8c2f88 commit 888e98e

9 files changed

Lines changed: 45 additions & 17 deletions

File tree

Makefile.am

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ noinst_HEADERS =
66
check_PROGRAMS =
77
dist_noinst_SCRIPTS =
88
DISTCLEANFILES =
9+
pkginclude_HEADERS =
10+
EXTRA_DIST =
911

1012
ACLOCAL_AMFLAGS = -I m4
13+
AM_CPPFLAGS = -I$(top_srcdir)/include
1114

1215
lib_LTLIBRARIES = libwolfprov.la
1316

1417
include src/include.am
1518
include include/include.am
1619
include test/include.am
20+
include certs/include.am
1721
#include scripts/include.am
1822

1923
#noinst_PROGRAMS += bench
@@ -22,3 +26,17 @@ include test/include.am
2226
#DISTCLEANFILES += .libs/bench
2327

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

certs/include.am

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# for test_rsa.c
3+
dist_noinst_SCRIPTS += certs/server-key.pem
4+
dist_noinst_SCRIPTS += certs/server-cert.pem
5+
6+
# for test_ecc.c
7+
dist_noinst_SCRIPTS += certs/server-ecc.pem
8+
dist_noinst_SCRIPTS += certs/ecc-key.pem

configure.ac

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ if test "x$have_wolfssl" = "xyes"; then
5151
LDFLAGS="$LDFLAGS $WOLFSSL_LDFLAGS"
5252
fi
5353

54-
AC_CHECK_HEADERS([wolfssl/wolfcrypt/kdf.h])
55-
5654
# DEBUG
5755
DEBUG_CFLAGS="-g -O0 -DWOLFPROV_DEBUG"
5856

include/include.am

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
# All paths should be given relative to the root
33
#
44

5-
noinst_HEADERS += include/wolfprovider/version.h
6-
noinst_HEADERS += include/wolfprovider/alg_funcs.h
75
noinst_HEADERS += include/wolfprovider/internal.h
8-
noinst_HEADERS += include/wolfprovider/settings.h
9-
noinst_HEADERS += include/wolfprovider/wp_logging.h
10-
noinst_HEADERS += include/wolfprovider/wp_fips.h
11-
noinst_HEADERS += include/wolfprovider/wp_params.h
12-
noinst_HEADERS += include/wolfprovider/wp_wolfprov.h
13-
14-
#pkginclude_HEADERS =
156

7+
pkginclude_HEADERS += include/wolfprovider/version.h
8+
pkginclude_HEADERS += include/wolfprovider/alg_funcs.h
9+
pkginclude_HEADERS += include/wolfprovider/settings.h
10+
pkginclude_HEADERS += include/wolfprovider/wp_logging.h
11+
pkginclude_HEADERS += include/wolfprovider/wp_fips.h
12+
pkginclude_HEADERS += include/wolfprovider/wp_params.h
13+
pkginclude_HEADERS += include/wolfprovider/wp_wolfprov.h

scripts/utils-wolfssl.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#
2525

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

4343
if [ ! -d ${WOLFSSL_SOURCE_DIR} ]; then
4444
printf "\tClone wolfSSL ${WOLFSSL_TAG} ... "
45-
git clone --depth=1 -b ${WOLFSSL_TAG} ${WOLFSSL_GIT} \
45+
git clone -b ${WOLFSSL_TAG} ${WOLFSSL_GIT} \
4646
${WOLFSSL_SOURCE_DIR} >>$LOG_FILE 2>&1
4747
if [ $? != 0 ]; then
4848
printf "ERROR.\n"

test/include.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ check_PROGRAMS += test/unit.test
99
noinst_PROGRAMS += test/unit.test
1010
DISTCLEANFILES += test/.libs/unit.test
1111

12+
# Override the 'certs' directory with the toplevel source directory for 'make distcheck' to work
13+
test_unit_test_CPPFLAGS = -DCERTS_DIR='"$(abs_top_srcdir)/certs"'
1214
test_unit_test_SOURCES = \
1315
test/test_aestag.c \
1416
test/test_cipher.c \

test/test_ecc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ int test_ec_load_key(void* data)
14111411
params[0] = OSSL_PARAM_construct_end();
14121412

14131413
PRINT_MSG("Open ECC private key");
1414-
ctx = OSSL_STORE_open_ex("./certs/ecc-key.pem", wpLibCtx, NULL, NULL, NULL,
1414+
ctx = OSSL_STORE_open_ex(CERTS_DIR "/ecc-key.pem", wpLibCtx, NULL, NULL, NULL,
14151415
params, NULL, NULL);
14161416
err = ctx == NULL;
14171417
if (err == 0) {
@@ -1446,7 +1446,7 @@ int test_ec_load_cert(void* data)
14461446
params[0] = OSSL_PARAM_construct_end();
14471447

14481448
PRINT_MSG("Open certificate with ECC public key");
1449-
ctx = OSSL_STORE_open_ex("./certs/server-ecc.pem", wpLibCtx, NULL, NULL,
1449+
ctx = OSSL_STORE_open_ex(CERTS_DIR "/server-ecc.pem", wpLibCtx, NULL, NULL,
14501450
NULL, params, NULL, NULL);
14511451
err = ctx == NULL;
14521452
if (err == 0) {

test/test_rsa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ int test_rsa_load_key(void* data)
749749
params[0] = OSSL_PARAM_construct_end();
750750

751751
PRINT_MSG("Open RSA private key");
752-
ctx = OSSL_STORE_open_ex("./certs/server-key.pem", wpLibCtx, NULL, NULL,
752+
ctx = OSSL_STORE_open_ex(CERTS_DIR "/server-key.pem", wpLibCtx, NULL, NULL,
753753
NULL, params, NULL, NULL);
754754
err = ctx == NULL;
755755
if (err == 0) {
@@ -784,7 +784,7 @@ int test_rsa_load_cert(void* data)
784784
params[0] = OSSL_PARAM_construct_end();
785785

786786
PRINT_MSG("Open certificate with RSA public key");
787-
ctx = OSSL_STORE_open_ex("./certs/server-cert.pem", wpLibCtx, NULL, NULL,
787+
ctx = OSSL_STORE_open_ex(CERTS_DIR "/server-cert.pem", wpLibCtx, NULL, NULL,
788788
NULL, params, NULL, NULL);
789789
err = ctx == NULL;
790790
if (err == 0) {

test/unit.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ void print_buffer(const char *desc, const unsigned char *buffer, size_t len);
6262
#define TEST_DECL(func, data) { #func, func, data, 0, 0, 0 }
6363
#endif
6464

65+
#ifndef CERTS_DIR
66+
#define CERTS_DIR "./certs"
67+
#endif
68+
6569
typedef int (*TEST_FUNC)(void *data);
6670
typedef struct TEST_CASE {
6771
const char *name;

0 commit comments

Comments
 (0)