Skip to content

Commit

Permalink
Merge branch '1.0' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Nov 22, 2024
2 parents b966aa2 + b38e849 commit 53645af
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions phpseclib/Net/SSH2.php
Original file line number Diff line number Diff line change
Expand Up @@ -3734,7 +3734,9 @@ function _get_binary_packet($skip_channel_filter = false)

$remaining_length = $packet_length + 4 - $this->decrypt_block_size;

$this->bytesTransferredSinceLastKEX+= $packet_length + $padding_length + 5;
if (!$this->keyExchangeInProgress) {
$this->bytesTransferredSinceLastKEX+= $packet_length + $padding_length + 5;
}

// quoting <http://tools.ietf.org/html/rfc4253#section-6.1>,
// "implementations SHOULD check that the packet length is reasonable"
Expand Down Expand Up @@ -4451,7 +4453,9 @@ function _send_binary_packet($data, $logged = null)

$packet.= $hmac;

$this->bytesTransferredSinceLastKEX+= strlen($packet);
if (!$this->keyExchangeInProgress) {
$this->bytesTransferredSinceLastKEX+= strlen($packet);
}

$start = microtime(true);
$result = strlen($packet) == @fputs($this->fsock, $packet);
Expand Down

0 comments on commit 53645af

Please sign in to comment.