diff --git a/CHANGELOG.md b/CHANGELOG.md index cac16921..649b9cbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 3.0.10 - 2021-08-15 + +- SFTP: don't check SFTP packet size after SFTP initialization (#1606) +- SFTP: timeout during SFTP init should return false (#1684) +- SFTP: return false if get_channel_packet returns false (#1678) +- ASN1: return false when not enough bytes are available (#1676) +- BigInteger: Serializable is being deprecated in PHP 8.1 (#1680) +- explicitly define methods as being static (#1689) +- plug memory leaks (#1672) + ## 3.0.9 - 2021-06-13 - SSH2: add getAuthMethodsToContinue() method (#1648) @@ -85,6 +95,13 @@ - Salsa20 / ChaCha20 - namespace changed from `phpseclib\` to `\phpseclib3` to facilitate phpseclib 2 shim (phpseclib2_compat) +## 2.0.33 - 2021-08-15 + +- SFTP: don't check SFTP packet size after SFTP initialization (#1606) +- SFTP: timeout during SFTP init should return false (#1684) +- SFTP: return false if get_channel_packet returns false (#1678) +- ASN1: return false when not enough bytes are available (#1676) + ## 2.0.32 - 2021-06-13 - SSH2: add getAuthMethodsToContinue() method (#1648) diff --git a/phpseclib/Math/BigInteger/Engines/BCMath.php b/phpseclib/Math/BigInteger/Engines/BCMath.php index b9739243..08273490 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath.php @@ -514,8 +514,6 @@ class BCMath extends Engine */ protected function normalize(BCMath $result) { - unset($result->reduce); - $result->precision = $this->precision; $result->bitmask = $this->bitmask; diff --git a/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php b/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php index 27530ec7..35a3f313 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php @@ -59,11 +59,6 @@ abstract class EvalBarrett extends Base */ protected static function generateCustomReduction(BCMath $m, $class) { - if (isset($n->reduce)) { - self::$custom_reduction = $n->reduce; - return $n->reduce; - } - $m_length = strlen($m); if ($m_length < 5) { diff --git a/phpseclib/Math/BigInteger/Engines/Engine.php b/phpseclib/Math/BigInteger/Engines/Engine.php index 17b1996c..fd9eb828 100644 --- a/phpseclib/Math/BigInteger/Engines/Engine.php +++ b/phpseclib/Math/BigInteger/Engines/Engine.php @@ -1081,20 +1081,18 @@ abstract class Engine static::$modexpEngine; if (method_exists($fqengine, 'generateCustomReduction')) { $func = $fqengine::generateCustomReduction($this, static::class); - $this->reduce = eval('return function(' . static::class . ' $x) use ($func, $class) { + return eval('return function(' . static::class . ' $x) use ($func, $class) { $r = new $class(); $r->value = $func($x->value); return $r; };'); - return clone $this->reduce; } $n = $this->value; - $this->reduce = eval('return function(' . static::class . ' $x) use ($n, $fqengine, $class) { + return eval('return function(' . static::class . ' $x) use ($n, $fqengine, $class) { $r = new $class(); $r->value = $fqengine::reduce($x->value, $n, $class); return $r; };'); - return clone $this->reduce; } /** diff --git a/phpseclib/Math/BigInteger/Engines/GMP.php b/phpseclib/Math/BigInteger/Engines/GMP.php index 2cbc9cbe..74272da8 100644 --- a/phpseclib/Math/BigInteger/Engines/GMP.php +++ b/phpseclib/Math/BigInteger/Engines/GMP.php @@ -512,8 +512,6 @@ class GMP extends Engine */ protected function normalize(GMP $result) { - unset($result->reduce); - $result->precision = $this->precision; $result->bitmask = $this->bitmask; @@ -683,10 +681,9 @@ class GMP extends Engine public function createRecurringModuloFunction() { $temp = $this->value; - $this->reduce = function(GMP $x) use ($temp) { + return function(GMP $x) use ($temp) { return new GMP($x->value % $temp); }; - return $this->reduce; } /** diff --git a/phpseclib/Math/BigInteger/Engines/PHP.php b/phpseclib/Math/BigInteger/Engines/PHP.php index 5f94e68b..63705f9f 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP.php +++ b/phpseclib/Math/BigInteger/Engines/PHP.php @@ -731,8 +731,6 @@ abstract class PHP extends Engine */ protected function normalize(PHP $result) { - unset($result->reduce); - $result->precision = $this->precision; $result->bitmask = $this->bitmask; diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php index 7c81071d..c9f82c70 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php @@ -60,11 +60,6 @@ abstract class EvalBarrett extends Base */ protected static function generateCustomReduction(PHP $m, $class) { - if (isset($n->reduce)) { - self::$custom_reduction = $n->reduce; - return $n->reduce; - } - $m_length = count($m->value); if ($m_length < 5) {