mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-25 03:16:02 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
94abf563ad
@ -1355,6 +1355,7 @@ class SSH2
|
||||
function _key_exchange($kexinit_payload_server = false)
|
||||
{
|
||||
$preferred = $this->preferred;
|
||||
$send_kex = true;
|
||||
|
||||
$kex_algorithms = isset($preferred['kex']) ?
|
||||
$preferred['kex'] :
|
||||
@ -1438,7 +1439,7 @@ class SSH2
|
||||
0
|
||||
);
|
||||
|
||||
if ($this->send_kex_first) {
|
||||
if ($kexinit_payload_server === false) {
|
||||
if (!$this->_send_binary_packet($kexinit_payload_client)) {
|
||||
return false;
|
||||
}
|
||||
@ -1454,6 +1455,8 @@ class SSH2
|
||||
user_error('Expected SSH_MSG_KEXINIT');
|
||||
return false;
|
||||
}
|
||||
|
||||
$send_kex = false;
|
||||
}
|
||||
|
||||
$response = $kexinit_payload_server;
|
||||
@ -1526,7 +1529,7 @@ class SSH2
|
||||
extract(unpack('Cfirst_kex_packet_follows', $this->_string_shift($response, 1)));
|
||||
$first_kex_packet_follows = $first_kex_packet_follows != 0;
|
||||
|
||||
if (!$this->send_kex_first && !$this->_send_binary_packet($kexinit_payload_client)) {
|
||||
if ($send_kex && !$this->_send_binary_packet($kexinit_payload_client)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user