Skip to content

Fenrir fixes#359

Merged
cconlon merged 7 commits intowolfSSL:masterfrom
rlm2002:fenrir
Apr 22, 2026
Merged

Fenrir fixes#359
cconlon merged 7 commits intowolfSSL:masterfrom
rlm2002:fenrir

Conversation

@rlm2002
Copy link
Copy Markdown
Contributor

@rlm2002 rlm2002 commented Apr 22, 2026

  • Fix equals/hashCode contract for byte[] field violation. Hash this.encoded with Arrays.hashCode() for equivalence when checking with SSLSNIServerName.equals() (F-3237)
  • Decrements internalIOSendBufOffset by sendSz after copy. Adds regression test to check that stale data is not sent. (F-3241)
  • Return immutable list instead of writable internal list for getSNIServerNames() (F-3238)
  • Update filePath to fileBytes (F-3242)
  • Add NULL check to dataBuf in native definition of useSNI() (F-3243)
    • Also adds checks for other calls to ReleaseByteArrayElements()
  • Moves ReleaseStringUTFChars() inside NULL check (F-3244)

@rlm2002 rlm2002 self-assigned this Apr 22, 2026
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #359

Scan targets checked: wolfssljni-bugs, wolfssljni-src

No new issues found in the changed files. ✅

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 containing byte[].
  • Correct WolfSSLEngine send-buffer offset handling after partial drains and add a regression test.
  • Harden JNI code paths with additional NULL checks 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.

Comment thread src/test/com/wolfssl/provider/jsse/test/WolfSSLEngineTest.java
… partial drain of CopyOutPacket() is necesssary
@cconlon cconlon merged commit ca41a36 into wolfSSL:master Apr 22, 2026
102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants