You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[11.2](https://datatracker.ietf.org/doc/html/rfc4253#section-11.2). Ignored Data Message
byte SSH_MSG_IGNORE
string data
All implementations MUST understand (and ignore) this message at any
time (after receiving the identification string). No implementation
is required to send them. This message can be used as an additional
protection measure against advanced traffic analysis techniques.
string
Arbitrary length binary string. Strings are allowed to contain
arbitrary binary data, including null characters and 8-bit
characters. They are stored as a uint32 containing its length
(number of bytes that follow) and zero (= empty string) or more
bytes that are the value of the string. Terminating null
characters are not used.
Strings are also used to store text. In that case, US-ASCII is
used for internal names, and ISO-10646 UTF-8 for text that might
be displayed to the user. The terminating null character SHOULD
NOT normally be stored in the string. For example: the US-ASCII
string "testing" is represented as 00 00 00 07 t e s t i n g. The
UTF-8 mapping does not alter the encoding of US-ASCII characters.
However in SSHJ implmentation (under all branches include master) - src/main/java/net/schmizz/keepalive/Heartbeater.java . We do not provide any data field
@Override
protected void doKeepAlive() throws TransportException {
conn.getTransport().write(new SSHPacket(Message.IGNORE)); <<<<<< No data field
}
}
This will cause SSH Server on the other side define this message as invalid message and terminate the connection.
For example the SSHJ log as below
System - Sending SSH_MSG_SERVICE_REQUEST
sshj-Heartbeater - Encoding packet #0: 02
sshj-Reader- Received packet #0: <mask for security>
sshj-Reader-Received packet DISCONNECT
sshj-Reader-Received SSH_MSG_DISCONNECT (reason=PROTOCOL_ERROR, msg=Protocol error)
sshj-Reader-Dying because - Protocol error
As RFC4253 stated - https://datatracker.ietf.org/doc/html/rfc4253#section-11.2 . SSH_MSG_IGNORE must have a string with data inside. Quote RFC4253 as below
At the same time, as RFC4251 stated - https://datatracker.ietf.org/doc/html/rfc4251#section-5 , string cannot be empty. Even it is empty, it must be a empty string with 0 length like "".
However in SSHJ implmentation (under all branches include master) - src/main/java/net/schmizz/keepalive/Heartbeater.java . We do not provide any data field
This will cause SSH Server on the other side define this message as invalid message and terminate the connection.
For example the SSHJ log as below
Except issues from our side, another similar issue has also happend in https://issues.apache.org/jira/browse/SSHD-699 . I believe they also have a very good point on this.
The text was updated successfully, but these errors were encountered: