From 827607575ad6105f1535e3fd0e15fe5b557e612d Mon Sep 17 00:00:00 2001 From: terrafrost Date: Fri, 3 Jul 2020 13:31:37 -0500 Subject: [PATCH] ... --- phpseclib/Net/SSH2.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index b518cca1..377e15c9 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3873,6 +3873,7 @@ class SSH2 switch ($this->encrypt->name) { case 'aes128-gcm@openssh.com': case 'aes256-gcm@openssh.com': +$startEncrypt = microtime(true); $this->encrypt->setNonce( $this->encrypt->fixed . $this->encrypt->invocation_counter @@ -3880,6 +3881,7 @@ class SSH2 Strings::increment_str($this->encrypt->invocation_counter); $this->encrypt->setAAD($temp = ($packet & "\xFF\xFF\xFF\xFF")); $packet = $temp . $this->encrypt->encrypt(substr($packet, 4)); +$encryptTime = microtime(true) - $startEncrypt; break; case 'chacha20-poly1305@openssh.com': $nonce = pack('N2', 0, $this->send_seq_no); @@ -3928,7 +3930,7 @@ class SSH2 $current = microtime(true); $message_number = isset($this->message_numbers[ord($data[0])]) ? $this->message_numbers[ord($data[0])] : 'UNKNOWN (' . ord($data[0]) . ')'; $message_number = '-> ' . $message_number . - ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; + ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's, encrypt time: ' . round($encryptTime, 4) . ')'; $this->append_log($message_number, isset($logged) ? $logged : $data); $this->last_packet = $current; }