Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A long-nonce allocation failure leaves a NULL data pointer with a nonzero length, causing cleanup to write through NULL instead of returning the decoding failure.
1 open issue
What changed in this PR
This PR strengthens wolfSSL session cleanup by wiping ticket data before freeing or reusing its storage, addressing F-7575 and F-7562.
Changes:
- Wipe dynamically allocated tickets and TLS 1.3 ticket nonces before freeing them.
- Clear static ticket buffers and static nonce storage during session cleanup.
- Replace the cache-eviction session ID clear with
ForceZero.
| File | Description |
|---|---|
src/ssl_sess.c |
Adds secure wiping to session destruction and cache eviction. |
Review effort: Balanced
Wipe ticket and nonce buffers in wolfSSL_FreeSession and the other session free paths. Reset the nonce to the static buffer when its allocation fails so the wipe never writes through NULL. Add a test. Fixes F-7575.
Clear the ticket, nonce and their lengths in evicted and overwritten cache rows so saved caches no longer hold them. Add a test. Fixes F-7562.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
wolfSSL_FreeSessionandEvictSessionFromCachefreed the session ticket and the TLS 1.3 ticket nonce without wiping them, unlike masterSecret and sessionID. Both functions now:ticketLenAllocbeforeXFREE.XFREE.staticTicket.Fixes F-7575 and F-7562
Testing