1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-11-27 04:46:26 +01:00

Merge branch '2.0'

This commit is contained in:
terrafrost 2019-01-16 21:17:18 -06:00
commit ea3c8dbd9a

View File

@ -1827,9 +1827,14 @@ class 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) {
switch (true) {
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':
$this->disconnect_helper(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED); $this->disconnect_helper(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
throw new \RuntimeException('Server Host Key Algorithm Mismatch'); throw new \RuntimeException('Server Host Key Algorithm Mismatch');
} }
}
$packet = pack( $packet = pack(
'C', 'C',