Skip to content

Add JNI RSA-PSS sign/verify and RSA sign check PK callbacks#338

Merged
rlm2002 merged 2 commits intowolfSSL:masterfrom
cconlon:rsaPssCb
Feb 27, 2026
Merged

Add JNI RSA-PSS sign/verify and RSA sign check PK callbacks#338
rlm2002 merged 2 commits intowolfSSL:masterfrom
cconlon:rsaPssCb

Conversation

@cconlon
Copy link
Copy Markdown
Member

@cconlon cconlon commented Feb 25, 2026

This PR adds RSA-PSS sign and sign check (verify) PK callback support to the JNI layer, enabling applications to register custom RSA-PSS callbacks for TLS 1.3 handshakes.

  • Adds RSA sign check PK callback support (verifies a signature immediately after creation), complementing the existing RSA sign and verify callbacks
  • Adds new WolfSSLRsaPssSignCallback and WolfSSLRsaPssVerifyCallback Java interfaces
  • Adds doPssSign() and doPssVerify() native wrappers in WolfCryptRSA for use in example/test callback implementations
  • Adds handshake-based JUnit tests that exercise RSA and RSA-PSS PK callbacks during TLS 1.2 and TLS 1.3 connections

ZD 21200

@cconlon cconlon self-assigned this Feb 25, 2026
Copilot AI review requested due to automatic review settings February 25, 2026 00:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds RSA sign-check and RSA-PSS signing/verification PK callback support across the Java/JNI boundary, plus handshake-driven tests to exercise these callbacks during TLS handshakes.

Changes:

  • Introduces new Java callback interfaces for RSA-PSS sign and verify (sign-check).
  • Extends WolfSSLContext and JNI bindings to register RSA sign-check and RSA-PSS PK callbacks.
  • Adds WolfCryptRSA native wrappers for RSA-PSS sign/verify and new socket-based handshake tests.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/test/com/wolfssl/test/WolfSSLContextTest.java Adds TLS 1.2/1.3 handshake tests that register RSA/RSA-PSS callbacks and assert invocation.
src/java/com/wolfssl/WolfSSLRsaPssVerifyCallback.java New Java interface for RSA-PSS verification (used for sign-check callback registration).
src/java/com/wolfssl/WolfSSLRsaPssSignCallback.java New Java interface for RSA-PSS signing callbacks.
src/java/com/wolfssl/WolfSSLContext.java Adds internal callback dispatch + public setters and native hooks for RSA sign-check and RSA-PSS callbacks.
src/java/com/wolfssl/WolfCryptRSA.java Adds native method declarations for RSA-PSS sign/verify wrappers.
scripts/infer.sh Includes the new Java interface files in Infer’s javac invocation.
native/com_wolfssl_WolfSSLContext.h Adds JNI declarations for RSA-PSS sign and RSA/RSA-PSS sign-check registration.
native/com_wolfssl_WolfSSLContext.c Implements JNI registration and native-to-Java bridging for the new callbacks.
native/com_wolfssl_WolfCryptRSA.h Adds JNI declarations for doPssSign/doPssVerify.
native/com_wolfssl_WolfCryptRSA.c Implements RSA-PSS sign/verify wrappers using wolfCrypt APIs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/com/wolfssl/test/WolfSSLContextTest.java
Comment thread native/com_wolfssl_WolfCryptRSA.c Outdated
Comment thread src/test/com/wolfssl/test/WolfSSLContextTest.java Outdated
Comment thread src/test/com/wolfssl/test/WolfSSLContextTest.java
Comment thread src/test/com/wolfssl/test/WolfSSLContextTest.java Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/java/com/wolfssl/WolfSSLRsaPssVerifyCallback.java Outdated
Comment thread src/java/com/wolfssl/WolfSSLRsaPssSignCallback.java Outdated
Comment thread src/test/com/wolfssl/test/WolfSSLContextTest.java
Comment thread src/test/com/wolfssl/test/WolfSSLContextTest.java Outdated
@rlm2002 rlm2002 merged commit f25cc9c into wolfSSL:master Feb 27, 2026
98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants