Skip to content

Commit de5e662

Browse files
committed
Merge branch 'master' of github.com:ColtonWilley/wolfProvider into wp_rsa_crypt_nopad
2 parents 9361005 + 8c58714 commit de5e662

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2477
-285
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [ $# -lt 1 ]; then
6+
echo "Usage: $0 <test_result> [WOLFPROV_FORCE_FAIL] [TEST_SUITE]"
7+
exit 1
8+
fi
9+
10+
TEST_RESULT="$1"
11+
WOLFPROV_FORCE_FAIL="${2:-}"
12+
TEST_SUITE="${3:-}"
13+
14+
# If force fail is empty treat second arg as test suite
15+
if [ -z "$WOLFPROV_FORCE_FAIL" ]; then
16+
TEST_SUITE="${2:-}"
17+
fi
18+
19+
if [ "$WOLFPROV_FORCE_FAIL" = "WOLFPROV_FORCE_FAIL=1" ]; then
20+
if [ "$TEST_SUITE" = "curl" ]; then
21+
# --- curl-specific logic ---
22+
if [ -f "tests/test.log" ]; then
23+
# Extract and clean the failed test list from the log
24+
ACTUAL_FAILS=$(grep -a '^TESTFAIL: These test cases failed:' tests/test.log | sed 's/.*failed: //')
25+
else
26+
echo "Error: tests/test.log not found"
27+
exit 1
28+
fi
29+
30+
# Get curl version from the workflow ref
31+
CURL_VERSION="${CURL_REF:-}"
32+
33+
# Define expected failures based on curl version
34+
case "$CURL_VERSION" in
35+
"curl-8_4_0")
36+
EXPECTED_FAILS="9 31 39 41 44 46 61 64 65 70 71 72 73 88 153 154 158 163 166 167 168 169 170 171 173 186 206 245 246 258 259 273 277 327 335 388 420 444 540 551 552 554 565 579 584 643 645 646 647 648 649 650 651 652 653 654 666 667 668 669 670 671 672 673 977 1001 1002 1030 1053 1060 1061 1071 1072 1079 1095 1105 1133 1136 1151 1155 1158 1160 1161 1186 1187 1189 1190 1191 1192 1193 1194 1195 1196 1198 1199 1229 1284 1285 1286 1293 1315 1404 1412 1415 1418 1437 1568 1903 1905 1916 1917 1964 2024 2026 2027 2028 2030 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2073 2076 2200 2201 2202 2203 2204 3017 3018"
37+
;;
38+
"master")
39+
EXPECTED_FAILS="9 31 39 41 44 46 61 64 65 70 71 72 73 88 153 154 158 163 166 167 168 169 170 171 173 186 206 245 246 258 259 273 277 327 335 388 420 444 483 540 551 552 554 565 579 584 643 645 646 647 648 649 650 651 652 653 654 666 667 668 669 670 671 672 673 695 977 1001 1002 1030 1053 1060 1061 1071 1072 1079 1095 1105 1133 1136 1151 1155 1158 1160 1161 1186 1187 1189 1190 1191 1192 1193 1194 1195 1196 1198 1199 1229 1284 1285 1286 1293 1315 1404 1412 1415 1418 1437 1476 1568 1608 1610 1615 1654 1660 1903 1905 1916 1917 1964 2024 2026 2027 2028 2030 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2073 2076 2200 2201 2202 2203 2204 3017 3018"
40+
;;
41+
*)
42+
echo "Error: Unknown curl version: $CURL_VERSION"
43+
exit 1
44+
;;
45+
esac
46+
47+
# Create temporary files for sorted lists
48+
TEMP_DIR=$(mktemp -d)
49+
ACTUAL_SORTED="${TEMP_DIR}/actual_sorted.txt"
50+
EXPECTED_SORTED="${TEMP_DIR}/expected_sorted.txt"
51+
52+
# Clean and sort both lists and remove empty lines
53+
echo "$ACTUAL_FAILS" | tr ' ' '\n' | grep -v '^$' | sort -n > "$ACTUAL_SORTED"
54+
echo "$EXPECTED_FAILS" | tr ' ' '\n' | grep -v '^$' | sort -n > "$EXPECTED_SORTED"
55+
56+
echo "DEBUG: Sorted actual fails: $(tr '\n' ' ' < "$ACTUAL_SORTED")"
57+
echo "DEBUG: Sorted expected fails: $(tr '\n' ' ' < "$EXPECTED_SORTED")"
58+
59+
# Find missing in actual (in expected but not in actual)
60+
MISSING=$(comm -23 "$EXPECTED_SORTED" "$ACTUAL_SORTED" | tr '\n' ' ')
61+
# Find extra in actual (in actual but not in expected)
62+
EXTRA=$(comm -13 "$EXPECTED_SORTED" "$ACTUAL_SORTED" | tr '\n' ' ')
63+
64+
# Clean up temporary files
65+
rm -rf "$TEMP_DIR"
66+
67+
echo "Test(s) that should have failed: $MISSING"
68+
echo "Test(s) that shouldn't have failed: $EXTRA"
69+
70+
if [ -z "$MISSING" ] && [ -z "$EXTRA" ]; then
71+
echo "PASS: Actual failed tests match expected."
72+
exit 0
73+
else
74+
echo "FAIL: Actual failed tests do not match expected."
75+
exit 1
76+
fi
77+
else
78+
# --- generic force-fail logic for other suites ---
79+
if [ $TEST_RESULT -eq 0 ]; then
80+
echo "Test unexpectedly succeeded with force fail enabled"
81+
exit 1 # failure was not seen when expected
82+
else
83+
echo "Test failed as expected with force fail enabled"
84+
exit 0 # expected failure occurred
85+
fi
86+
fi
87+
elif [ $TEST_RESULT -ne 0 ]; then
88+
echo "Tests failed unexpectedly"
89+
exit 1
90+
else
91+
echo "Tests passed successfully"
92+
exit 0
93+
fi

.github/workflows/codespell.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Codespell test
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
codespell:
17+
name: Check for spelling errors
18+
runs-on: ubuntu-22.04
19+
timeout-minutes: 5
20+
steps:
21+
- name: Checkout wolfProvider
22+
uses: actions/checkout@v4
23+
24+
- name: Create exclude file if needed
25+
run: |
26+
if [ ! -f .codespellexcludelines ]; then
27+
touch .codespellexcludelines
28+
fi
29+
30+
- name: Run codespell
31+
uses: codespell-project/[email protected]
32+
with:
33+
check_filenames: true
34+
check_hidden: true
35+
# Add comma separated list of words that occur multiple times that should be ignored (sorted alphabetically, case sensitive)
36+
ignore_words_list: adin,addIn,aNULL,brunch,carryIn,chainG,ciph,cLen,cliKs,dout,emac,haveA,inCreated,inOut,inout,larg,LEAPYEAR,Merget,optionA,parm,parms,repid,rIn,userA,ser,siz,te,Te,toLen
37+
# The exclude_file contains lines of code that should be ignored. This is useful for individual lines which have non-words that can safely be ignored.
38+
exclude_file: '.codespellexcludelines'
39+
# To skip files entirely from being processed, add it to the following list:
40+
skip: '*.cproject,*.der,*.mtpj,*.pem,*.vcxproj,.git,*.launch,*.scfg,*.revoked,*.txt'
41+
42+
- name: Print errors
43+
if: ${{ failure() }}
44+
run: |
45+
if [ -f test-suite.log ] ; then
46+
cat test-suite.log
47+
fi

.github/workflows/curl.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ jobs:
7373
matrix:
7474
curl_ref: [ 'master', 'curl-8_4_0' ]
7575
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
76+
force_fail: ['WOLFPROV_FORCE_FAIL=1', '']
7677
steps:
78+
- name: Checkout wolfProvider
79+
uses: actions/checkout@v4
80+
7781
- name: Retrieving OpenSSL from cache
7882
uses: actions/cache/restore@v4
7983
id: openssl-cache
@@ -109,13 +113,30 @@ jobs:
109113
repository: curl/curl
110114
path: curl
111115
ref: ${{ matrix.curl_ref }}
112-
configure: --with-openssl=$GITHUB_WORKSPACE/openssl-install/
116+
configure: --with-openssl
113117
check: false
114118

119+
- name: Generate certificates for curl master force-fail tests
120+
run: |
121+
if [ "${{ matrix.force_fail }}" = "WOLFPROV_FORCE_FAIL=1" ] &&
122+
[ "${{ matrix.curl_ref }}" = "master" ]; then
123+
cd curl/tests/certs
124+
make test-ca.cacert
125+
cd ../..
126+
fi
115127
- name: Test curl with wolfProvider
116128
working-directory: curl
117129
run: |
130+
# Set environment variables
118131
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
119132
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
120133
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib
121-
make -j $(nproc) test-ci
134+
export PKG_CONFIG_PATH=$GITHUB_WORKSPACE/openssl-install/lib64/pkgconfig
135+
export ${{ matrix.force_fail }}
136+
export CURL_REF=${{ matrix.curl_ref }}
137+
138+
# Run tests and save output to test.log
139+
mkdir -p tests
140+
make -j$(nproc) test-ci 2>&1 | tee tests/test.log || true
141+
TEST_RESULT=$?
142+
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} curl
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Multi-Compiler Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_wolfprovider:
17+
name: Build with ${{ matrix.CC }}
18+
runs-on: ${{ matrix.OS }}
19+
timeout-minutes: 20
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- CC: gcc-9
25+
CXX: g++-9
26+
OS: ubuntu-latest
27+
wolfssl_ref: master
28+
- CC: gcc-10
29+
CXX: g++-10
30+
OS: ubuntu-latest
31+
wolfssl_ref: master
32+
- CC: gcc-10
33+
CXX: g++-10
34+
OS: ubuntu-latest
35+
wolfssl_ref: v5.7.4-stable
36+
- CC: gcc-11
37+
CXX: g++-11
38+
OS: ubuntu-latest
39+
wolfssl_ref: master
40+
- CC: gcc-12
41+
CXX: g++-12
42+
OS: ubuntu-latest
43+
wolfssl_ref: master
44+
- CC: clang-12
45+
CXX: clang++-12
46+
OS: ubuntu-22.04
47+
wolfssl_ref: master
48+
- CC: clang-13
49+
CXX: clang++-13
50+
OS: ubuntu-22.04
51+
wolfssl_ref: master
52+
- CC: clang-14
53+
CXX: clang++-14
54+
OS: ubuntu-latest
55+
wolfssl_ref: master
56+
- CC: clang-15
57+
CXX: clang++-15
58+
OS: ubuntu-latest
59+
wolfssl_ref: master
60+
steps:
61+
- name: Checkout wolfProvider
62+
uses: actions/checkout@v4
63+
64+
- name: Install dependencies
65+
run: |
66+
sudo apt-get update
67+
sudo apt-get install -y ${{ matrix.CC }} ${{ matrix.CXX }} automake libtool
68+
69+
# Check if this version of wolfssl/wolfprovider has already been built,
70+
# mark to cache these items on post if we do end up building
71+
- name: Checking wolfSSL/wolfProvider in cache
72+
uses: actions/cache@v4
73+
id: wolfprov-cache
74+
with:
75+
path: |
76+
wolfssl-source
77+
wolfssl-install
78+
wolfprov-install
79+
provider.conf
80+
81+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.CC }}-${{ github.sha }}
82+
lookup-only: true
83+
84+
# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
85+
- name: Checking OpenSSL in cache
86+
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
87+
uses: actions/cache@v4
88+
id: openssl-cache
89+
with:
90+
path: |
91+
openssl-source
92+
openssl-install
93+
94+
key: ossl-${{ matrix.CC }}-depends
95+
96+
# If not yet built this version, build it now
97+
- name: Build wolfProvider
98+
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
99+
env:
100+
CC: ${{ matrix.CC }}
101+
CXX: ${{ matrix.CXX }}
102+
run: |
103+
WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh
104+
105+
- name: Print errors
106+
if: ${{ failure() }}
107+
run: |
108+
if [ -f test-suite.log ]; then
109+
cat test-suite.log
110+
fi
111+
if [ -f config.log ]; then
112+
cat config.log
113+
fi
114+

.github/workflows/simple.yml

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Simple Tests
33
# START OF COMMON SECTION
44
on:
55
push:
6-
branches: [ '*' ]
7-
# branches: [ 'master', 'main', 'release/**' ]
6+
branches: [ 'master', 'main', 'release/**' ]
87
pull_request:
98
branches: [ '*' ]
109

@@ -14,30 +13,62 @@ concurrency:
1413
# END OF COMMON SECTION
1514

1615
jobs:
17-
make_check:
16+
simple_test:
17+
name: Simple Test
18+
runs-on: ubuntu-22.04
19+
timeout-minutes: 20
1820
strategy:
1921
matrix:
20-
config: [
21-
# Add new configs here
22-
'',
23-
'OPENSSL_TAG=master',
24-
'WOLFSSL_TAG=master',
25-
'OPENSSL_TAG=master WOLFSSL_TAG=master',
26-
]
27-
name: make check
28-
runs-on: ubuntu-latest
29-
# This should be a safe limit for the tests to run.
30-
timeout-minutes: 10
22+
build_ref:
23+
- ''
24+
- 'OPENSSL_TAG=master'
25+
- 'WOLFSSL_TAG=master'
26+
- 'OPENSSL_TAG=master WOLFSSL_TAG=master'
27+
force_fail: ['WOLFPROV_FORCE_FAIL=1', '']
28+
3129
steps:
32-
- uses: actions/checkout@v4
33-
name: Checkout wolfProvider
30+
- name: Checkout wolfProvider
31+
uses: actions/checkout@v4
32+
33+
# Check if this version of wolfssl/wolfprovider has already been built,
34+
# mark to cache these items on post if we do end up building
35+
- name: Checking wolfSSL/wolfProvider in cache
36+
uses: actions/cache@v4
37+
id: wolfprov-cache
38+
with:
39+
path: |
40+
wolfssl-source
41+
wolfssl-install
42+
wolfprov-install
43+
provider.conf
44+
45+
key: wolfprov-${{ matrix.build_ref }}-${{ github.sha }}
46+
lookup-only: true
47+
48+
# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
49+
- name: Checking OpenSSL in cache
50+
if: steps.wolfprov-${{ matrix.build_ref }}-cache.hit != 'true'
51+
uses: actions/cache@v4
52+
id: openssl-cache
53+
with:
54+
path: |
55+
openssl-source
56+
openssl-install
57+
58+
key: ossl-depends
59+
60+
# If not yet built this version, build it now
61+
- name: Build wolfProvider
62+
if: steps.wolfprov-${{ matrix.build_ref }}-cache.hit != 'true'
63+
run: |
64+
${{ matrix.build_ref.openssl }} ${{ matrix.build_ref.wolfssl }} ./scripts/build-wolfprovider.sh
3465
35-
- name: Test wolfProvider
66+
- name: Run simple tests
3667
run: |
37-
${{ matrix.config }} ./scripts/build-wolfprovider.sh
68+
./scripts/cmd_test/do-cmd-tests.sh ${{ matrix.force_fail }}
3869
39-
- name: Print errors
40-
if: ${{ failure() }}
70+
- name: Print test logs
71+
if: always()
4172
run: |
4273
if [ -f test-suite.log ] ; then
4374
cat test-suite.log

0 commit comments

Comments
 (0)