Fixes for callbacks, CRL dates, DN parsing, PSK getters - #407
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens wolfSSL JNI/JSSE behavior around certificate verification callbacks, CRL revocation date handling, DN reformatting, and PSK identity getters, and adds regression tests to validate the new fail-closed and parsing behaviors.
Changes:
- Make native verify callbacks fail closed by returning
0on JNI/callback errors and only accepting an explicit1from Java callbacks. - Honor revocation dates for serial-based CRL revocations, and reject non-null revocation dates for cert-based revocation APIs (which always record current time).
- Improve DN reformatting to split on
TAG=boundaries so unrecognized RDN types (e.g.,DC) terminate and round-trip correctly; add tests for the edge case.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/test/com/wolfssl/test/WolfSSLSessionTest.java | Adds tests ensuring verify callback exceptions/negative returns cause handshake failure (fail closed). |
| src/test/com/wolfssl/test/WolfSSLCRLTest.java | Adds/updates CRL tests to verify revocation date is honored for serial revocations and rejected for cert-based revocations. |
| src/test/com/wolfssl/provider/jsse/test/WolfSSLX509Test.java | Adds regression test ensuring DN reformatting terminates and preserves unrecognized RDN types (DC). |
| src/java/com/wolfssl/WolfSSLVerifyCallback.java | Updates callback contract documentation to clarify that only 1 continues the handshake. |
| src/java/com/wolfssl/WolfSSLCRL.java | Fixes revocation-date encoding for addRevoked() and rejects non-null dates for addRevokedCert() overloads. |
| src/java/com/wolfssl/provider/jsse/WolfSSLX509.java | Reworks DN reformatting to split on attribute boundaries and map known tags while passing unknown tags through. |
| native/com_wolfssl_WolfSSLSession.c | Normalizes verify callback return handling to accept only 1; PSK getters now return null when wolfSSL returns NULL. |
| native/com_wolfssl_WolfSSLCRL.c | Implements revocation date propagation for serial-based revocations when supported; rejects non-null dates for cert-based revocation. |
| native/com_wolfssl_WolfSSLContext.c | Normalizes context verify callback return handling to accept only 1 and fail closed otherwise. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
rlm2002
reviewed
Sep 4, 2026
…ifyCallback and NativeSSLVerifyCallback
cconlon
force-pushed
the
fenrirAug24
branch
from
September 11, 2026 15:52
f4b4ea7 to
4976515
Compare
rlm2002
approved these changes
Sep 11, 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.
This PR includes 5 Fenrir fixes:
WolfSSLX509DNs by splitting onTAG=boundaries so any RDN type (ex:DC) is handled.addRevoked(), and reject a non-null date inaddRevokedCert().nullfrom the PSK identity getters when wolfSSL returns a NULL string.0on any JNI/callback error.