Skip to content

Commit

Permalink
Fix for issue #910: Bad packet received by server when hearbeat is en…
Browse files Browse the repository at this point in the history
…abled (#911)

* Fix for issue #910: Bad packet received by server when hearbeat is enabled

* Address re-keying case too

---------

Co-authored-by: Jeroen van Erp <jeroen@hierynomus.com>
  • Loading branch information
rasantel and hierynomus authored Apr 18, 2024
1 parent 079cb08 commit 607e805
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/schmizz/sshj/transport/TransportImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ public long write(SSHPacket payload)
try {

if (kexer.isKexOngoing()) {
// Only transport layer packets (1 to 49) allowed except SERVICE_REQUEST
// Only transport layer packets (1 to 49) allowed except SERVICE_REQUEST and IGNORE
final Message m = Message.fromByte(payload.array()[payload.rpos()]);
if (!m.in(1, 49) || m == Message.SERVICE_REQUEST) {
if (!m.in(1, 49) || m == Message.SERVICE_REQUEST || m == Message.IGNORE) {
assert m != Message.KEXINIT;
kexer.waitForDone();
}
Expand Down

0 comments on commit 607e805

Please sign in to comment.