From: terrafrost <terrafrost@gmail.com>
Date: Fri, 31 Jul 2020 02:49:21 -0500
Subject: SSH2: don't try to login as none auth method for CoreFTP server

Origin: upstream, https://github.com/phpseclib/phpseclib/commit/c7d7b36018e13d034a74f2416ce1dcd247bda3ec
---
 phpseclib/Net/SSH2.php | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php
index 31af445..aa503a1 100644
--- a/phpseclib/Net/SSH2.php
+++ b/phpseclib/Net/SSH2.php
@@ -2135,11 +2135,13 @@ class Net_SSH2
 
         // try logging with 'none' as an authentication method first since that's what
         // PuTTY does
-        if ($this->_login($username)) {
-            return true;
-        }
-        if (count($args) == 1) {
-            return false;
+        if (substr($this->server_identifier, 0, 13) != 'SSH-2.0-CoreFTP') {
+            if ($this->_login($username)) {
+                return true;
+            }
+            if (count($args) == 1) {
+                return false;
+            }
         }
         return call_user_func_array(array(&$this, '_login'), $args);
     }
