Skip to content

Fix DoChannelOpen() and Add the regress test#919

Open
yosuke-wolfssl wants to merge 1 commit intowolfSSL:masterfrom
yosuke-wolfssl:f_2871
Open

Fix DoChannelOpen() and Add the regress test#919
yosuke-wolfssl wants to merge 1 commit intowolfSSL:masterfrom
yosuke-wolfssl:f_2871

Conversation

@yosuke-wolfssl
Copy link
Copy Markdown
Contributor

This PR fixes DoChannelOpen() so that this rejects the request if no fwdCb is registered.
Also, this adds the regress test for the case.

@yosuke-wolfssl yosuke-wolfssl self-assigned this Apr 15, 2026
Copilot AI review requested due to automatic review settings April 15, 2026 04:40
Copy link
Copy Markdown
Contributor

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

This PR hardens DoChannelOpen() handling for direct-tcpip forwarding by rejecting channel open requests when no forwarding callback is registered, and adds a regression test to ensure a CHANNEL_OPEN_FAILURE response is sent in that scenario.

Changes:

  • Reject direct-tcpip channel opens in DoChannelOpen() when ssh->ctx->fwdCb is not set.
  • Add a regression test that sends a direct-tcpip channel-open without registering fwdCb and asserts an OPEN_FAILURE response.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/internal.c Adds explicit rejection behavior for direct-tcpip opens when forwarding callback is missing.
tests/regress.c Adds a regression test covering the “no fwdCb registered” direct-tcpip open failure behavior.

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

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