Repository navigation
Return nonzero from s_server when the TLS handshake fails. - #306
kareem-wolfssl wants to merge 2 commits into
Conversation
|
@claude review |
There was a problem hiding this comment.
🟡 Changes recommended
The test incorrectly expects exit code 255 on Windows, where the actual code is 4294967295, causing Windows CI to fail even when the server correctly reports failure.
1 open issue
What changed in this PR
Addresses #305 by making s_server report TLS handshake failures through its process exit status.
Changes:
- Preserve handshake errors through server cleanup.
- Propagate server failures to the command’s return status.
- Test successful and failed handshakes, including server exit codes.
| File | Description |
|---|---|
| tests/server/server-test.py | Adds failure coverage and checks server exit status. |
| src/server/server.c | Preserves handshake errors through cleanup. |
| src/server/clu_server_setup.c | Logs and propagates server failures. |
Review effort: Balanced
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #306
Scan targets checked: wolfclu-src, wolfclu-bugs
Not reviewed (no scan target covers them): tests/server/server-test.py
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Max
There was a problem hiding this comment.
LGTM. This is a small, self-contained fix, and a new regression test covers the failure path.
What was reviewed:
acceptErrin server.c is set only on the non-exitWithRetaccept-failure branch and copied toreturn_codeonly at normal cleanup. TheexitWithRetpath still setserrand jumps toexit. With-nacceptabove 1, one failed accept is enough to make the server exit nonzero.- Every other
goto exitinserver_testalready setsreturn_codebefore jumping, and the value starts at -1. So the new check in clu_server_setup.c also turns those existing error exits (for example a cert load failure or an echo error) into a 255 exit, where before they exited 0. That looks like the intended effect. - The tests now wait for the server to exit on its own instead of terminating it, so
test_server_clientalso checks that a successful run exits 0.
Extended reasoning...
The change touches three files: s_server's exit-status reporting in src/server/server.c (a new acceptErr local), a check of args.return_code in src/server/clu_server_setup.c, and the Python server tests. TLS handshake logic, crypto and certificate handling are unchanged; only how an existing failure gets reported is new. The diff is about 40 lines, and every return_code path in server_test was checked to be initialized before wolfCLU_Server reads it. No CODEOWNERS or OWNERS files cover these paths, and the timeline shows no outstanding reviewer objections. The bug hunt finished with dry_streak and reported no findings.

Fixes #305