Skip to content

Commit

Permalink
Address re-keying case too
Browse files Browse the repository at this point in the history
  • Loading branch information
rasantel committed Nov 10, 2023
1 parent 8c2c04e commit 9343b80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/schmizz/sshj/SSHClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -804,12 +804,12 @@ protected void onConnect()
throws IOException {
super.onConnect();
trans.init(getRemoteHostname(), getRemotePort(), getInputStream(), getOutputStream());
doKex();
final KeepAlive keepAliveThread = conn.getKeepAlive();
if (keepAliveThread.isEnabled()) {
ThreadNameProvider.setThreadName(conn.getKeepAlive(), trans);
keepAliveThread.start();
}
doKex();
}

/**
Expand Down
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 9343b80

Please sign in to comment.