From a74707e08052a54430ec525c7d0c03916518989b Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 7 Dec 2021 21:59:24 -0600 Subject: [PATCH] SSH2: make login() return false if no valid auth methods are found this is an issue if you, for example, login with a PublicKey instead of a PrivateKey --- phpseclib/Net/SSH2.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 89e57487..87d07517 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -2314,6 +2314,10 @@ class Net_SSH2 } } + if (!count($newargs)) { + return false; + } + foreach ($newargs as $arg) { if ($this->_login_helper($username, $arg)) { return true;