Fixes for JNI callback cleanup, EKU getter, session I/O, and equals symmetry - #411
Fixes for JNI callback cleanup, EKU getter, session I/O, and equals symmetry#411cconlon wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
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.
This PR includes five Fenrir fixes: