Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5c6764e
Initial Auth Manager framework and user add message communication
JacobBarthelmeh Dec 9, 2025
8ce88a4
set credentials messaging
JacobBarthelmeh Dec 29, 2025
2db44fa
login messaging and demo login
JacobBarthelmeh Dec 30, 2025
b16e356
variable length for set credentials message and logout/login touch up
JacobBarthelmeh Dec 31, 2025
c2308ed
demo using certificates for login credentials
JacobBarthelmeh Dec 31, 2025
cefe188
add delete user and get user implementations
JacobBarthelmeh Jan 7, 2026
be86fa2
add demo for set permissions and update delete function to have curre…
JacobBarthelmeh Jan 9, 2026
a65b231
check in test cases planned so far
JacobBarthelmeh Jan 9, 2026
966da70
updates for dynmaic size of credentials and auth data
JacobBarthelmeh Jan 14, 2026
7eb0f34
check in wh_auth_base.h file
JacobBarthelmeh Jan 14, 2026
fca5ed4
add auth login and logout tests
JacobBarthelmeh Jan 14, 2026
890197d
add sanity checks on username size
JacobBarthelmeh Jan 14, 2026
3cb725b
add client only tcp auth tests
JacobBarthelmeh Jan 15, 2026
7b83fb7
adding bad function argument tests
JacobBarthelmeh Jan 15, 2026
d5f1082
better server response to authorization error cases
JacobBarthelmeh Jan 15, 2026
0cdaec3
remove debug printf's and make note for future logging location
JacobBarthelmeh Jan 15, 2026
4a22478
run git-clang-format and checking format changes
JacobBarthelmeh Jan 16, 2026
7d13a69
adding in more function comments
JacobBarthelmeh Jan 16, 2026
9a98d20
move base example auth users to port/posix directory
JacobBarthelmeh Jan 16, 2026
f089c1c
spelling fixes, cast on sizeof return, macro guard for certificate us…
JacobBarthelmeh Jan 16, 2026
9727099
check in auth demo client files
JacobBarthelmeh Jan 16, 2026
680a1fd
update action permissions and method in message layer
JacobBarthelmeh Jan 16, 2026
d9137a7
fix for bitmask of permissions and remove permissions return from login
JacobBarthelmeh Jan 19, 2026
f33f6d6
add auth login as admin during SHE tests
JacobBarthelmeh Jan 19, 2026
6956229
update posix client auth demo for new login function signature
JacobBarthelmeh Jan 19, 2026
08158e2
touch up of comments and demo
JacobBarthelmeh Jan 20, 2026
3db75d8
Fix typo and remove redundent return value check
JacobBarthelmeh Jan 20, 2026
9928a34
account for no WOLFHSM_CFG_ENABLE_SERVER build with test case
JacobBarthelmeh Jan 22, 2026
31bae40
addressing some feedback about sanity checks and null string terminators
JacobBarthelmeh Jan 22, 2026
2c59ce4
update login comments and add defensive memset's
JacobBarthelmeh Jan 22, 2026
c9418b2
add hashing of example pin, use of WH_ERROR_OK, update comment
JacobBarthelmeh Jan 26, 2026
2875a0b
make the authentication feature off by default and enabled by definin…
JacobBarthelmeh Jan 26, 2026
d97f88c
add server simple response back of auth not enabled
JacobBarthelmeh Jan 26, 2026
f66c4ab
add WH_TEST_SKIP and authentication skipping when server does not sup…
JacobBarthelmeh Jan 26, 2026
c6b9a31
move most of authentication logic into wolfHSM rather than in port, t…
JacobBarthelmeh Jan 29, 2026
37c9263
fix for scan-build warning
JacobBarthelmeh Jan 29, 2026
131812c
spelling fix, additional sanity checks
JacobBarthelmeh Jan 29, 2026
4f5b452
add flag to avoid gcc coverage bug 68080
JacobBarthelmeh Jan 29, 2026
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
9 changes: 5 additions & 4 deletions .github/workflows/build-and-run-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
asan: [ 'ASAN=1', 'ASAN=0' ]
debug: [ '', 'DEBUG_VERBOSE=1' ]
test: [ '', '--test' ]
auth: [ '', 'AUTH=1' ]
runs-on: ubuntu-latest
timeout-minutes: 5

Expand All @@ -39,17 +40,17 @@ jobs:
- name: Build POSIX server
run: |
if [ "${{ matrix.transport }}" = "dma" ]; then
cd examples/posix/wh_posix_server && ${{ matrix.asan }} ${{ matrix.debug }} DMA=1 make -j WOLFSSL_DIR=../../../wolfssl
cd examples/posix/wh_posix_server && ${{ matrix.asan }} ${{ matrix.debug }} ${{ matrix.auth }} DMA=1 make -j WOLFSSL_DIR=../../../wolfssl
else
cd examples/posix/wh_posix_server && ${{ matrix.asan }} ${{ matrix.debug }} TLS=${{ env.TLS }} make -j WOLFSSL_DIR=../../../wolfssl
cd examples/posix/wh_posix_server && ${{ matrix.asan }} ${{ matrix.debug }} ${{ matrix.auth }} TLS=${{ env.TLS }} make -j WOLFSSL_DIR=../../../wolfssl
fi

- name: Build POSIX client
run: |
if [ "${{ matrix.transport }}" = "dma" ]; then
cd examples/posix/wh_posix_client && ${{ matrix.asan }} ${{ matrix.debug }} DMA=1 make -j WOLFSSL_DIR=../../../wolfssl
cd examples/posix/wh_posix_client && ${{ matrix.asan }} ${{ matrix.debug }} ${{ matrix.auth }} DMA=1 make -j WOLFSSL_DIR=../../../wolfssl
else
cd examples/posix/wh_posix_client && ${{ matrix.asan }} ${{ matrix.debug }} TLS=${{ env.TLS }} make -j WOLFSSL_DIR=../../../wolfssl
cd examples/posix/wh_posix_client && ${{ matrix.asan }} ${{ matrix.debug }} ${{ matrix.auth }} TLS=${{ env.TLS }} make -j WOLFSSL_DIR=../../../wolfssl
fi

# Start the server in the background
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/build-and-test-clientonly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,56 @@ jobs:
make -j CLIENT_ONLY=1 TLS=1 SHE=1 DEBUG_VERBOSE=1 WOLFSSL_DIR=../wolfssl && make run
fi

# Restart server with fresh state for AUTH test run, even with the server
# not supporting AUTH and the client supporting AUTH -- the client should
# still be able to connect and run tests while not authenticated.
- name: Restart POSIX server for AUTH
run: |
kill $SERVER_PID || true
cd examples/posix/wh_posix_server
rm -f *.bin || true
./Build/wh_posix_server.elf --type ${{ matrix.transport }} &
SERVER_PID=$!
echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV
sleep 2

- name: Build client-only unit tests with AUTH against non-AUTH server
run: |
cd test
make clean
if [ "${{ matrix.transport }}" = "tcp" ]; then
make -j CLIENT_ONLY=1 SHE=1 AUTH=1 WOLFSSL_DIR=../wolfssl && make run
else
make -j CLIENT_ONLY=1 TLS=1 SHE=1 AUTH=1 WOLFSSL_DIR=../wolfssl && make run
fi

# Rebuild the server with AUTH support and restart
- name: Rebuild and restart POSIX server for AUTH
run: |
kill $SERVER_PID || true
cd examples/posix/wh_posix_server
make clean
if [ "${{ matrix.transport }}" = "tcp" ]; then
make -j SHE=1 AUTH=1 WOLFSSL_DIR=../../../wolfssl
else
make -j TLS=1 SHE=1 AUTH=1 WOLFSSL_DIR=../../../wolfssl
fi
rm -f *.bin || true
./Build/wh_posix_server.elf --type ${{ matrix.transport }} &
SERVER_PID=$!
echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV
sleep 2

- name: Build client-only unit tests with AUTH against AUTH server
run: |
cd test
make clean
if [ "${{ matrix.transport }}" = "tcp" ]; then
make -j CLIENT_ONLY=1 SHE=1 AUTH=1 WOLFSSL_DIR=../wolfssl && make run
else
make -j CLIENT_ONLY=1 TLS=1 SHE=1 AUTH=1 WOLFSSL_DIR=../wolfssl && make run
fi

# Optional: Kill the server process if it doesn't exit on its own
- name: Cleanup POSIX server
if: always()
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,11 @@ jobs:
# Build and test in multithreaded mode with everything enabled and wolfCrypt tests with dma
- name: Build and test with THREADSAFE and TESTWOLFCRYPT with DMA
run: cd test && make clean && make -j THREADSAFE=1 TESTWOLFCRYPT=1 TESTWOLFCRYPT_DMA=1 DMA=1 SHE=1 ASAN=1 WOLFSSL_DIR=../wolfssl && make run

# Build and test with AUTH=1
- name: Build and test with AUTH
run: cd test && make clean && make -j AUTH=1 WOLFSSL_DIR=../wolfssl && make run

# Build and test with AUTH=1 and ASAN
- name: Build and test with AUTH ASAN
run: cd test && make clean && make -j AUTH=1 ASAN=1 WOLFSSL_DIR=../wolfssl && make run
3 changes: 2 additions & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ jobs:
run: cd test && make coverage WOLFSSL_DIR=../wolfssl

# Display coverage summary in the action log
# Using gcov-ignore-parse-errors to avoid (GCC bug #68080)
- name: Display coverage summary
run: |
echo "=== Coverage Summary ==="
cd test
gcovr Build --root .. --filter '\.\./src/.*' --filter '\.\./wolfhsm/.*' --print-summary
gcovr --gcov-ignore-parse-errors="negative_hits.warn" Build --root .. --filter '\.\./src/.*' --filter '\.\./wolfhsm/.*' --print-summary

# Upload coverage report as artifact
- name: Upload coverage report
Expand Down
21 changes: 21 additions & 0 deletions examples/demo/client/wh_demo_client_all.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "wh_demo_client_wctest.h"
#include "wh_demo_client_wcbench.h"
#include "wh_demo_client_nvm.h"
#ifdef WOLFHSM_CFG_ENABLE_AUTHENTICATION
#include "wh_demo_client_auth.h"
#include "wolfhsm/wh_error.h"
#endif /* WOLFHSM_CFG_ENABLE_AUTHENTICATION */
#include "wh_demo_client_keystore.h"
#include "wh_demo_client_crypto.h"
#include "wh_demo_client_secboot.h"
Expand All @@ -10,6 +14,23 @@
int wh_DemoClient_All(whClientContext* clientContext)
{
int rc = 0;
#ifdef WOLFHSM_CFG_ENABLE_AUTHENTICATION
whUserId userId = WH_USER_ID_INVALID;
/* Auth demos */
rc = wh_DemoClient_Auth(clientContext);
if (rc != 0) {
return rc;
}

/* Log in as an admin user for the rest of the tests */
if (wh_Client_AuthLogin(clientContext, WH_AUTH_METHOD_PIN, "admin", "1234",
4, &rc, &userId) != 0) {
return -1;
}
if (rc != WH_ERROR_OK && rc != WH_AUTH_NOT_ENABLED) {
return rc;
}
#endif /* WOLFHSM_CFG_ENABLE_AUTHENTICATION */

/* wolfCrypt test and benchmark */
#ifdef WH_DEMO_WCTEST
Expand Down
Loading