From 6897b947ea64f596847a56d402cd27e247cf99f7 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 20 Aug 2024 08:38:38 -0500 Subject: [PATCH] SSH2: priotize the umac algorithms down due to their slow speed PHP's hash() method doesn't support them so they receive no acceleration whereas the other algorithms can and do --- phpseclib/Net/SSH2.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 52b69e7b..6ef800ab 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -5001,22 +5001,24 @@ class SSH2 return [ 'hmac-sha2-256-etm@openssh.com', 'hmac-sha2-512-etm@openssh.com', - 'umac-64-etm@openssh.com', - 'umac-128-etm@openssh.com', 'hmac-sha1-etm@openssh.com', // from : 'hmac-sha2-256',// RECOMMENDED HMAC-SHA256 (digest length = key length = 32) 'hmac-sha2-512',// OPTIONAL HMAC-SHA512 (digest length = key length = 64) - // from : - 'umac-64@openssh.com', - 'umac-128@openssh.com', - 'hmac-sha1-96', // RECOMMENDED first 96 bits of HMAC-SHA1 (digest length = 12, key length = 20) 'hmac-sha1', // REQUIRED HMAC-SHA1 (digest length = key length = 20) 'hmac-md5-96', // OPTIONAL first 96 bits of HMAC-MD5 (digest length = 12, key length = 16) 'hmac-md5', // OPTIONAL HMAC-MD5 (digest length = key length = 16) + + 'umac-64-etm@openssh.com', + 'umac-128-etm@openssh.com', + + // from : + 'umac-64@openssh.com', + 'umac-128@openssh.com', + //'none' // OPTIONAL no MAC; NOT RECOMMENDED ]; }