Skip to content

Commit

Permalink
Merge branch '1.0' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Nov 22, 2023
2 parents 70c7ffe + e84886f commit f1e5854
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions phpseclib/Net/SSH2.php
Expand Up @@ -357,15 +357,6 @@ class SSH2
*/
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
*
Expand Down Expand Up @@ -2438,7 +2429,7 @@ function _login_helper($username, $password = null)
return false;
}
$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']));
}
}

Expand Down Expand Up @@ -2817,9 +2808,7 @@ function _privatekey_login($username, $privatekey)
);

$algos = array('rsa-sha2-256', 'rsa-sha2-512', 'ssh-rsa');
if ($this->server_sig_algs) {
$algos = array_intersect($algos, $this->server_sig_algs);
} elseif (isset($this->preferred['hostkey'])) {
if (isset($this->preferred['hostkey'])) {
$algos = array_intersect($algos, $this->preferred['hostkey']);
}
$algo = $this->_array_intersect_first($algos, $this->supported_private_key_algorithms);
Expand Down

0 comments on commit f1e5854

Please sign in to comment.