mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-05 05:18:28 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
a134f1c8d4
@ -1005,7 +1005,7 @@ class SSH2
|
|||||||
* @var bool
|
* @var bool
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
var $retry_connect = false;
|
var $login_credentials_finalized = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binary Packet Buffer
|
* Binary Packet Buffer
|
||||||
@ -2292,7 +2292,7 @@ class SSH2
|
|||||||
function login($username)
|
function login($username)
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
if (!$this->retry_connect) {
|
if (!$this->login_credentials_finalized) {
|
||||||
$this->auth[] = $args;
|
$this->auth[] = $args;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2383,6 +2383,7 @@ class SSH2
|
|||||||
|
|
||||||
foreach ($newargs as $arg) {
|
foreach ($newargs as $arg) {
|
||||||
if ($this->_login_helper($username, $arg)) {
|
if ($this->_login_helper($username, $arg)) {
|
||||||
|
$this->login_credentials_finalized = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2418,10 +2419,14 @@ class SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$bad_key_size_fix = $this->bad_key_size_fix;
|
||||||
$response = $this->_get_binary_packet();
|
$response = $this->_get_binary_packet();
|
||||||
if ($response === false) {
|
if ($response === false) {
|
||||||
if ($this->retry_connect) {
|
// bad_key_size_fix is only ever re-assigned to true
|
||||||
$this->retry_connect = false;
|
// under certain conditions. when it's newly set we'll
|
||||||
|
// retry the connection with that new setting but we'll
|
||||||
|
// only try it once.
|
||||||
|
if ($bad_key_size_fix != $this->bad_key_size_fix) {
|
||||||
if (!$this->_connect()) {
|
if (!$this->_connect()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3553,7 +3558,6 @@ class SSH2
|
|||||||
function _reconnect()
|
function _reconnect()
|
||||||
{
|
{
|
||||||
$this->_reset_connection(NET_SSH2_DISCONNECT_CONNECTION_LOST);
|
$this->_reset_connection(NET_SSH2_DISCONNECT_CONNECTION_LOST);
|
||||||
$this->retry_connect = true;
|
|
||||||
if (!$this->_connect()) {
|
if (!$this->_connect()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3577,7 +3581,6 @@ class SSH2
|
|||||||
$this->hmac_check = $this->hmac_create = false;
|
$this->hmac_check = $this->hmac_create = false;
|
||||||
$this->hmac_size = false;
|
$this->hmac_size = false;
|
||||||
$this->session_id = false;
|
$this->session_id = false;
|
||||||
$this->retry_connect = true;
|
|
||||||
$this->get_seq_no = $this->send_seq_no = 0;
|
$this->get_seq_no = $this->send_seq_no = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user