mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 02:07:09 +00:00
Merge branch '3.0'
This commit is contained in:
commit
f1661a7dc2
@ -2398,7 +2398,12 @@ class SSH2
|
|||||||
|
|
||||||
if ($publickey instanceof RSA) {
|
if ($publickey instanceof RSA) {
|
||||||
$privatekey = $privatekey->withPadding(RSA::SIGNATURE_PKCS1);
|
$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':
|
case 'rsa-sha2-512':
|
||||||
$hash = 'sha512';
|
$hash = 'sha512';
|
||||||
$signatureType = 'rsa-sha2-512';
|
$signatureType = 'rsa-sha2-512';
|
||||||
|
Loading…
Reference in New Issue
Block a user