diff --git a/.gitignore b/.gitignore index 1469fe60..1447b413 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /vendor /composer.phar +/.idea/ +.gitignore diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index e2f98817..d63d71fb 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -572,7 +572,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 */ @@ -618,7 +618,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 */ @@ -682,7 +682,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 */ @@ -722,7 +722,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 */ @@ -764,7 +764,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 */ @@ -793,7 +793,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 */ @@ -1053,6 +1053,7 @@ class X509 * * @param int $date optional * @access public + * @return boolean */ public function validateDate($date = null) { @@ -2051,7 +2052,7 @@ class X509 * * https://developer.mozilla.org/en-US/docs/HTML/Element/keygen * - * @param string $csr + * @param string $spkac * @access public * @return mixed */ @@ -2119,7 +2120,7 @@ class X509 /** * Save a SPKAC CSR request * - * @param array $csr + * @param array $spkac * @param int $format optional * @access public * @return string @@ -2808,7 +2809,7 @@ class X509 * Set Serial Number * * @param string $serial - * @param $base optional + * @param $base integer Optional * @access public */ public function setSerialNumber($serial, $base = -256) diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index fb19731e..677b2ff2 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -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 */ diff --git a/phpseclib/Math/BigInteger/Engines/BCMath.php b/phpseclib/Math/BigInteger/Engines/BCMath.php index fee7b212..3d2ab07d 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath.php @@ -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) { diff --git a/phpseclib/Math/BigInteger/Engines/Engine.php b/phpseclib/Math/BigInteger/Engines/Engine.php index 9f3dc497..5d2dcaa8 100644 --- a/phpseclib/Math/BigInteger/Engines/Engine.php +++ b/phpseclib/Math/BigInteger/Engines/Engine.php @@ -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 */ diff --git a/phpseclib/Math/BigInteger/Engines/GMP.php b/phpseclib/Math/BigInteger/Engines/GMP.php index 9a406a27..9f13f254 100644 --- a/phpseclib/Math/BigInteger/Engines/GMP.php +++ b/phpseclib/Math/BigInteger/Engines/GMP.php @@ -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) { diff --git a/phpseclib/Math/BigInteger/Engines/PHP.php b/phpseclib/Math/BigInteger/Engines/PHP.php index bee28778..3ea67453 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP.php +++ b/phpseclib/Math/BigInteger/Engines/PHP.php @@ -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}. */ diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Montgomery.php b/phpseclib/Math/BigInteger/Engines/PHP/Montgomery.php index cdbf23a1..e388e6b2 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Montgomery.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Montgomery.php @@ -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) { diff --git a/phpseclib/Math/BigInteger/Engines/PHP32.php b/phpseclib/Math/BigInteger/Engines/PHP32.php index b205a9c1..17e77a2b 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP32.php +++ b/phpseclib/Math/BigInteger/Engines/PHP32.php @@ -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) { diff --git a/phpseclib/Math/BigInteger/Engines/PHP64.php b/phpseclib/Math/BigInteger/Engines/PHP64.php index c3f7e84d..6c617100 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP64.php +++ b/phpseclib/Math/BigInteger/Engines/PHP64.php @@ -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) { diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 63496e69..338b1b79 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -3084,7 +3084,7 @@ class SFTP extends SSH2 * * @param int $reason * @return bool - * @access private + * @access protected */ protected function disconnect_helper($reason) { diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 332b324b..e1e2f48d 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -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; @@ -3827,7 +3827,7 @@ class SSH2 * * @param int $reason * @return bool - * @access private + * @access protected */ protected function disconnect_helper($reason) { @@ -3848,7 +3848,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() { diff --git a/phpseclib/System/SSH/Agent.php b/phpseclib/System/SSH/Agent.php index 29182d10..64966716 100644 --- a/phpseclib/System/SSH/Agent.php +++ b/phpseclib/System/SSH/Agent.php @@ -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 */ diff --git a/tests/Unit/Crypt/BlowfishTest.php b/tests/Unit/Crypt/BlowfishTest.php index 95a182be..773173cf 100644 --- a/tests/Unit/Crypt/BlowfishTest.php +++ b/tests/Unit/Crypt/BlowfishTest.php @@ -77,7 +77,15 @@ 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)) { + + $engines = array( + 'PHP'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_INTERNAL, + 'Eval'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_EVAL, + 'mcrypt'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_MCRYPT, + 'OpenSSL'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_OPENSSL, + ); + + if (!$bf->isValidEngine($engines[$engine])) { self::markTestSkipped("Unable to initialize $engine engine"); } $bf->setPreferredEngine($engine);