mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-28 01:28:27 +00:00
SSH2: ssh-rsa is sometimes incorrectly used instead of rsa-sha2-256
This commit is contained in:
parent
055d6097af
commit
b0d63fbfb5
@ -1813,8 +1813,13 @@ class Net_SSH2
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($public_key_format != $expected_key_format || $this->signature_format != $server_host_key_algorithm) {
|
if ($public_key_format != $expected_key_format || $this->signature_format != $server_host_key_algorithm) {
|
||||||
user_error('Server Host Key Algorithm Mismatch');
|
switch (true) {
|
||||||
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
case $this->signature_format == $server_host_key_algorithm:
|
||||||
|
case $server_host_key_algorithm != 'rsa-sha2-256' && $server_host_key_algorithm != 'rsa-sha2-512':
|
||||||
|
case $this->signature_format != 'ssh-rsa':
|
||||||
|
user_error('Server Host Key Algorithm Mismatch');
|
||||||
|
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$packet = pack(
|
$packet = pack(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user