diff --git a/phpseclib/Common/Functions/Objects.php b/phpseclib/Common/Functions/Objects.php index cb87b1a7..607e0181 100644 --- a/phpseclib/Common/Functions/Objects.php +++ b/phpseclib/Common/Functions/Objects.php @@ -45,7 +45,6 @@ abstract class Objects * @param Object $obj * @param string $var * @param mixed $val - * @return mixed * @access public */ public static function setVar($obj, $var, $val) @@ -53,7 +52,7 @@ abstract class Objects $reflection = new \ReflectionClass(get_class($obj)); $prop = $reflection->getProperty($var); $prop->setAccessible(true); - return $prop->setValue($obj, $val); + $prop->setValue($obj, $val); } /** diff --git a/phpseclib/Crypt/Common/Signature/Raw.php b/phpseclib/Crypt/Common/Signature/Raw.php index 46929eba..73aeee8a 100644 --- a/phpseclib/Crypt/Common/Signature/Raw.php +++ b/phpseclib/Crypt/Common/Signature/Raw.php @@ -18,7 +18,6 @@ namespace phpseclib\Crypt\Common\Signature; use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; /** * Raw Signature Handler @@ -33,7 +32,7 @@ abstract class Raw * Loads a signature * * @access public - * @param array $key + * @param array $sig * @return array */ public static function load($sig) @@ -47,8 +46,8 @@ abstract class Raw } return [ - 'r' => $key['r'], - 's' => $key['s'] + 'r' => $sig['r'], + 's' => $sig['s'] ]; } diff --git a/phpseclib/Crypt/DSA/Signature/SSH2.php b/phpseclib/Crypt/DSA/Signature/SSH2.php index 0e781b35..ad78c447 100644 --- a/phpseclib/Crypt/DSA/Signature/SSH2.php +++ b/phpseclib/Crypt/DSA/Signature/SSH2.php @@ -33,8 +33,8 @@ abstract class SSH2 * Loads a signature * * @access public - * @param array $key - * @return array + * @param array $sig + * @return mixed */ public static function load($sig) { @@ -67,9 +67,9 @@ abstract class SSH2 */ public static function save(BigInteger $r, BigInteger $s) { - if ($r->getLength() != 160 || $s->getLength != 160) { + if ($r->getLength() != 160 || $s->getLength() != 160) { return false; } - return Strings::pack('ss', $r, $s); + return Strings::packSSH2('ss', $r, $s); } } diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index bd2c77df..e931267d 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -201,6 +201,15 @@ class RSA extends AsymmetricKey */ private $sLen; + + /** + * Comment + * + * @var string + * @access private + */ + private $comment; + /** * Hash function for the Mask Generation Function * diff --git a/phpseclib/Crypt/TripleDES.php b/phpseclib/Crypt/TripleDES.php index 044c3773..9dede481 100644 --- a/phpseclib/Crypt/TripleDES.php +++ b/phpseclib/Crypt/TripleDES.php @@ -258,6 +258,7 @@ class TripleDES extends DES switch (strlen($key)) { case 16: $key.= substr($key, 0, 8); + break; case 24: break; default: @@ -438,7 +439,6 @@ class TripleDES extends DES * @see \phpseclib\Crypt\Common\SymmetricKey::setPreferredEngine() * @param int $engine * @access public - * @return int */ public function setPreferredEngine($engine) { @@ -448,6 +448,6 @@ class TripleDES extends DES $this->des[2]->setPreferredEngine($engine); } - return parent::setPreferredEngine($engine); + parent::setPreferredEngine($engine); } } diff --git a/phpseclib/Crypt/Twofish.php b/phpseclib/Crypt/Twofish.php index 3c1f6dcb..9193e650 100644 --- a/phpseclib/Crypt/Twofish.php +++ b/phpseclib/Crypt/Twofish.php @@ -402,7 +402,7 @@ class Twofish extends BlockCipher case 256: break; default: - throw new \LengthException('Key of size ' . strlen($key) . ' not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported'); + throw new \LengthException('Key of size ' . $length . ' not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported'); } parent::setKeyLength($length); diff --git a/phpseclib/Net/SSH1.php b/phpseclib/Net/SSH1.php index d5dfe699..27950eee 100644 --- a/phpseclib/Net/SSH1.php +++ b/phpseclib/Net/SSH1.php @@ -547,7 +547,7 @@ class SSH1 { $this->fsock = @fsockopen($this->host, $this->port, $errno, $errstr, $this->connectionTimeout); if (!$this->fsock) { - throw new \RuntimeException(rtrim("Cannot connect to $host. Error $errno. $errstr")); + throw new \RuntimeException(rtrim("Cannot connect to $this->host. Error $errno. $errstr")); } $this->server_identification = $init_line = fgets($this->fsock, 255); @@ -924,7 +924,7 @@ class SSH1 * @throws \RuntimeException on connection error * @access public */ - public function read($expect, $mode = self::READ__SIMPLE) + public function read($expect, $mode = self::READ_SIMPLE) { if (!($this->bitmap & self::MASK_LOGIN)) { throw new \RuntimeException('Operation disallowed prior to login()'); @@ -936,7 +936,7 @@ class SSH1 $match = $expect; while (true) { - if ($mode == self::READ__REGEX) { + if ($mode == self::READ_REGEX) { preg_match($expect, $this->interactiveBuffer, $matches); $match = isset($matches[0]) ? $matches[0] : ''; }