Skip to content

Commit

Permalink
SSH2: use phpseclib's preferred order for auth algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Nov 22, 2023
1 parent 356ab5f commit 49c9439
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phpseclib/Net/SSH2.php
Expand Up @@ -2830,9 +2830,9 @@ function _privatekey_login($username, $privatekey)

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

Expand Down

0 comments on commit 49c9439

Please sign in to comment.