From ca695f5bdddfc5ef4f6ec68dc2f30bbbd77ea462 Mon Sep 17 00:00:00 2001 From: Sebastiaan Andeweg Date: Fri, 9 Nov 2018 16:36:50 +0100 Subject: [PATCH 1/3] fix order of user_error() and bitmap reset --- phpseclib/Net/SSH2.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index aea9edd5..9f60349e 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3335,8 +3335,8 @@ class SSH2 function _get_binary_packet($skip_channel_filter = false) { if (!is_resource($this->fsock) || feof($this->fsock)) { - user_error('Connection closed prematurely'); $this->bitmap = 0; + user_error('Connection closed prematurely'); return false; } @@ -3379,8 +3379,8 @@ class SSH2 while ($remaining_length > 0) { $temp = stream_get_contents($this->fsock, $remaining_length); if ($temp === false || feof($this->fsock)) { - user_error('Error reading from socket'); $this->bitmap = 0; + user_error('Error reading from socket'); return false; } $buffer.= $temp; @@ -3398,8 +3398,8 @@ class SSH2 if ($this->hmac_check !== false) { $hmac = stream_get_contents($this->fsock, $this->hmac_size); if ($hmac === false || strlen($hmac) != $this->hmac_size) { - user_error('Error reading socket'); $this->bitmap = 0; + user_error('Error reading socket'); return false; } elseif ($hmac != $this->hmac_check->hash(pack('NNCa*', $this->get_seq_no, $packet_length, $padding_length, $payload . $padding))) { user_error('Invalid HMAC'); @@ -3936,8 +3936,8 @@ class SSH2 function _send_binary_packet($data, $logged = null) { if (!is_resource($this->fsock) || feof($this->fsock)) { - user_error('Connection closed prematurely'); $this->bitmap = 0; + user_error('Connection closed prematurely'); return false; } From 396b9f1a0a233daf20645cc2fde444e652e3bd33 Mon Sep 17 00:00:00 2001 From: Sebastiaan Andeweg Date: Fri, 9 Nov 2018 16:36:50 +0100 Subject: [PATCH 2/3] fix order of user_error() and bitmap reset --- phpseclib/Net/SSH2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index a1051ad9..7c0b0355 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -4039,8 +4039,8 @@ class Net_SSH2 function _send_binary_packet($data, $logged = null) { if (!is_resource($this->fsock) || feof($this->fsock)) { - user_error('Connection closed prematurely'); $this->bitmap = 0; + user_error('Connection closed prematurely'); return false; } From 403f756c8292d4aa3d5c46a08a1bdf5193056d99 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 14 Nov 2018 21:41:55 +0100 Subject: [PATCH 3/3] README: Declare 2.0 branch as LTS. #1310 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b18a8a3e..d52f1ce0 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509 ### 2.0 +* Long term support (LTS) release * Modernized version of 1.0 * Minimum PHP version: 5.3.3 * PSR-4 autoloading with namespace rooted at `\phpseclib`