Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel Callbacks #713

Merged
merged 9 commits into from
Jul 16, 2024
Merged

Channel Callbacks #713

merged 9 commits into from
Jul 16, 2024

Conversation

ejohnstown
Copy link
Contributor

Add a set of callback function hooks for various steps in the creation of a channel. These include:

  • Channel Open
  • Channel Open Confirm
  • Channel Open Failure
  • Channel EOF
  • Channel Close
  • Channel Request Shell
  • Channel Request Subsystem
  • Channel Request Exec

A channel request can be rejected by the request callbacks. Also added functions to query a channel's connection type and exec command.

1. Add the new Channel Open callback support APIs.
1. Add channel open callback APIs to support two client callback
   functions, Channel Open Conf and Fail.
1. Added callbacks for receiving a Channel EOF message and a Channel
   Close message.
2. Added accessors for the new callback's ctx parameters.
3. Add some missing comments on the channel open callbacks.
1. Add callback for the "shell" Channel Request message for the server.
2. Whitespace and braces changes.
3. Relabel the string for administratively prohibited channel opens.
4. Add some comment.
1. Add checks for the Channel EOF or Close callbacks to the Do functions
   for those messages, and call them.
1. Move the session types earlier in the ssh.h header.
2. Add functions wolfSSH_ChannelGetSessionType() and
   wolfSSH_ChannelGetSessionCommand() to requestion information about a
   session.
1. Add a callback hook for channel requests of the exec type.
1. In DoChannelRequest(), rearrange the test cases. Start with the
   requests that are always expected as possible, and make the optional
   ones follow.
1. Treat any non-zero response from any of the channel request callback
   functions as a rejection of the channel request.
2. If a channel request reply is wanted, return the failure message if
   the callback function had rejected the request.
@douzzer douzzer merged commit 24884dc into wolfSSL:master Jul 16, 2024
24 checks passed
@ejohnstown ejohnstown deleted the channel-callbacks branch July 16, 2024 20:43
jefferyq2 pushed a commit to jefferyq2/wolfssh that referenced this pull request Sep 24, 2024
jefferyq2 pushed a commit to jefferyq2/wolfssh that referenced this pull request Oct 18, 2024
jefferyq2 pushed a commit to jefferyq2/wolfssh that referenced this pull request Oct 29, 2024
jefferyq2 pushed a commit to jefferyq2/wolfssh that referenced this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants