Fenrir fixes#345
Merged
rlm2002 merged 16 commits intowolfSSL:masterfrom Mar 23, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Addresses multiple Fenrir-reported issues across JNI and JSSE, focusing on correctness, resource cleanup, and safer parameter handling, and adds regression tests for key fixes.
Changes:
- Harden JNI parameter handling (null guards, bounds checks, FD_SETSIZE checks) and correct exception throwing patterns.
- Fix native resource management (freeing RNG/keys) and reset I/O polling flags to avoid stale state.
- Improve JSSE private key handling by zeroizing sensitive key material; add tests for read/write bounds and CertManagerLoadCA null path.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/com/wolfssl/test/WolfSSLSessionTest.java | Adds regression test for native byte[] read/write bounds validation. |
| src/test/com/wolfssl/test/WolfSSLCertManagerTest.java | Adds regression test for CertManagerLoadCA with null path. |
| src/java/com/wolfssl/provider/jsse/WolfSSLEngineHelper.java | Zeroizes private key byte arrays after loading into native SSL. |
| native/com_wolfssl_WolfSSLX509Name.c | Adds null guards for X509_NAME_add_entry_by_txt inputs. |
| native/com_wolfssl_WolfSSLSession.c | Adds missing returns after exceptions, FD_SETSIZE checks, resets poll flags, and byte[] bounds checks; fixes ThrowNew misuse. |
| native/com_wolfssl_WolfSSLContext.c | Fixes JNI type mismatch for SetLongArrayRegion; removes static cached session object pointer. |
| native/com_wolfssl_WolfSSLCertificate.c | Fixes ThrowNew misuse, adds null guards, corrects SHA224 signature strings. |
| native/com_wolfssl_WolfSSLCertRequest.c | Fixes ThrowNew misuse; guards ReleaseStringUTFChars with NULL. |
| native/com_wolfssl_WolfSSLCertManager.c | Handles null jstring parameters for CertManagerLoadCA. |
| native/com_wolfssl_WolfSSLCRL.c | Fixes ThrowNew misuse for CRL byte-array creation failures. |
| native/com_wolfssl_WolfCryptRSA.c | Ensures RNG is freed; avoids early returns that bypass cleanup. |
| native/com_wolfssl_WolfCryptECC.c | Ensures RNG is freed; avoids unsafe Set*ArrayRegion usage on error; fixes SetLongArrayRegion type usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rlm2002
approved these changes
Mar 23, 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 16 issues identified by Fenrir: