unwrap bounds, CBIO error returns, key zeroization#365
Merged
cconlon merged 4 commits intowolfSSL:masterfrom May 4, 2026
Merged
unwrap bounds, CBIO error returns, key zeroization#365cconlon merged 4 commits intowolfSSL:masterfrom
cconlon merged 4 commits intowolfSSL:masterfrom
Conversation
364e88c to
1b8dea1
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #365
Scan targets checked: wolfssljni-bugs, wolfssljni-src
No new issues found in the changed files. ✅
There was a problem hiding this comment.
Pull request overview
This PR targets JSSE unwrap correctness and native callback/key-handling hardening in wolfssljni. It updates SSLEngine offset handling, adjusts native CBIO error returns, and adds private-key buffer zeroization plus unwrap regression tests.
Changes:
- Fixes
WolfSSLEngine.unwrap()offset-based copy bounds and produced-byte accounting, including pending app-data replay. - Changes context-level native CBIO recv/send missing-object returns from
0toWOLFSSL_CBIO_ERR_GENERAL. - Adds private-key buffer wiping in X509/CSR/CRL native sign paths and new JUnit regressions for unwrap with
ofst > 0.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/com/wolfssl/provider/jsse/test/WolfSSLEngineTest.java | Adds unwrap offset and pending-app-data regression tests. |
| src/java/com/wolfssl/provider/jsse/WolfSSLEngine.java | Fixes unwrap buffer-index bounds and bytes-produced accounting. |
| native/com_wolfssl_WolfSSLCRL.c | Adds JNI-copy zeroization in CRL signing cleanup. |
| native/com_wolfssl_WolfSSLContext.c | Changes context-level CBIO missing-object returns to hard errors. |
| native/com_wolfssl_WolfSSLCertRequest.c | Adds JNI-copy zeroization in CSR signing cleanup. |
| native/com_wolfssl_WolfSSLCertificate.c | Adds JNI-copy zeroization in certificate signing cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1b8dea1 to
10f4df4
Compare
cconlon
approved these changes
May 4, 2026
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.
Fixes F-3701, F-3702, F-3703, F-3704, F-3705, F-3706, F-3707
idx + ofst >= length→idx >= length; report bytes actually copied, not stash size.