Skip to content

Fixes for native callback length checks, callback ByteBuffer docs, and dist packaging cleanup - #445

Merged
rlm2002 merged 5 commits into
wolfSSL:masterfrom
cconlon:fenrirOct22
Oct 26, 2026
Merged

rlm2002 merged 5 commits into
wolfSSL:masterfrom
cconlon:fenrirOct22

Conversation

@cconlon

@cconlon cconlon commented Oct 22, 2026

Copy link
Copy Markdown
Member

This PR includes 5 Fenrir fixes:

  • F-15725: Correct a comment in the native receive callback.
  • F-15752: Exclude native build objects from make dist output.
  • F-15699: Check RSA verify, sign check and decrypt callback return lengths against the buffer size, with tests.
  • F-15700: Check atomic decrypt callback padding sizes against the record size, with tests.
  • F-15742: Document that callback ByteBuffer arguments are only valid during the callback.

@cconlon cconlon self-assigned this Oct 22, 2026
Copilot AI balanced review requested due to automatic review settings October 22, 2026 21:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cconlon

cconlon commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

@claude review

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #445

Scan targets checked: wolfssljni-src, wolfssljni-bugs
Not reviewed (no scan target covers them): Makefile
Coverage: 1 of 17 in-scope changed file(s) opened by the reviewer; not opened: native/com_wolfssl_WolfSSLSession.c, src/java/com/wolfssl/WolfSSLByteBufferIORecvCallback.java, src/java/com/wolfssl/WolfSSLByteBufferIOSendCallback.java, src/java/com/wolfssl/WolfSSLDecryptVerifyCallback.java, src/java/com/wolfssl/WolfSSLEccSharedSecretCallback.java, src/java/com/wolfssl/WolfSSLEccSignCallback.java, src/java/com/wolfssl/WolfSSLEccVerifyCallback.java, src/java/com/wolfssl/WolfSSLMacEncryptCallback.java, src/java/com/wolfssl/WolfSSLRsaDecCallback.java, src/java/com/wolfssl/WolfSSLRsaEncCallback.java and 6 more

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I reviewed this PR and didn't find any bugs. The new bounds checks are in JNI crypto callback paths whose output lengths and pointers go straight into wolfSSL, so a maintainer who knows those wolfSSL callback contracts should still take a look.

What was reviewed:

  • The padSz checks in NativeDecryptVerifyCb and NativeVerifyDecryptCb. Values that are negative or larger than decSz are now rejected before the cast to unsigned int.
  • The positive-return length checks against sigSz/inSz in the RSA verify, sign-check, PSS sign-check and decrypt callbacks. Each one runs before *out is set, so an oversized return never reaches wolfSSL.
  • The Makefile dist cleanup of .o/.d files, the receive-callback comment fix, the ByteBuffer lifetime Javadoc, and the new oversized-return JUnit tests, including the pkCbHandshakeLoop change to also return the error code.
Extended reasoning...

The change adds input validation to the native JNI callbacks in com_wolfssl_WolfSSLContext.c, which are the paths where Java-supplied lengths and padding sizes go back into wolfSSL's TLS record and RSA handling. It also fixes a comment, tidies the dist target, adds Javadoc to 14 callback interfaces, and adds about 270 lines of handshake-based tests. Memory-safety checks in crypto callbacks are security-sensitive, so this is not a mechanical change to auto-approve, even though the checks look correct and are covered by tests. An earlier automated reviewer left a COMMENTED review whose content isn't visible here.

@cconlon cconlon assigned rlm2002 and wolfSSL-Bot and unassigned cconlon Oct 22, 2026
@rlm2002
rlm2002 merged commit ffb428f into wolfSSL:master Oct 26, 2026
110 of 111 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.

5 participants