Skip to content

Commit

Permalink
Merge branch '3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Feb 25, 2020
2 parents 056cc32 + 59a7b11 commit f1661a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion phpseclib/Net/SSH2.php
Expand Up @@ -2398,7 +2398,12 @@ private function privatekey_login($username, PrivateKey $privatekey)

if ($publickey instanceof RSA) {
$privatekey = $privatekey->withPadding(RSA::SIGNATURE_PKCS1);
switch ($this->signature_format) {
$algos = ['rsa-sha2-256', 'rsa-sha2-512', 'ssh-rsa'];
if (isset($this->preferred['hostkey'])) {
$algos = array_intersect($this->preferred['hostkey'] , $algos);
}
$algo = self::array_intersect_first($algos, $this->server_host_key_algorithms);
switch ($algo) {
case 'rsa-sha2-512':
$hash = 'sha512';
$signatureType = 'rsa-sha2-512';
Expand Down

0 comments on commit f1661a7

Please sign in to comment.