JCE: refresh debug flags when WolfCryptProvider is loaded#135
Merged
rlm2002 merged 6 commits intowolfSSL:masterfrom Aug 18, 2025
Merged
JCE: refresh debug flags when WolfCryptProvider is loaded#135rlm2002 merged 6 commits intowolfSSL:masterfrom
rlm2002 merged 6 commits intowolfSSL:masterfrom
Conversation
7d499c4 to
8a59eaf
Compare
…SignInteropVerify()
…t threading issues
d76b6ad to
c522d9e
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR enhances debugging and diagnostics for the WolfCryptProvider by refreshing debug flags during provider initialization and adding comprehensive diagnostic information to test failures. It also includes several synchronization improvements and a Windows build fix.
- Refreshes debug flags in WolfCryptProvider constructor to ensure system properties set via JAVA_OPTS are properly recognized
- Adds extensive diagnostic logging to signature verification test failures for better debugging of sporadic CI issues
- Improves thread safety with synchronized methods in WolfCryptRandom and hash operation locks in WolfCryptSignature
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/wolfssl/provider/jce/WolfCryptProvider.java | Adds debug flag refresh during provider initialization |
| src/main/java/com/wolfssl/provider/jce/WolfCryptSignature.java | Adds hash operation synchronization and removes redundant ECC signing lock |
| src/main/java/com/wolfssl/provider/jce/WolfCryptRandom.java | Synchronizes all methods for thread safety |
| src/test/java/com/wolfssl/provider/jce/test/WolfCryptSignatureTest.java | Expands diagnostic information for test failure debugging |
| .github/workflows/windows-vs.yml | Adds WOLFSSL_SHA224 define to fix Windows build issues |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
rlm2002
approved these changes
Aug 18, 2025
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 fixes and cleanup, including:
Refresh Debug Flags
-Dwolfjce.debug=trueare set (ex: via JAVA_OPTS). This can cause debug logging to remain disabled even when the property is correctly set at runtime.WolfCryptDebug.refreshDebugFlags()in theWolfCryptProviderconstructor to refresh the debug state when the provider is loaded, to make sure logging shows up correctly when enabled via system properties.Defines
WOLFSSL_SHA224in the Windows Visual Studio GitHub action, to fix this issue:rngLocksynchronization around ECC sign operation inWolfCryptSignature.engineSign(), since the underlying Ecc class should already have synchronization protection for the incoming Rng.WolfCryptSignatureTest.testWolfSignInteropVerify()to help in debugging future sporadic CI failures.WolfCryptRandom, in case higher level JCE does not do synchronization before calling us.WolfCryptSignatureto prevent threading issues.