Fixes for cert name locking, session cache validity, hostname log sanitization, and build/CI hardening - #406
Open
cconlon wants to merge 8 commits into
Open
Fixes for cert name locking, session cache validity, hostname log sanitization, and build/CI hardening#406cconlon wants to merge 8 commits into
cconlon wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR delivers a set of hardening and correctness fixes across the wolfSSL JNI layer, wolfJSSE session caching/resumption logic, debug logging, and build/CI workflows.
Changes:
- Tighten JNI/native pointer safety and cache restore argument validation (X509 name pointer locking + cert cache size enforcement).
- Improve session resumption correctness by avoiding reuse/caching of invalidated sessions, with added regression tests.
- Reduce log-injection risk via a shared hostname/log sanitization helper and apply it across JSSE components; also harden Ant/Maven CI dependency handling.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/test/com/wolfssl/test/WolfSSLContextTest.java | Adds negative tests to ensure cert cache restore rejects invalid sizes. |
| src/test/com/wolfssl/provider/jsse/test/WolfSSLSessionTest.java | Adds a regression test ensuring invalidated sessions are not resumed. |
| src/java/com/wolfssl/WolfSSLX509Name.java | Documents and clarifies native pointer validity expectations for callers. |
| src/java/com/wolfssl/WolfSSLDebug.java | Introduces shared log sanitization utility for unsafe characters. |
| src/java/com/wolfssl/WolfSSLCRL.java | Holds the X509Name monitor while passing the native name pointer into JNI. |
| src/java/com/wolfssl/WolfSSLContext.java | Updates memrestoreCertCache Javadoc to match stricter size semantics. |
| src/java/com/wolfssl/WolfSSLCertificate.java | Adds null checks and synchronizes on WolfSSLX509Name during native calls. |
| src/java/com/wolfssl/provider/jsse/WolfSSLSocketFactory.java | Sanitizes hostname values in debug logging. |
| src/java/com/wolfssl/provider/jsse/WolfSSLSocket.java | Sanitizes hostname values in debug logging; adds disabledAlgorithms note for cipher suites. |
| src/java/com/wolfssl/provider/jsse/WolfSSLServerSocket.java | Adds disabledAlgorithms note for cipher suite enabling. |
| src/java/com/wolfssl/provider/jsse/WolfSSLImplementSSLSession.java | Sanitizes hostname in session creation debug logging. |
| src/java/com/wolfssl/provider/jsse/WolfSSLEngineHelper.java | Sanitizes peer hostname in helper construction debug logging. |
| src/java/com/wolfssl/provider/jsse/WolfSSLEngine.java | Adds disabledAlgorithms note for cipher suite enabling. |
| src/java/com/wolfssl/provider/jsse/WolfSSLAuthStore.java | Avoids resuming/caching invalid sessions; sanitizes host/cacheKey in debug logs. |
| native/com_wolfssl_WolfSSLContext.c | Enforces sz bounds and uses it as the restore length for cert cache restore. |
| build.xml | Pins Ant test classpath to the two project jars rather than lib/*.jar. |
| .github/workflows/maven.yml | Adds Maven dependency resolution and checksum verification for test jars before running tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| * Callers must synchronize on this WolfSSLX509Name while using the | ||
| * returned pointer so a concurrent free() cannot release it. | ||
| * | ||
| * @return native WOLFSSL_X509_POINTER value |
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 8 Fenrir fixes:
WolfSSLX509Namemonitor while setting a subject or issuer name so native pointer stays valid.szargument inmemrestoreCertCache, rejecting non-positive or oversized values.WolfSSLEngineHelperdebug output via a shared helper.WolfSSLAuthStore,WolfSSLSocket,WolfSSLSocketFactory, andWolfSSLImplementSSLSession.jdk.tls.disabledAlgorithmsapplies to protocols and key sizes but not cipher suites.lib/*.jarwildcard.