Fenrir fixes#359
Merged
cconlon merged 7 commits intowolfSSL:masterfrom Apr 22, 2026
Merged
Conversation
…ffered data into output ByteBuffer
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #359
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
Fixes several correctness and safety issues across the JSSE provider and JNI bindings, including a regression that could resend stale ciphertext from SSLEngine.wrap().
Changes:
- Fix
equals()/hashCode()contract for SNI server name types containingbyte[]. - Correct
WolfSSLEnginesend-buffer offset handling after partial drains and add a regression test. - Harden JNI code paths with additional
NULLchecks and safer release patterns; return an immutable SNI server-name list from the session.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/test/com/wolfssl/provider/jsse/test/WolfSSLEngineTest.java | Adds regression test covering partial-drain behavior in wrap() send-buffer handling. |
| src/java/com/wolfssl/provider/jsse/WolfSSLSNIServerName.java | Fixes hashing of byte[] field to align with equals(). |
| src/java/com/wolfssl/provider/jsse/WolfSSLImplementSSLSession.java | Returns an unmodifiable view for stored SNI server names. |
| src/java/com/wolfssl/provider/jsse/WolfSSLEngine.java | Decrements internal send-buffer offset after partial drains to prevent stale re-emission. |
| native/com_wolfssl_WolfSSLSession.c | Adds NULL checks and guards around ReleaseByteArrayElements(); moves release under valid-pointer checks. |
| native/com_wolfssl_WolfSSLContext.c | Guards ReleaseByteArrayElements() calls to avoid releasing NULL pointers. |
| native/com_wolfssl_WolfSSLCertificate.c | Renames unused param suppression and moves ReleaseStringUTFChars() under NULL check. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… partial drain of CopyOutPacket() is necesssary
cconlon
approved these changes
Apr 22, 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.
byte[]field violation. Hashthis.encodedwithArrays.hashCode()for equivalence when checking withSSLSNIServerName.equals()(F-3237)internalIOSendBufOffsetbysendSzafter copy. Adds regression test to check that stale data is not sent. (F-3241)getSNIServerNames()(F-3238)filePathtofileBytes(F-3242)NULLcheck todataBufin native definition ofuseSNI()(F-3243)ReleaseByteArrayElements()ReleaseStringUTFChars()insideNULLcheck (F-3244)