Files
ssh.net/test
mus65 70a0a08dae Handle unknown channel messages correctly (#1363)
* Handle unknown channel messages correctly

See discussion #1218 . Some servers send custom channel messages
like 'keepalive@proftpd.org' as keep alive messages. This currently
causes a NotSupportedException.

According to the spec https://datatracker.ietf.org/doc/html/rfc4254#section-5.4 :

"If the request is not recognized or is not
supported for the channel, SSH_MSG_CHANNEL_FAILURE is returned."

Send a failure message back instead of throwing an exception.

* consider WantReply before sending failure reply

* Use RemoteChannelNumber for failure message

* fix wrong ChannelNumber in SshCommand Channel Response

not directly related to the PR, was noticed during Code Review.

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2024-04-04 16:31:04 +02:00
..