From 16abd1508998440d0bca7fa378e92a8641f839c8 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 23 Mar 2019 21:41:52 -0500 Subject: [PATCH] SSH2: micro-optimization for AES-GCM --- phpseclib/Net/SSH2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index f475b6c0..ce211769 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -4120,7 +4120,7 @@ class SSH2 $this->encrypt->invocation_counter ); Strings::increment_str($this->encrypt->invocation_counter); - $this->encrypt->setAAD($temp = substr($packet, 0, 4)); + $this->encrypt->setAAD($temp = ($packet & "\xFF\xFF\xFF\xFF")); $packet = $temp . $this->encrypt->encrypt(substr($packet, 4)); } }