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
3 changes: 2 additions & 1 deletion .github/workflows/curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ jobs:

# Run tests and save output to test.log
make -j$(nproc) test-ci 2>&1 | tee curl-test.log
TEST_RESULT=$?
# Capture the test result using PIPESTATUS (Bash only)
TEST_RESULT=${PIPESTATUS[0]}
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} curl
99 changes: 99 additions & 0 deletions .github/workflows/libhashkit2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: libhashkit2 Tests

# START OF COMMON SECTION
on:
push:
branches: [ '*' ] #'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION

jobs:
build_wolfprovider:
uses: ./.github/workflows/build-wolfprovider.yml
with:
wolfssl_ref: ${{ matrix.wolfssl_ref }}
openssl_ref: ${{ matrix.openssl_ref }}
strategy:
matrix:
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
openssl_ref: [ 'openssl-3.5.0' ]

test_libhashkit2:
runs-on: ubuntu-22.04
needs: build_wolfprovider
# This should be a safe limit for the tests to run.
timeout-minutes: 20
strategy:
matrix:
libhashkit2_ref: [ 'v1.x', '1.1.4' ]
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
openssl_ref: [ 'openssl-3.5.0' ]
force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ]
exclude:
- libhashkit2_ref: 'v1.x'
force_fail: 'WOLFPROV_FORCE_FAIL=1'
steps:
- name: Checkout wolfProvider
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Retrieving wolfProvider from cache
uses: actions/cache/restore@v4
id: wolfprov-cache-restore
with:
path: |
wolfssl-install
wolfprov-install
openssl-install/lib64
openssl-install/include
openssl-install/bin

key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Install libmemcached dependencies
run: |
sudo apt-get update
sudo apt-get install cmake build-essential bison flex memcached libc6

- name: Download libmemcached
uses: actions/checkout@v4
with:
repository: awesomized/libmemcached
ref: ${{ matrix.libhashkit2_ref }}
path: libmemcached
fetch-depth: 1

- name: Build libmemcached
working-directory: libmemcached
run: |
# OPENSSL_ROOT_DIR is needed for cmake to find OpenSSL headers
export OPENSSL_ROOT_DIR=$GITHUB_WORKSPACE/openssl-install/include
# Build libmemcached with OpenSSL support
mkdir build
cd build
cmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_OPENSSL_CRYPTO=ON ..
make

- name: Run libhashkit2 tests
working-directory: libmemcached/build
run: |
# Set up the environment for wolfProvider
source $GITHUB_WORKSPACE/scripts/env-setup
export ${{ matrix.force_fail }}
# Run tests
make test 2>&1 | tee libhashkit2-test.log
if grep -q "(Failed)" libhashkit2-test.log; then
TEST_RESULT=1
else
TEST_RESULT=0
fi
echo "TEST_RESULT = $TEST_RESULT"

$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} libhashkit2
3 changes: 2 additions & 1 deletion .github/workflows/liboauth2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@ jobs:

# Build and run tests
make check 2>&1 | tee liboauth2-test.log
TEST_RESULT=$?
# Capture the test result using PIPESTATUS (Bash only)
TEST_RESULT=${PIPESTATUS[0]}
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} liboauth2
3 changes: 2 additions & 1 deletion .github/workflows/net-snmp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ jobs:

autoconf --version | grep -P '2\.\d\d' -o > dist/autoconf-version
make -j test TESTOPTS="-e agentxperl" | tee net-snmp-test.log
TEST_RESULT=$?
# Capture the test result using PIPESTATUS (Bash only)
TEST_RESULT=${PIPESTATUS[0]}
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} net-snmp
2 changes: 1 addition & 1 deletion .github/workflows/openssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ jobs:
# Run all the tests except (t-exec) as it takes too long
export ${{ matrix.force_fail }}
make file-tests interop-tests extra-tests unit 2>&1 | tee openssh-test.log
TEST_RESULT=$?
TEST_RESULT=${PIPESTATUS[0]}
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} openssh
32 changes: 26 additions & 6 deletions .github/workflows/openvpn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,35 @@ jobs:
sudo apt-get update
sudo apt-get install liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev \
linux-libc-dev man2html libcmocka-dev python3-docutils \
libtool automake autoconf libnl-genl-3-dev libnl-genl-3-200
iproute2 libtool automake autoconf libnl-genl-3-dev \
libnl-genl-3-200

- name: Build and test OpenVPN
uses: wolfSSL/actions-build-autotools-project@v1
- name: Find ossl headers
run: |
find / -name ssl.h 2>/dev/null || true

- name: Download OpenVPN
uses: actions/checkout@v4
with:
repository: OpenVPN/openvpn
path: openvpn
ref: ${{ matrix.openvpn_ref }}
configure:
check: false
fetch-depth: 1

- name: Apply patch
working-directory: openvpn
run: |
# delete the test_des_encrypt test case, if it exists
perl -ni -e 'print unless /cmocka_unit_test\(test_des_encrypt\),/' tests/unit_tests/openvpn/test_crypto.c
# show the results of the patch
git diff

- name: Build OpenVPN
working-directory: openvpn
run: |
autoreconf -ivf
./configure
make -j$(nproc)

- name: Test OpenVPN with wolfProvider
working-directory: openvpn
Expand All @@ -82,5 +101,6 @@ jobs:

# Run tests and save result
make check 2>&1 | tee openvpn-test.log
TEST_RESULT=$?
# Capture the test result using PIPESTATUS (Bash only)
TEST_RESULT=${PIPESTATUS[0]}
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} openvpn
4 changes: 3 additions & 1 deletion .github/workflows/ppp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
matrix:
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
openssl_ref: [ 'openssl-3.5.0' ]
#Switched to v2.5.2 due to significant limitations with v2.4.9, specifically the lack of a test suite, necessary configure options, and compatibility with newer versions of openssl
# Switched to v2.5.2 due to significant limitations with v2.4.9,
# specifically the lack of a test suite, necessary configure options,
# and compatibility with newer versions of openssl
ppp_ref: [ 'master', 'v2.5.2' ]
force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ]
exclude:
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/sssd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,23 @@ jobs:
ln -s samba-4.0/ldb_module.h /usr/include/ldb_module.h
ln -s samba-4.0/ldb_version.h /usr/include/ldb_version.h

- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
fetch-depth: 1

- name: Build and test sssd with wolfProvider
run: |
# Clone SSSD
git clone https://github.com/SSSD/sssd.git
cd sssd
git checkout ${{ matrix.sssd_ref }}

# Apply patch for testing
patch -p1 < $GITHUB_WORKSPACE/osp/wolfProvider/sssd/sssd-${{ matrix.sssd_ref }}-wolfprov.patch

# Configure and build SSSD with wolfProvider
autoreconf -ivf
./configure --without-samba --disable-cifs-idmap-plugin \
Expand All @@ -89,6 +99,7 @@ jobs:

- name: Run tests
working-directory: sssd
shell: bash
run: |
# Set environment variables
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
Expand All @@ -100,7 +111,12 @@ jobs:
$GITHUB_WORKSPACE/openssl-install/bin/openssl list -providers | tee provider-list.log
grep -q libwolfprov provider-list.log || (echo "ERROR: libwolfprov not found in OpenSSL providers" && exit 1)

# If force fail is enabled dont exit with error
if [ "${{ matrix.force_fail }}" == "WOLFPROV_FORCE_FAIL=1" ]; then
set +e
fi

# Run tests and save result
make check 2>&1 | tee sssd-test.log
TEST_RESULT=$?
TEST_RESULT=${PIPESTATUS[0]}
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} sssd
92 changes: 79 additions & 13 deletions .github/workflows/stunnel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,40 +60,106 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf automake \
libtool pkg-config libwrap0-dev autoconf-archive \
autotools-dev m4
sudo apt-get install -y libwrap0-dev autoconf-archive autotools-dev m4

# - name: Set up Python 3.12
# if : ${{ matrix.stunnel_ref == 'master' }}
# uses: actions/setup-python@v5
# with:
# python-version: '3.12'

# - name: Set up Python 3.10
# if : ${{ matrix.stunnel_ref != 'master' }}
# uses: actions/setup-python@v5
# with:
# python-version: '3.10'

- name: Check Python version
run: python --version

- name: Replace system openssl with wolfProvider build
run: sudo ln -sf $GITHUB_WORKSPACE/openssl-install/bin/openssl /usr/bin/openssl

- name: Checkout Stunnel
uses: actions/checkout@v4
with:
repository: mtrojnar/stunnel
ref: ${{ matrix.stunnel_ref }}
path: stunnel
fetch-depth: 1

- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
fetch-depth: 1

- name: Apply OSP patch to Stunnel
if : ${{ matrix.stunnel_ref == 'stunnel-5.67' }}
working-directory: ./stunnel
run: |
# Apply patch for WOLFPROV_FORCE_FAIL
patch -p1 < $GITHUB_WORKSPACE/osp/wolfProvider/stunnel/stunnel-WPFF-5.67-wolfprov.patch

- name: Build Stunnel
working-directory: ./stunnel
run: |
git clone https://github.com/mtrojnar/stunnel.git
cd stunnel
git checkout ${{ matrix.stunnel_ref }}
if [ ${{ matrix.force_fail }} != '' ]; then
patch -p1 < $GITHUB_WORKSPACE/osp/wolfProvider/stunnel/stunnel-WPFF-5.67-wolfprov.patch
fi
autoreconf -ivf
./configure --with-ssl=$GITHUB_WORKSPACE/openssl-install/
make -j

- name: Update python cryptography module
working-directory: ./stunnel
run: |
export LD_LIBRARY_PATH="$GITHUB_WORKSPACE/openssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64"
export CFLAGS="-I$GITHUB_WORKSPACE/openssl-install/include"
export LDFLAGS="-L$GITHUB_WORKSPACE/openssl-install/lib -L$GITHUB_WORKSPACE/openssl-install/lib64"

python3 -m venv myenv
source myenv/bin/activate
pip install cryptography # will use your OpenSSL if built from source

- name: Apply patch to disable pkcs12 test
if : ${{ matrix.stunnel_ref == 'master' }}
working-directory: ./stunnel
run: |
# Bypass the Certp12Test test
perl -pe 's/^( \s*)stunnel = Certp12Test\(cfg, logger\)/$1return\n$1stunnel = Certp12Test(cfg, logger)/' -i tests/plugins/p07_p12cert.py

- name: Verify stunnel with wolfProvider
working-directory: ./stunnel
run: |
# Unset LD_LIBRARY_PATH after python setup
unset LD_LIBRARY_PATH
unset PKG_CONFIG_PATH
unset OPENSSL_MODULES

# Set up the environment for wolfProvider
source $GITHUB_WORKSPACE/scripts/env-setup
export ${{ matrix.force_fail }}

# enter venv
source myenv/bin/activate

# Set this variable to prevent attempts to load the legacy OpenSSL
# provider, which we don't support.
# This is necessary for OpenSSL 3.0+ to avoid errors related to legacy
# algorithms that are not supported by wolfProvider.
export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1

# Verify stunnel
ldd src/stunnel | grep -E '(libssl|libcrypto)'
ldd src/stunnel
ldd src/stunnel | grep -E '(libssl|libcrypto)' | grep wolfProvider
./src/stunnel -version

# Run tests and capture output
make check 2>&1 | tee stunnel-test.log
TEST_RESULT=$?
# Run tests
# Results captured in tests/logs/results.log
# Use `timeout` since the tests hang with WOLFPROV_FORCE_FAIL=1
timeout 10 make check 2>&1 || true

# grep for "failed: 0" in the results log, indicating success
TEST_RESULT=$(grep -c "failed: 0" tests/logs/results.log || echo 1)
echo "Test result: $TEST_RESULT"

$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} stunnel
8 changes: 2 additions & 6 deletions .github/workflows/tcpdump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ jobs:

# Run tests
make check 2>&1 | tee tcpdump-test.log
TEST_RESULT=$?

if [ $TEST_RESULT -ne 0 ]; then
grep -A2 -B2 "exit code\|failed\|FAILED" tcpdump-test.log || true
fi

# Capture the test result using PIPESTATUS (Bash only)
TEST_RESULT=${PIPESTATUS[0]}
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} tcpdump

Loading
Loading