Skip to content

internal: wipe packets DoPacket refuses - #1367

Merged
philljj merged 1 commit into
wolfSSL:masterfrom
ejohnstown:rejected-packet-wipe
Nov 12, 2026
Merged

philljj merged 1 commit into
wolfSSL:masterfrom
ejohnstown:rejected-packet-wipe

Conversation

@ejohnstown

Copy link
Copy Markdown
Contributor

DoReceive() wipes a packet that DoPacket() refuses before dispatch, such
as a USERAUTH_REQUEST after auth or short padding. A pending auth keeps
its packet, since the next call dispatches it again.

  • regress: refused packets are wiped; a pending password request is
    kept until it completes

Issue: F-17105

Copilot AI balanced review requested due to automatic review settings November 3, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified for the receive-path sensitive-data cleanup change.

No open issues 🎉

What changed in this PR

This PR improves sensitive-data cleanup in wolfSSH’s receive path by wiping packets rejected before dispatch, while preserving pending authentication packets for retry.

Changes:

  • Wipe unconsumed packets after fatal errors, except when authentication is pending.
  • Add regression tests for rejected post-authentication requests, invalid padding, and pending authentication packet retention and cleanup.
File Description
tests/​regress.c Adds and registers packet-wiping and pending-authentication regression tests.
src/​internal.c Wipes rejected packets in DoReceive() while preserving pending authentication requests.

Review effort: Balanced

@ejohnstown

Copy link
Copy Markdown
Contributor Author

@claude review

@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.

Code review found no issues

No high-confidence issues detected in this change.

@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 #1367

Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer

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

DoReceive() wipes a packet that DoPacket() refuses before dispatch: a
message id the state does not allow, such as a USERAUTH_REQUEST after
auth, padding under the minimum, or a length that overflows. Only a
pending auth keeps its packet, since the next call dispatches it again.

- tests: a post-auth password request and a short-padding packet are
  wiped; a pending password request is kept until it completes

Issue: F-17105
@philljj
philljj merged commit 63cf1ff into wolfSSL:master Nov 12, 2026
222 checks passed
@ejohnstown
ejohnstown deleted the rejected-packet-wipe branch November 12, 2026 23:42
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