Repository navigation
Ensure that a resumed session properly handles client auth. Clear session ticket resumption state in wolfSSL_clear. - #11600
Conversation
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The changes introduce an optional-build compilation failure, a callback-backed authentication bypass, and an unversioned persisted-cache layout change.
Review effort: Balanced
Findings: 2
Open (4)
What changed in this PR
Adds client-authentication awareness to resumed sessions and clears stale ticket state during wolfSSL_clear().
Changes:
- Persists client-auth status in sessions and tickets.
- Rejects resumptions that cannot satisfy mandatory client authentication.
- Adds TLS 1.2 resumption and reset tests.
| File | Description |
|---|---|
wolfssl/internal.h |
Adds ticket flags and session authentication state. |
src/internal.c |
Enforces client authentication during TLS 1.2 resumption. |
src/tls13.c |
Enforces authentication for TLS 1.3 ticket PSKs. |
src/ssl.c |
Clears stale ticket and alternate-session state. |
src/ssl_sess.c |
Serializes and populates authentication state. |
tests/api/test_tls.c |
Adds TLS 1.2 resumption and reuse tests. |
tests/api/test_tls.h |
Registers new TLS tests. |
tests/api.c |
Tests session serialization compatibility. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
b2fffb7 to
9b72742
Compare
julek-wolfssl
left a comment
There was a problem hiding this comment.
It looks correct but the comments are getting too verbose. Cut them down.
9edcb65 to
6db895a
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11600
Scan targets checked: wolfssl-src, wolfssl-bugs
Coverage: 5 of 8 in-scope changed file(s) opened by the reviewer; not opened: tests/api.c, tests/api/test_tls.c, wolfssl/ssl_sess.h
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
6db895a to
c452a98
Compare
|
Retest this please |
c452a98 to
f06d567
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11600
Scan targets checked: wolfssl-src, wolfssl-bugs
Coverage: 5 of 7 in-scope changed file(s) opened by the reviewer; not opened: tests/api.c, tests/api/test_tls.c
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11600
Scan targets checked: wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): tests/api/test_tls.h
Coverage: 1 of 2 in-scope changed file(s) opened by the reviewer; not opened: tests/api/test_tls.c
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
e768bcf to
5006f88
Compare
Reset useTicket and createTicket, the server's alternate session id, and the per-connection alert count, empty record count, fragment offset and message building state, so a reused object starts the next handshake clean. DoClientHello resets the ticket flags itself, except during secure renegotiation, where the hello inherits the connection's. Thanks to ByteRay Ltd for the report.
Record in the session and in the ticket whether the client presented a certificate and proved possession of its key, and do a full handshake instead of resuming (session id, ticket, session secret callback and TLS 1.3 PSK) when the policy requires a client certificate the session never had. Every site deciding that policy uses ClientAuthRequired(), which covers mutual auth without verifyPeer and the PSK exception of WOLFSSL_VERIFY_FAIL_EXCEPT_PSK. The TLS 1.3 post-handshake exemption stays with the callers that defer. wolfSSL_mutual_auth() sets the verify mode so the certificate is asked for, and FAIL_IF_NO_PEER_CERT and FAIL_EXCEPT_PSK imply VERIFY_PEER. The i2d/d2i session encoding carries the new flag and d2i requires the full length. Thanks to ByteRay Ltd for the report.
Fix peerAuthOK logic around resumption and PHA. Fix PSK determination logic. Ensure PSK/anon suite options are fully reset between connections and in wolfSSL_clear. Don't set failNoCert in _mutual_auth functions as it is redundant and wouldn't get reset on clear. Add tests.
…east one reference, otherwise clear the session. Use isPsk to determine PSK status rather than verifyPeer. Add tests.
…ntAuthRequired should only check if the ticket was authenticated for this case.
Add isPsk to the session for TLS 1.3, as it has no other way of knowing if a session ticket is PSK. Refactor to always build ClientAuthRequired function. Search for CERT_WITH_EXTERN_PSK extension from the peer rather than relying on certWithExternPsk option. Add tests.
Gate WOLFSSL_SESSION members on !NO_WOLFSSL_SERVER.
|
tests good with multi-test with |



Description
Fixes F-14714, partially fixes zd#22516
Testing
Built in tests, provided reproducers, added tests
Checklist