From e84886fde2f3af002ecca871666f8b2000a78de2 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Wed, 22 Nov 2023 12:38:34 -0600 Subject: [PATCH] SSH2: another attempt at #1960 --- phpseclib/Net/SSH2.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 29bd73ed..307d6e5e 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -360,15 +360,6 @@ class Net_SSH2 */ var $languages_client_to_server = false; - /** - * Server Signature Algorithms - * - * @link https://www.rfc-editor.org/rfc/rfc8308.html#section-3.1 - * @var array|false - * @access private - */ - var $server_sig_algs = false; - /** * Preferred Algorithms * @@ -2446,7 +2437,7 @@ class Net_SSH2 return false; } $temp = unpack('Nlength', $this->_string_shift($response, 4)); - $this->server_sig_algs = explode(',', $this->_string_shift($response, $temp['length'])); + $this->supported_private_key_algorithms = explode(',', $this->_string_shift($response, $temp['length'])); } } @@ -2829,9 +2820,7 @@ class Net_SSH2 ); $algos = array('rsa-sha2-256', 'rsa-sha2-512', 'ssh-rsa'); - if ($this->server_sig_algs) { - $algos = array_intersect($algos, $this->server_sig_algs); - } elseif (isset($this->preferred['hostkey'])) { + if (isset($this->preferred['hostkey'])) { $algos = array_intersect($algos, $this->preferred['hostkey']); } $algo = $this->_array_intersect_first($algos, $this->supported_private_key_algorithms);