mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-06-02 00:20:52 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
f1e58543b0
|
@ -357,15 +357,6 @@ class SSH2
|
||||||
*/
|
*/
|
||||||
var $languages_client_to_server = false;
|
var $languages_client_to_server = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* Server Signature Algorithms
|
|
||||||
*
|
|
||||||
* @link https://www.rfc-editor.org/rfc/rfc8308.html#section-3.1
|
|
||||||
* @var array|false
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
var $server_sig_algs = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preferred Algorithms
|
* Preferred Algorithms
|
||||||
*
|
*
|
||||||
|
@ -2438,7 +2429,7 @@ class SSH2
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$temp = unpack('Nlength', $this->_string_shift($response, 4));
|
$temp = unpack('Nlength', $this->_string_shift($response, 4));
|
||||||
$this->server_sig_algs = explode(',', $this->_string_shift($response, $temp['length']));
|
$this->supported_private_key_algorithms = explode(',', $this->_string_shift($response, $temp['length']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2817,9 +2808,7 @@ class SSH2
|
||||||
);
|
);
|
||||||
|
|
||||||
$algos = array('rsa-sha2-256', 'rsa-sha2-512', 'ssh-rsa');
|
$algos = array('rsa-sha2-256', 'rsa-sha2-512', 'ssh-rsa');
|
||||||
if ($this->server_sig_algs) {
|
if (isset($this->preferred['hostkey'])) {
|
||||||
$algos = array_intersect($algos, $this->server_sig_algs);
|
|
||||||
} elseif (isset($this->preferred['hostkey'])) {
|
|
||||||
$algos = array_intersect($algos, $this->preferred['hostkey']);
|
$algos = array_intersect($algos, $this->preferred['hostkey']);
|
||||||
}
|
}
|
||||||
$algo = $this->_array_intersect_first($algos, $this->supported_private_key_algorithms);
|
$algo = $this->_array_intersect_first($algos, $this->supported_private_key_algorithms);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user