From e73f1ec91092ad46a33823270486d90f3c05d0f6 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 22 Sep 2019 10:19:38 -0500 Subject: [PATCH] fix PHP4 compatibility issue --- phpseclib/Crypt/RSA.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index b77fd449..ac3cf0b9 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -1603,12 +1603,12 @@ class Crypt_RSA &$components['primes'][2] ); - foreach ($values as &$value) { + for ($i = 0; $i < count($values); $i++) { extract(unpack('Nlength', $this->_string_shift($paddedKey, 4))); if (strlen($paddedKey) < $length) { return false; } - $value = new Math_BigInteger($this->_string_shift($paddedKey, $length), -256); + $values[$i] = new Math_BigInteger($this->_string_shift($paddedKey, $length), -256); } extract(unpack('Nlength', $this->_string_shift($paddedKey, 4)));