Skip to content

Fixes for wolfJSSE handshake/parsing and JNI buffer/length hardening - #419

Merged
rlm2002 merged 5 commits into
wolfSSL:masterfrom
cconlon:fenrirSept17_4
Oct 1, 2026
Merged

rlm2002 merged 5 commits into
wolfSSL:masterfrom
cconlon:fenrirSept17_4

Conversation

@cconlon

@cconlon cconlon commented Sep 18, 2026

Copy link
Copy Markdown
Member

This PR includes 5 Fenrir fixes:

  • F-13491: Reject setUseClientMode() once the handshake has begun, matching SSLEngine/SSLSocket semantics.
  • F-14003: Parse jdk.tls.*.SignatureSchemes via splitCommaList so whitespace after commas is trimmed and every scheme is honored.
  • F-14028: Give server-side ECC shared-secret callback a JVM heap ByteBuffer copy of the peer public key DER.
  • F-13469: Return early for an empty or single-cert chain in sortCertChainBySubjectIssuer.
  • F-13470: Bound caller lengths against GetArrayLength() in dtlsCidSet, sessionFromDerNative, and dtlsCidParseNative.

@cconlon cconlon self-assigned this Sep 18, 2026
@cconlon
cconlon requested review from wolfSSL-Fenrir-bot and a lite review from Copilot September 18, 2026 16:11

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #419

Scan targets checked: wolfssljni-src, wolfssljni-bugs

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Gate the RSA/ECC-dependent test on both corresponding capability checks.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR hardens wolfJSSE handshake handling, parsing, ECC callbacks, certificate chains, and JNI length validation.

Changes:

  • Rejects mode changes after handshake start.
  • Trims signature-scheme lists and improves ECC buffer ownership.
  • Adds certificate-chain and JNI bounds checks.
File summaries
File Reviewed changes
src/test/com/wolfssl/provider/jsse/test/WolfSSLEngineTest.java Adds handshake and signature-scheme regression tests.
src/java/com/wolfssl/WolfSSLEccSharedSecretCallback.java Documents callback buffer ownership.
src/java/com/wolfssl/provider/jsse/WolfSSLUtil.java Uses whitespace-aware comma parsing.
src/java/com/wolfssl/provider/jsse/WolfSSLTrustX509.java Handles empty and single-certificate chains.
src/java/com/wolfssl/provider/jsse/WolfSSLSocket.java Updates handshake mode documentation.
src/java/com/wolfssl/provider/jsse/WolfSSLEngineHelper.java Tracks handshake start state.
native/com_wolfssl_WolfSSLSession.c Bounds native array lengths.
native/com_wolfssl_WolfSSLContext.c Copies server ECC DER data into heap memory.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/test/com/wolfssl/provider/jsse/test/WolfSSLEngineTest.java Outdated
@cconlon cconlon assigned rlm2002 and unassigned cconlon Sep 18, 2026
rlm2002
rlm2002 previously approved these changes Sep 30, 2026
@rlm2002 rlm2002 assigned cconlon and unassigned rlm2002 Sep 30, 2026
@rlm2002
rlm2002 merged commit e4df809 into wolfSSL:master Oct 1, 2026
107 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