Merge branch '3.0'

This commit is contained in:
terrafrost 2021-08-15 23:24:52 -05:00
commit 31141fee09
7 changed files with 20 additions and 22 deletions

View File

@ -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)

View File

@ -514,8 +514,6 @@ class BCMath extends Engine
*/
protected function normalize(BCMath $result)
{
unset($result->reduce);
$result->precision = $this->precision;
$result->bitmask = $this->bitmask;

View File

@ -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) {

View File

@ -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;
}
/**

View File

@ -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;
}
/**

View File

@ -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;

View File

@ -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) {