SSH2: no authentication didn't work

This commit is contained in:
terrafrost 2019-09-11 06:36:03 -05:00
parent af3b0d8c2f
commit e52697abac

View File

@ -2101,10 +2101,6 @@ class SSH2
return false;
}
if (!is_string($password)) {
throw new \UnexpectedValueException('$password needs to either be an instance of \phpseclib\Crypt\Common\PrivateKey, \System\SSH\Agent, an array or a string');
}
if (!isset($password)) {
$packet = Strings::packSSH2(
'Cs3',
@ -2133,6 +2129,10 @@ class SSH2
}
}
if (!is_string($password)) {
throw new \UnexpectedValueException('$password needs to either be an instance of \phpseclib\Crypt\Common\PrivateKey, \System\SSH\Agent, an array or a string');
}
$packet = Strings::packSSH2(
'Cs3bs',
NET_SSH2_MSG_USERAUTH_REQUEST,