Merge remote-tracking branch 'rrran/Bugfixes2'

This commit is contained in:
terrafrost 2017-09-30 22:50:06 +01:00
commit 4f2ece4d7d
15 changed files with 42 additions and 36 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
/vendor
/composer.phar
/.idea/
.gitignore

View File

@ -573,7 +573,7 @@ class X509
* Map extension values from octet string to extension-specific internal
* format.
*
* @param array ref $root
* @param &array $root
* @param string $path
* @access private
*/
@ -619,7 +619,7 @@ class X509
* Map extension values from extension-specific internal format to
* octet string.
*
* @param array ref $root
* @param &array Ref $root
* @param string $path
* @access private
*/
@ -683,7 +683,7 @@ class X509
* Map attribute values from ANY type to attribute-specific internal
* format.
*
* @param array ref $root
* @param &array Ref $root
* @param string $path
* @access private
*/
@ -723,7 +723,7 @@ class X509
* Map attribute values from attribute-specific internal format to
* ANY type.
*
* @param array ref $root
* @param &array $root Ref
* @param string $path
* @access private
*/
@ -765,7 +765,7 @@ class X509
* Map DN values from ANY type to DN-specific internal
* format.
*
* @param array ref $root
* @param &array $root
* @param string $path
* @access private
*/
@ -794,7 +794,7 @@ class X509
* Map DN values from DN-specific internal format to
* ANY type.
*
* @param array ref $root
* @param &array $root
* @param string $path
* @access private
*/
@ -1054,6 +1054,7 @@ class X509
*
* @param int $date optional
* @access public
* @return boolean
*/
public function validateDate($date = null)
{
@ -2052,7 +2053,7 @@ class X509
*
* https://developer.mozilla.org/en-US/docs/HTML/Element/keygen
*
* @param string $csr
* @param string $spkac
* @access public
* @return mixed
*/
@ -2120,7 +2121,7 @@ class X509
/**
* Save a SPKAC CSR request
*
* @param array $csr
* @param array $spkac
* @param int $format optional
* @access public
* @return string
@ -2287,7 +2288,7 @@ class X509
*
* @param string $date in format date('D, d M Y H:i:s O')
* @access private
* @return array
* @return array|Element
*/
private function timeField($date)
{
@ -2792,7 +2793,8 @@ class X509
$date = new DateTime($date);
}
$this->startDate = $date->format('D, d M Y H:i:s O', new DateTimeZone(@date_default_timezone_get()));
$date->setTimezone(new DateTimeZone(@date_default_timezone_get()));
$this->startDate = $date->format('D, d M Y H:i:s O');
}
/**
@ -2819,7 +2821,8 @@ class X509
$date = new DateTime($date);
}
$this->endDate = $date->format('D, d M Y H:i:s O', new DateTimeZone(@date_default_timezone_get()));
$date->setTimezone(new DateTimeZone(@date_default_timezone_get()));
$this->endDate = $date->format('D, d M Y H:i:s O');
}
}
@ -2827,7 +2830,7 @@ class X509
* Set Serial Number
*
* @param string $serial
* @param $base optional
* @param $base integer Optional
* @access public
*/
public function setSerialNumber($serial, $base = -256)
@ -3429,7 +3432,7 @@ class X509
}
return false;
default: // Should be a key object (i.e.: \phpseclib\Crypt\RSA).
$key = $key->getPublicKey('PKCS1');
$key = $key->getPublicKey();
break;
}

View File

@ -120,7 +120,7 @@ class BigInteger implements \Serializable
* If the second parameter - $base - is negative, then it will be assumed that the number's are encoded using
* two's compliment. The sole exception to this is -10, which is treated the same as 10 is.
*
* @param $x base-10 number or base-$base number if $base set.
* @param $x integer|BigInteger\Engines\Engine Base-10 number or base-$base number if $base set.
* @param int $base
* @return \phpseclib\Math\BigInteger
*/

View File

@ -100,7 +100,7 @@ class BCMath extends Engine
/**
* Default constructor
*
* @param $x base-10 number or base-$base number if $base set.
* @param $x integer Base-10 number or base-$base number if $base set.
* @param int $base
* @see parent::__construct()
* @return \phpseclib\Math\BigInteger\Engines\BCMath
@ -549,7 +549,7 @@ class BCMath extends Engine
* BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min)
*
* @return \phpseclib\Math\BigInteger\Engines\Engine\BCMath
* @return \phpseclib\Math\BigInteger\Engines\BCMath
*/
public static function randomRange(BCMath $min, BCMath $max)
{

View File

@ -59,7 +59,7 @@ abstract class Engine implements \Serializable
/**
* Default constructor
*
* @param $x base-10 number or base-$base number if $base set.
* @param $x integer Base-10 number or base-$base number if $base set.
* @param int $base
* @return \phpseclib\Math\BigInteger\Engines\Engine
*/

View File

@ -102,7 +102,7 @@ class GMP extends Engine
/**
* Default constructor
*
* @param $x base-10 number or base-$base number if $base set.
* @param $x integer Base-10 number or base-$base number if $base set.
* @param int $base
* @see parent::__construct()
* @return \phpseclib\Math\BigInteger\Engines\GMP
@ -511,7 +511,7 @@ class GMP extends Engine
* BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min)
*
* @return \phpseclib\Math\BigInteger\Engines\Engine\GMP
* @return \phpseclib\Math\BigInteger\Engines\GMP
*/
public static function randomRange(GMP $min, GMP $max)
{

View File

@ -74,7 +74,7 @@ abstract class PHP extends Engine
/**
* Default constructor
*
* @param $x base-10 number or base-$base number if $base set.
* @param $x integer Base-10 number or base-$base number if $base set.
* @param int $base
* @see parent::__construct()
* @return \phpseclib\Math\BigInteger\Engines\PHP
@ -524,7 +524,7 @@ abstract class PHP extends Engine
* same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder
* and the divisor (basically, the "common residue" is the first positive modulo).
*
* @param \phpseclib\Math\BigInteger\PHP $y
* @param \phpseclib\Math\BigInteger\engines\PHP $y
* @return array
* @internal This function is based off of {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=9 HAC 14.20}.
*/

View File

@ -42,11 +42,11 @@ abstract class Montgomery extends Base
/**
* Performs modular exponentiation.
*
* @param \phpseclib\Math\BigInteger\Engine $x
* @param \phpseclib\Math\BigInteger\Engine $e
* @param \phpseclib\Math\BigInteger\Engine $n
* @param \phpseclib\Math\BigInteger\Engines\Engine $x
* @param \phpseclib\Math\BigInteger\Engines\Engine $e
* @param \phpseclib\Math\BigInteger\Engines\Engine $n
* @param string $class
* @return \phpseclib\Math\BigInteger\Engine|Engine
* @return \phpseclib\Math\BigInteger\Engines\Engine
*/
protected static function slidingWindow(Engine $x, Engine $e, Engine $n, $class)
{

View File

@ -294,7 +294,7 @@ class PHP32 extends PHP
* BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min)
*
* @return \phpseclib\Math\BigInteger\Engines\Engine\PHP32
* @return \phpseclib\Math\BigInteger\Engines\PHP32
*/
public static function randomRange(PHP32 $min, PHP32 $max)
{

View File

@ -294,7 +294,7 @@ class PHP64 extends PHP
* BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min)
*
* @return \phpseclib\Math\BigInteger\Engines\Engine\PHP64
* @return \phpseclib\Math\BigInteger\Engines\PHP64
*/
public static function randomRange(PHP64 $min, PHP64 $max)
{

View File

@ -3084,7 +3084,7 @@ class SFTP extends SSH2
*
* @param int $reason
* @return bool
* @access private
* @access protected
*/
protected function disconnect_helper($reason)
{

View File

@ -868,7 +868,7 @@ class SSH2
/**
* A System_SSH_Agent for use in the SSH2 Agent Forwarding scenario
*
* @var System_SSH_Agent
* @var \phpseclib\System\Ssh\Agent
* @access private
*/
private $agent;
@ -4031,7 +4031,7 @@ class SSH2
*
* @param int $reason
* @return bool
* @access private
* @access protected
*/
protected function disconnect_helper($reason)
{
@ -4052,7 +4052,7 @@ class SSH2
* If any of the constants that would be defined already exists, none of the constants will be defined.
*
* @param array $array
* @access private
* @access protected
*/
protected function define_array()
{

View File

@ -219,7 +219,7 @@ class Agent
* Signal that agent forwarding should
* be requested when a channel is opened
*
* @param Net_SSH2 $ssh
* @param \phpseclib\Net\SSH2 $ssh
* @return bool
* @access public
*/
@ -233,7 +233,7 @@ class Agent
/**
* Request agent forwarding of remote server
*
* @param Net_SSH2 $ssh
* @param \phpseclib\Net\SSH2 $ssh
* @return bool
* @access private
*/
@ -276,7 +276,7 @@ class Agent
* open to give the SSH Agent an opportunity
* to take further action. i.e. request agent forwarding
*
* @param Net_SSH2 $ssh
* @param \phpseclib\Net\SSH2 $ssh
* @access private
*/
private function on_channel_open($ssh)
@ -290,7 +290,7 @@ class Agent
* Forward data to SSH Agent and return data reply
*
* @param string $data
* @return data from SSH Agent
* @return string Data from SSH Agent
* @throws \RuntimeException on connection errors
* @access private
*/

View File

@ -77,6 +77,7 @@ class Unit_Crypt_BlowfishTest extends PhpseclibTestCase
$bf = new Blowfish('cbc');
$bf->setKey($key);
$bf->setIV(str_repeat("\0", $bf->getBlockLength() >> 3));
if (!$bf->isValidEngine($engine)) {
self::markTestSkipped("Unable to initialize $engine engine");
}

View File

@ -29,7 +29,7 @@ class Unit_Crypt_TwofishTest extends PhpseclibTestCase
$key = pack('H*', '00000000000000000000000000000000');
$tf->setKey($key);
if (!$tf->isValidEngine($engine)) {
self::markTestSkipped('Unable to initialize $engine engine');
self::markTestSkipped("Unable to initialize $engine engine");
}
$plaintext = pack('H*', '00000000000000000000000000000000');