mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-11 08:10:58 +00:00
SSH2: send the identifier first, before reading it
This commit is contained in:
parent
d760d97fc8
commit
535104cb84
@ -1056,6 +1056,10 @@ class Net_SSH2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->identifier = $this->_generate_identifier();
|
||||||
|
|
||||||
|
fputs($this->fsock, $this->identifier . "\r\n");
|
||||||
|
|
||||||
/* According to the SSH2 specs,
|
/* According to the SSH2 specs,
|
||||||
|
|
||||||
"The server MAY send other lines of data before sending the version
|
"The server MAY send other lines of data before sending the version
|
||||||
@ -1099,8 +1103,6 @@ class Net_SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->identifier = $this->_generate_identifier();
|
|
||||||
|
|
||||||
if (defined('NET_SSH2_LOGGING')) {
|
if (defined('NET_SSH2_LOGGING')) {
|
||||||
$this->_append_log('<-', $extra . $temp);
|
$this->_append_log('<-', $extra . $temp);
|
||||||
$this->_append_log('->', $this->identifier . "\r\n");
|
$this->_append_log('->', $this->identifier . "\r\n");
|
||||||
@ -1116,8 +1118,6 @@ class Net_SSH2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
fputs($this->fsock, $this->identifier . "\r\n");
|
|
||||||
|
|
||||||
$response = $this->_get_binary_packet();
|
$response = $this->_get_binary_packet();
|
||||||
if ($response === false) {
|
if ($response === false) {
|
||||||
user_error('Connection closed by server');
|
user_error('Connection closed by server');
|
||||||
|
Loading…
Reference in New Issue
Block a user