Skip to content

Fixes for JNI callback cleanup, EKU getter, session I/O, and equals symmetry - #411

Open
cconlon wants to merge 5 commits into
wolfSSL:masterfrom
cconlon:fenrirSept1
Open

Fixes for JNI callback cleanup, EKU getter, session I/O, and equals symmetry#411
cconlon wants to merge 5 commits into
wolfSSL:masterfrom
cconlon:fenrirSept1

Conversation

@cconlon

@cconlon cconlon commented Sep 1, 2026

Copy link
Copy Markdown
Member

This PR includes five Fenrir fixes:

  • F-12676: Release all JNI local references in the TLS secret and session ticket callbacks.
  • F-12677: Reject negative sizes in the session-level I/O callbacks.
  • F-12680: Size the getExtendedKeyUsage result to the OIDs actually written, and throw when none convert.
  • F-12681: Release all JNI local references in the ATOMIC_USER callbacks.
  • F-12682: Compare all fields symmetrically in WolfSSLAltName.equals.

@cconlon cconlon self-assigned this Sep 1, 2026
Copilot AI lite review requested due to automatic review settings September 1, 2026 18:38

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

This PR addresses several correctness and robustness issues across the Java/JNI boundary, including stricter input validation, safer JNI local-reference cleanup, more accurate EKU extraction results, and symmetric equality behavior for SAN entries.

Changes:

  • Ensure JNI local references are released across multiple callback paths to prevent local-ref table growth.
  • Reject negative sizes in session I/O callbacks to avoid invalid buffer handling.
  • Correct EKU getter behavior by trimming results to only successfully converted OIDs and throwing when none convert.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/java/com/wolfssl/WolfSSLAltName.java Makes equals compare all relevant fields symmetrically.
native/com_wolfssl_WolfSSLSession.c Adds negative-size rejection and centralizes JNI local-ref cleanup for TLS secret / session ticket callbacks.
native/com_wolfssl_WolfSSLContext.c Centralizes JNI local-ref cleanup for ATOMIC_USER callbacks and fixes incorrect error-message function naming.
native/com_wolfssl_WolfSSLCertificate.c Trims EKU OID array to actual converted entries and throws when none convert.

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

Comment thread native/com_wolfssl_WolfSSLCertificate.c
Comment thread native/com_wolfssl_WolfSSLContext.c
Comment thread native/com_wolfssl_WolfSSLContext.c
Comment thread native/com_wolfssl_WolfSSLSession.c
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.

3 participants