Skip to content

Commit 5795bd3

Browse files
authored
Merge pull request #21 from dgarske/fix_wraptest
Fix for test_wrap_unwrap_key handle leak. Add GitHub CI action
2 parents 9392dbb + d7b147a commit 5795bd3

File tree

10 files changed

+263
-162
lines changed

10 files changed

+263
-162
lines changed

.github/workflows/unit-test.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: wolfPKCS11 Build Tests
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
#pull wolfPKCS11
16+
- uses: actions/checkout@v3
17+
18+
#setup wolfssl
19+
- uses: actions/checkout@v3
20+
with:
21+
repository: wolfssl/wolfssl
22+
path: wolfssl
23+
- name: wolfssl autogen
24+
working-directory: ./wolfssl
25+
run: ./autogen.sh
26+
- name: wolfssl configure
27+
working-directory: ./wolfssl
28+
run: |
29+
./configure --enable-wolftpm --enable-rsapss --enable-keygen --enable-pwdbased --enable-scrypt \
30+
C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT"
31+
- name: wolfssl make install
32+
working-directory: ./wolfssl
33+
run: make
34+
- name: wolfssl make install
35+
working-directory: ./wolfssl
36+
run: |
37+
sudo make install
38+
sudo ldconfig
39+
40+
#setup wolfPKCS11
41+
- name: wolfpkcs11 autogen
42+
run: ./autogen.sh
43+
- name: wolfpkcs11 configure
44+
run: ./configure
45+
- name: wolfpkcs11 make
46+
run: make
47+
- name: wolfpkcs11 make check
48+
run: make check
49+
- name: wolfpkcs11 make install
50+
run: sudo make install
51+
- name: wolfpkcs11 make dist
52+
run: make dist
53+
54+
# capture logs on failure
55+
- name: Upload failure logs
56+
if: failure()
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: wolfpkcs11-test-logs
60+
path: |
61+
test-suite.log
62+
retention-days: 5

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ xxx_ar_flags=$((ar --help) 2>&1)
2323
AS_CASE([$xxx_ar_flags],[*'use actual timestamps and uids/gids'*],[: ${AR_FLAGS="Ucru"}])
2424

2525
AC_CANONICAL_HOST
26+
AC_CANONICAL_TARGET
2627

2728
AM_INIT_AUTOMAKE([1.11 -Wall -Werror -Wno-portability foreign tar-ustar subdir-objects no-define color-tests])
2829

30+
AC_PROG_INSTALL
2931
AC_ARG_PROGRAM
3032
AC_CONFIG_MACRO_DIR([m4])
3133
AC_CONFIG_HEADERS([wolfpkcs11/config.h])
@@ -60,10 +62,8 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
6062
# Checks for programs.
6163
AC_PROG_CC
6264
AM_PROG_CC_C_O
63-
AC_PROG_INSTALL
6465

6566
# Checks for header files.
66-
AC_HEADER_STDC
6767
AC_CHECK_SIZEOF([long long], 8)
6868
AC_CHECK_SIZEOF([long], 4)
6969

m4/ax_create_generic_config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# DESCRIPTION
1010
#
1111
# Creates a generic PACKAGE-config file that has all the things that you
12-
# want, hmm, well, atleast it has --cflags, --version, --libs. Ahhm, did
12+
# want, hmm, well, at least it has --cflags, --version, --libs. Ahhm, did
1313
# you see ax_path_generic in the autoconf-archive? ;-)
1414
#
1515
# this macros saves you all the typing for a pkg-config.in script, you
@@ -78,7 +78,7 @@ echo 'package="'$P'"' >>$F
7878
echo 'version="'$V'"' >>$F
7979
echo 'libs="'$L'"' >>$F
8080
echo ' ' >>$F
81-
# in the order of occurence a standard automake Makefile
81+
# in the order of occurrence a standard automake Makefile
8282
echo 'prefix="'$prefix'"' >>$F
8383
echo 'exec_prefix="'$exec_prefix'"' >>$F
8484
echo 'bindir="'$bindir'"' >>$F

m4/ax_harden_compiler_flags.m4

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
AX_APPEND_COMPILE_FLAGS([-Wno-pragmas],,[$ax_append_compile_cflags_extra])
120120
121121
AX_APPEND_COMPILE_FLAGS([-Wall],,[$ax_append_compile_cflags_extra])
122-
AX_APPEND_COMPILE_FLAGS([-Wno-strict-aliasing],,[$ax_append_compile_cflags_extra])
123122
AX_APPEND_COMPILE_FLAGS([-Wextra],,[$ax_append_compile_cflags_extra])
124123
AX_APPEND_COMPILE_FLAGS([-Wunknown-pragmas],,[$ax_append_compile_cflags_extra])
125124
AX_APPEND_COMPILE_FLAGS([-Wthis-test-should-fail],,[$ax_append_compile_cflags_extra])
@@ -145,7 +144,7 @@
145144
AX_APPEND_COMPILE_FLAGS([-Woverride-init],,[$ax_append_compile_cflags_extra])
146145
AX_APPEND_COMPILE_FLAGS([-Wpointer-arith],,[$ax_append_compile_cflags_extra])
147146
AX_APPEND_COMPILE_FLAGS([-Wpointer-sign],,[$ax_append_compile_cflags_extra])
148-
AX_APPEND_COMPILE_FLAGS([-Wredundant-decls],,[$ax_append_compile_cflags_extra])
147+
dnl AX_APPEND_COMPILE_FLAGS([-Wredundant-decls],,[$ax_append_compile_cflags_extra])
149148
AX_APPEND_COMPILE_FLAGS([-Wshadow],,[$ax_append_compile_cflags_extra])
150149
AX_APPEND_COMPILE_FLAGS([-Wshorten-64-to-32],,[$ax_append_compile_cflags_extra])
151150
AX_APPEND_COMPILE_FLAGS([-Wsign-compare],,[$ax_append_compile_cflags_extra])
@@ -188,7 +187,6 @@
188187
])
189188
190189
AX_APPEND_COMPILE_FLAGS([-Wall],,[$ax_append_compile_cxxflags_extra])
191-
AX_APPEND_COMPILE_FLAGS([-Wno-strict-aliasing],,[$ax_append_compile_cxxflags_extra])
192190
AX_APPEND_COMPILE_FLAGS([-Wextra],,[$ax_append_compile_cxxflags_extra])
193191
AX_APPEND_COMPILE_FLAGS([-Wunknown-pragmas],,[$ax_append_compile_cxxflags_extra])
194192
AX_APPEND_COMPILE_FLAGS([-Wthis-test-should-fail],,[$ax_append_compile_cxxflags_extra])
@@ -208,7 +206,7 @@
208206
AX_APPEND_COMPILE_FLAGS([-Wnormalized=id],,[$ax_append_compile_cxxflags_extra])
209207
AX_APPEND_COMPILE_FLAGS([-Woverloaded-virtual],,[$ax_append_compile_cxxflags_extra])
210208
AX_APPEND_COMPILE_FLAGS([-Wpointer-arith],,[$ax_append_compile_cxxflags_extra])
211-
AX_APPEND_COMPILE_FLAGS([-Wredundant-decls],,[$ax_append_compile_cxxflags_extra])
209+
dnl AX_APPEND_COMPILE_FLAGS([-Wredundant-decls],,[$ax_append_compile_cxxflags_extra])
212210
AX_APPEND_COMPILE_FLAGS([-Wshadow],,[$ax_append_compile_cxxflags_extra])
213211
AX_APPEND_COMPILE_FLAGS([-Wshorten-64-to-32],,[$ax_append_compile_cxxflags_extra])
214212
AX_APPEND_COMPILE_FLAGS([-Wsign-compare],,[$ax_append_compile_cxxflags_extra])

0 commit comments

Comments
 (0)