Skip to content

Commit

Permalink
Implement changes required to avert terrapin attack.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Painter committed Dec 15, 2023
1 parent b5f7eb6 commit aadec4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,5 +262,4 @@ protected boolean isExtensionNegotiationSupported() {
protected boolean isServerMode() {
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@ public void run() {
case SSH_MSG_EXT_INFO:

checkStrictKex();

if(Log.isDebugEnabled())
Log.debug("Received SSH_MSG_EXT_INFO");

Expand Down Expand Up @@ -2258,6 +2258,13 @@ protected void generateNewKeysServerOut() {
outgoingSequence = 0L;
}

if(isKexStrict) {
if(Log.isDebugEnabled()) {
Log.debug("Resetting OUTGOING sequence from {} to zero for strict transport protocol requirements", outgoingSequence);
}
outgoingSequence = 0L;
}

if (keyExchange.hasReceivedNewKeys()) {
completeKeyExchange(keyExchange);
}
Expand Down Expand Up @@ -2505,6 +2512,8 @@ public void messageSent(Long sequenceNo) {

}

protected abstract boolean isServerMode();

private void processExtensionInfo(byte[] msg) throws IOException {
ByteArrayReader reader = new ByteArrayReader(msg);

Expand Down

0 comments on commit aadec4c

Please sign in to comment.