Add JSSE-level PSK support via WolfSSLParameters#340
Conversation
There was a problem hiding this comment.
Pull request overview
Adds JSSE-level PSK configuration support by making WolfSSLParameters usable with standard setSSLParameters() on SSLSocket/SSLEngine, wiring PSK settings into engine setup, and providing tests/examples to validate usage.
Changes:
- Make
WolfSSLParametersextendSSLParametersand add PSK-related fields with getters/setters. - Import/propagate PSK settings through
WolfSSLParametersHelperand apply them inWolfSSLEngineHelper. - Add JUnit coverage and new SSLSocket/SSLEngine PSK example apps + documentation.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/com/wolfssl/provider/jsse/test/WolfSSLParametersPskTest.java | Adds JUnit tests validating PSK configuration via WolfSSLParameters and handshake success. |
| src/test/com/wolfssl/provider/jsse/test/WolfSSLJSSETestSuite.java | Registers the new PSK test in the overall test suite. |
| src/java/com/wolfssl/provider/jsse/adapter/WolfSSLJDK8Helper.java | Updates SNI server-name handling to the renamed wolfSSL-specific SNI storage API. |
| src/java/com/wolfssl/provider/jsse/WolfSSLParametersHelper.java | Imports PSK fields when SSLParameters is actually a WolfSSLParameters. |
| src/java/com/wolfssl/provider/jsse/WolfSSLParameters.java | Makes parameters interoperable with JSSE APIs and introduces PSK configuration fields. |
| src/java/com/wolfssl/provider/jsse/WolfSSLEngineHelper.java | Applies PSK callbacks/identity hint/keepArrays from WolfSSLParameters to the native session. |
| examples/provider/README.md | Documents the new PSK example applications. |
| examples/provider/PskServerSocket.sh | Adds run script for SSLSocket PSK server example. |
| examples/provider/PskServerSocket.java | Adds SSLSocket PSK server example using WolfSSLParameters. |
| examples/provider/PskServerEngine.sh | Adds run script for SSLEngine PSK server example. |
| examples/provider/PskServerEngine.java | Adds SSLEngine PSK server example using WolfSSLParameters. |
| examples/provider/PskClientSocket.sh | Adds run script for SSLSocket PSK client example. |
| examples/provider/PskClientSocket.java | Adds SSLSocket PSK client example using WolfSSLParameters. |
| examples/provider/PskClientEngine.sh | Adds run script for SSLEngine PSK client example. |
| examples/provider/PskClientEngine.java | Adds SSLEngine PSK client example using WolfSSLParameters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f0ab1a5 to
04c58f4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Will rebase once #343 gets in for failing tests |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR adds Pre-Shared Key (PSK) support to the JSSE layer inside wolfJSSE.
Changes include:
WolfSSLParametersextendSSLParametersso PSK settings can be configured through the standardsetSSLParameters()API onSSLSocketandSSLEngineWolfSSLParameterswith public getters/settersWolfSSLParametersHelper.importParams()andWolfSSLEngineHelper.setLocalPskSettings()to apply them to the native WOLFSSL sessionUsage
Configure PSK on any
SSLSocketorSSLEngineusingWolfSSLParameters:Server side uses
setPskServerCb()and optionallysetPskIdentityHint().setKeepArrays(true)can be set to keep handshake arrays for post-handshake access. Works with both SSLSocket and SSLEngine.Examples
See the new example apps added in this PR for usage on SSLSocket and SSLEngine:
examples/provider/PskClientSocket.java
examples/provider/PskServerSocket.java
examples/provider/PskClientEngine.java
examples/provider/PskServerEngine.java