mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-05 05:18:28 +00:00
Merge pull request #732 from bantu/PSR2-1.0
[1.0] Code Sniffer: Switch from PEAR with exceptions to PSR2 with exceptions * bantu/PSR2-1.0: Fix indentation phpcbf did not fix. Remove PSR2.Methods.FunctionCallSignature.SpaceAfterOpenBracket exception. Use phpcbf to fix PHP code to ruleset. Ignore coding guidelines in ANSI switch block. Base code sniffer ruleset on PSR2 rather than PEAR. Update PHP Code Sniffer to 2.3.3
This commit is contained in:
commit
e251f6c372
@ -6,16 +6,6 @@
|
||||
<!-- In general rules that apply to library code also apply to tests. -->
|
||||
<rule ref="./code-sniffer-ruleset.xml">
|
||||
<!-- Exceptions to the library coding standard follow. -->
|
||||
|
||||
<!-- We do not care too much about method, class and file documentation,
|
||||
but having @author, @copyright and @license tags would be nice.
|
||||
The following configuration does not check for these tags, but
|
||||
complains if the file doc block is missing completely. -->
|
||||
<exclude name="PEAR.Commenting.ClassComment" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment" />
|
||||
<exclude name="PEAR.Commenting.FileComment.MissingTag" />
|
||||
<exclude name="PEAR.Commenting.FileComment.MissingVersion" />
|
||||
<exclude name="PEAR.Commenting.FileComment.SpacingBeforeTags" />
|
||||
</rule>
|
||||
|
||||
</ruleset>
|
||||
|
@ -3,35 +3,29 @@
|
||||
|
||||
<description>phpseclib coding standard</description>
|
||||
|
||||
<!-- We are using the PEAR standard as a base -->
|
||||
<rule ref="PEAR">
|
||||
<!-- Temporary exceptions to the PEAR standard follow -->
|
||||
<exclude name="Generic.ControlStructures.InlineControlStructure.Discouraged" />
|
||||
<!-- We are using the PSR2 standard as a base -->
|
||||
<rule ref="PSR2">
|
||||
<!-- Exceptions for PHP4 compatibility -->
|
||||
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
|
||||
<exclude name="PSR2.Classes.PropertyDeclaration.ScopeMissing" />
|
||||
<exclude name="PSR2.Classes.PropertyDeclaration.VarUsed" />
|
||||
<exclude name="Squiz.Scope.MethodScope.Missing" />
|
||||
|
||||
<!-- Exceptions for backward compatibility -->
|
||||
<exclude name="PSR1.Classes.ClassDeclaration.MultipleClasses" />
|
||||
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
|
||||
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
|
||||
<exclude name="PSR2.Methods.MethodDeclaration.Underscore" />
|
||||
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
|
||||
|
||||
<!-- Exceptions for whitespacing -->
|
||||
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma" />
|
||||
<exclude name="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonCASE" />
|
||||
<exclude name="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonDEFAULT" />
|
||||
|
||||
<!-- Other Exceptions -->
|
||||
<exclude name="Generic.Files.LineLength.TooLong" />
|
||||
<exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital" />
|
||||
<exclude name="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps" />
|
||||
<exclude name="PEAR.Commenting.ClassComment.InvalidVersion" />
|
||||
<exclude name="PEAR.Commenting.ClassComment.MissingTag" />
|
||||
<exclude name="PEAR.Commenting.FileComment.EmptyCopyright" />
|
||||
<exclude name="PEAR.Commenting.FileComment.InvalidVersion" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.ExtraParamComment" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.MissingReturn" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.MissingParamComment" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.MissingParamName" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.MissingParamTag" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.ParameterCommentsNotAligned" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.ParameterNamesNotAligned" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.ParamNameNoMatch" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.SpacingAfterParams" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.SpacingBeforeParams" />
|
||||
<exclude name="PEAR.Commenting.FunctionComment.SpacingBeforeTags" />
|
||||
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
|
||||
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
|
||||
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket" />
|
||||
<exclude name="PEAR.WhiteSpace.ScopeClosingBrace.BreakIdent" />
|
||||
<exclude name="PEAR.WhiteSpace.ScopeClosingBrace.Indent" />
|
||||
<exclude name="PEAR.WhiteSpace.ScopeClosingBrace.Line" />
|
||||
<exclude name="PEAR.WhiteSpace.ScopeIndent.Incorrect" />
|
||||
<exclude name="PSR2.ControlStructures.SwitchDeclaration.TerminatingComment" />
|
||||
</rule>
|
||||
|
||||
<!-- Useful additional rules follow -->
|
||||
@ -42,34 +36,4 @@
|
||||
<!-- A method MUST not only call its parent -->
|
||||
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
|
||||
|
||||
<!-- All code files MUST use only UTF-8 without BOM. -->
|
||||
<rule ref="Generic.Files.ByteOrderMark" />
|
||||
|
||||
<!-- Each file MUST end with exactly one newline character -->
|
||||
<rule ref="PSR2.Files.EndFileNewline" />
|
||||
|
||||
<!-- In the argument list, there MUST NOT be a space before each comma,
|
||||
and there MUST be one space after each comma. -->
|
||||
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
|
||||
<properties>
|
||||
<property name="equalsSpacing" value="1"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" />
|
||||
|
||||
<!-- There MUST NOT be trailing whitespace at the end of lines. -->
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
|
||||
|
||||
<!-- There MUST NOT be whitespace before the first content of a file -->
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
|
||||
|
||||
<!-- There MUST NOT be whitespace after the last content of a file -->
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
|
||||
|
||||
<!-- Functions MUST NOT contain multiple empty lines in a row -->
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
|
||||
|
||||
<!-- The ?> closing tag MUST be omitted from files containing only PHP. -->
|
||||
<rule ref="Zend.Files.ClosingTag" />
|
||||
|
||||
</ruleset>
|
||||
|
@ -52,7 +52,7 @@
|
||||
"phing/phing": "~2.7",
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"sami/sami": "~2.0",
|
||||
"squizlabs/php_codesniffer": "~1.5"
|
||||
"squizlabs/php_codesniffer": "~2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a wide variety of cryptographic operations.",
|
||||
|
27
composer.lock
generated
27
composer.lock
generated
@ -1,10 +1,10 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "c3ab2e2443c6993fa0d240a3db7f6545",
|
||||
"hash": "a6903cc16470e835846865fb57ea29f9",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
@ -1201,32 +1201,31 @@
|
||||
},
|
||||
{
|
||||
"name": "squizlabs/php_codesniffer",
|
||||
"version": "1.5.6",
|
||||
"version": "2.3.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
||||
"reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5"
|
||||
"reference": "c1a26c729508f73560c1a4f767f60b8ab6b4a666"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6f3e42d311b882b25b4d409d23a289f4d3b803d5",
|
||||
"reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5",
|
||||
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/c1a26c729508f73560c1a4f767f60b8ab6b4a666",
|
||||
"reference": "c1a26c729508f73560c1a4f767f60b8ab6b4a666",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-tokenizer": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"php": ">=5.1.2"
|
||||
},
|
||||
"suggest": {
|
||||
"phpunit/php-timer": "dev-master"
|
||||
},
|
||||
"bin": [
|
||||
"scripts/phpcs"
|
||||
"scripts/phpcs",
|
||||
"scripts/phpcbf"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-phpcs-fixer": "2.0.x-dev"
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -1235,12 +1234,12 @@
|
||||
"CodeSniffer/CLI.php",
|
||||
"CodeSniffer/Exception.php",
|
||||
"CodeSniffer/File.php",
|
||||
"CodeSniffer/Fixer.php",
|
||||
"CodeSniffer/Report.php",
|
||||
"CodeSniffer/Reporting.php",
|
||||
"CodeSniffer/Sniff.php",
|
||||
"CodeSniffer/Tokens.php",
|
||||
"CodeSniffer/Reports/",
|
||||
"CodeSniffer/CommentParser/",
|
||||
"CodeSniffer/Tokenizers/",
|
||||
"CodeSniffer/DocGenerators/",
|
||||
"CodeSniffer/Standards/AbstractPatternSniff.php",
|
||||
@ -1266,13 +1265,13 @@
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
|
||||
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
|
||||
"homepage": "http://www.squizlabs.com/php-codesniffer",
|
||||
"keywords": [
|
||||
"phpcs",
|
||||
"standards"
|
||||
],
|
||||
"time": "2014-12-04 22:32:15"
|
||||
"time": "2015-06-24 03:16:23"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
|
@ -1449,7 +1449,6 @@ class Crypt_DES extends Crypt_Base
|
||||
// Creating code for en- and decryption.
|
||||
$crypt_block = array();
|
||||
foreach (array(CRYPT_DES_ENCRYPT, CRYPT_DES_DECRYPT) as $c) {
|
||||
|
||||
/* Do the initial IP permutation. */
|
||||
$crypt_block[$c] = '
|
||||
$in = unpack("N*", $in);
|
||||
|
@ -511,12 +511,14 @@ class Crypt_Hash
|
||||
|
||||
// Extend the sixteen 32-bit words into sixty-four 32-bit words
|
||||
for ($i = 16; $i < 64; $i++) {
|
||||
// @codingStandardsIgnoreStart
|
||||
$s0 = $this->_rightRotate($w[$i - 15], 7) ^
|
||||
$this->_rightRotate($w[$i - 15], 18) ^
|
||||
$this->_rightShift( $w[$i - 15], 3);
|
||||
$s1 = $this->_rightRotate($w[$i - 2], 17) ^
|
||||
$this->_rightRotate($w[$i - 2], 19) ^
|
||||
$this->_rightShift( $w[$i - 2], 10);
|
||||
// @codingStandardsIgnoreEnd
|
||||
$w[$i] = $this->_add($w[$i - 16], $s0, $w[$i - 7], $s1);
|
||||
|
||||
}
|
||||
|
@ -606,7 +606,8 @@ class Crypt_RSA
|
||||
$publickey = call_user_func_array(array($this, '_convertPublicKey'), array_values($this->_parseKey($publickey, CRYPT_RSA_PUBLIC_FORMAT_PKCS1)));
|
||||
|
||||
// clear the buffer of error strings stemming from a minimalistic openssl.cnf
|
||||
while (openssl_error_string() !== false);
|
||||
while (openssl_error_string() !== false) {
|
||||
}
|
||||
|
||||
return array(
|
||||
'privatekey' => $privatekey,
|
||||
@ -796,19 +797,39 @@ class Crypt_RSA
|
||||
$encryption = (!empty($this->password) || is_string($this->password)) ? 'aes256-cbc' : 'none';
|
||||
$key.= $encryption;
|
||||
$key.= "\r\nComment: " . $this->comment . "\r\n";
|
||||
$public = pack('Na*Na*Na*',
|
||||
strlen('ssh-rsa'), 'ssh-rsa', strlen($raw['publicExponent']), $raw['publicExponent'], strlen($raw['modulus']), $raw['modulus']
|
||||
$public = pack(
|
||||
'Na*Na*Na*',
|
||||
strlen('ssh-rsa'),
|
||||
'ssh-rsa',
|
||||
strlen($raw['publicExponent']),
|
||||
$raw['publicExponent'],
|
||||
strlen($raw['modulus']),
|
||||
$raw['modulus']
|
||||
);
|
||||
$source = pack('Na*Na*Na*Na*',
|
||||
strlen('ssh-rsa'), 'ssh-rsa', strlen($encryption), $encryption,
|
||||
strlen($this->comment), $this->comment, strlen($public), $public
|
||||
$source = pack(
|
||||
'Na*Na*Na*Na*',
|
||||
strlen('ssh-rsa'),
|
||||
'ssh-rsa',
|
||||
strlen($encryption),
|
||||
$encryption,
|
||||
strlen($this->comment),
|
||||
$this->comment,
|
||||
strlen($public),
|
||||
$public
|
||||
);
|
||||
$public = base64_encode($public);
|
||||
$key.= "Public-Lines: " . ((strlen($public) + 63) >> 6) . "\r\n";
|
||||
$key.= chunk_split($public, 64);
|
||||
$private = pack('Na*Na*Na*Na*',
|
||||
strlen($raw['privateExponent']), $raw['privateExponent'], strlen($raw['prime1']), $raw['prime1'],
|
||||
strlen($raw['prime2']), $raw['prime2'], strlen($raw['coefficient']), $raw['coefficient']
|
||||
$private = pack(
|
||||
'Na*Na*Na*Na*',
|
||||
strlen($raw['privateExponent']),
|
||||
$raw['privateExponent'],
|
||||
strlen($raw['prime1']),
|
||||
$raw['prime1'],
|
||||
strlen($raw['prime2']),
|
||||
$raw['prime2'],
|
||||
strlen($raw['coefficient']),
|
||||
$raw['coefficient']
|
||||
);
|
||||
if (empty($this->password) && !is_string($this->password)) {
|
||||
$source.= pack('Na*', strlen($private), $private);
|
||||
@ -875,8 +896,14 @@ class Crypt_RSA
|
||||
|
||||
if ($this->privateKeyFormat == CRYPT_RSA_PRIVATE_FORMAT_PKCS8) {
|
||||
$rsaOID = pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA
|
||||
$RSAPrivateKey = pack('Ca*a*Ca*a*',
|
||||
CRYPT_RSA_ASN1_INTEGER, "\01\00", $rsaOID, 4, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey
|
||||
$RSAPrivateKey = pack(
|
||||
'Ca*a*Ca*a*',
|
||||
CRYPT_RSA_ASN1_INTEGER,
|
||||
"\01\00",
|
||||
$rsaOID,
|
||||
4,
|
||||
$this->_encodeLength(strlen($RSAPrivateKey)),
|
||||
$RSAPrivateKey
|
||||
);
|
||||
$RSAPrivateKey = pack('Ca*a*', CRYPT_RSA_ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey);
|
||||
if (!empty($this->password) || is_string($this->password)) {
|
||||
@ -890,20 +917,35 @@ class Crypt_RSA
|
||||
$crypto->setPassword($this->password, 'pbkdf1', 'md5', $salt, $iterationCount);
|
||||
$RSAPrivateKey = $crypto->encrypt($RSAPrivateKey);
|
||||
|
||||
$parameters = pack('Ca*a*Ca*N',
|
||||
CRYPT_RSA_ASN1_OCTETSTRING, $this->_encodeLength(strlen($salt)), $salt,
|
||||
CRYPT_RSA_ASN1_INTEGER, $this->_encodeLength(4), $iterationCount
|
||||
$parameters = pack(
|
||||
'Ca*a*Ca*N',
|
||||
CRYPT_RSA_ASN1_OCTETSTRING,
|
||||
$this->_encodeLength(strlen($salt)),
|
||||
$salt,
|
||||
CRYPT_RSA_ASN1_INTEGER,
|
||||
$this->_encodeLength(4),
|
||||
$iterationCount
|
||||
);
|
||||
$pbeWithMD5AndDES_CBC = "\x2a\x86\x48\x86\xf7\x0d\x01\x05\x03";
|
||||
|
||||
$encryptionAlgorithm = pack('Ca*a*Ca*a*',
|
||||
CRYPT_RSA_ASN1_OBJECT, $this->_encodeLength(strlen($pbeWithMD5AndDES_CBC)), $pbeWithMD5AndDES_CBC,
|
||||
CRYPT_RSA_ASN1_SEQUENCE, $this->_encodeLength(strlen($parameters)), $parameters
|
||||
$encryptionAlgorithm = pack(
|
||||
'Ca*a*Ca*a*',
|
||||
CRYPT_RSA_ASN1_OBJECT,
|
||||
$this->_encodeLength(strlen($pbeWithMD5AndDES_CBC)),
|
||||
$pbeWithMD5AndDES_CBC,
|
||||
CRYPT_RSA_ASN1_SEQUENCE,
|
||||
$this->_encodeLength(strlen($parameters)),
|
||||
$parameters
|
||||
);
|
||||
|
||||
$RSAPrivateKey = pack('Ca*a*Ca*a*',
|
||||
CRYPT_RSA_ASN1_SEQUENCE, $this->_encodeLength(strlen($encryptionAlgorithm)), $encryptionAlgorithm,
|
||||
CRYPT_RSA_ASN1_OCTETSTRING, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey
|
||||
$RSAPrivateKey = pack(
|
||||
'Ca*a*Ca*a*',
|
||||
CRYPT_RSA_ASN1_SEQUENCE,
|
||||
$this->_encodeLength(strlen($encryptionAlgorithm)),
|
||||
$encryptionAlgorithm,
|
||||
CRYPT_RSA_ASN1_OCTETSTRING,
|
||||
$this->_encodeLength(strlen($RSAPrivateKey)),
|
||||
$RSAPrivateKey
|
||||
);
|
||||
|
||||
$RSAPrivateKey = pack('Ca*a*', CRYPT_RSA_ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey);
|
||||
@ -990,9 +1032,12 @@ class Crypt_RSA
|
||||
'publicExponent' => pack('Ca*a*', CRYPT_RSA_ASN1_INTEGER, $this->_encodeLength(strlen($publicExponent)), $publicExponent)
|
||||
);
|
||||
|
||||
$RSAPublicKey = pack('Ca*a*a*',
|
||||
CRYPT_RSA_ASN1_SEQUENCE, $this->_encodeLength(strlen($components['modulus']) + strlen($components['publicExponent'])),
|
||||
$components['modulus'], $components['publicExponent']
|
||||
$RSAPublicKey = pack(
|
||||
'Ca*a*a*',
|
||||
CRYPT_RSA_ASN1_SEQUENCE,
|
||||
$this->_encodeLength(strlen($components['modulus']) + strlen($components['publicExponent'])),
|
||||
$components['modulus'],
|
||||
$components['publicExponent']
|
||||
);
|
||||
|
||||
if ($this->publicKeyFormat == CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW) {
|
||||
@ -1005,8 +1050,11 @@ class Crypt_RSA
|
||||
$RSAPublicKey = chr(0) . $RSAPublicKey;
|
||||
$RSAPublicKey = chr(3) . $this->_encodeLength(strlen($RSAPublicKey)) . $RSAPublicKey;
|
||||
|
||||
$RSAPublicKey = pack('Ca*a*',
|
||||
CRYPT_RSA_ASN1_SEQUENCE, $this->_encodeLength(strlen($rsaOID . $RSAPublicKey)), $rsaOID . $RSAPublicKey
|
||||
$RSAPublicKey = pack(
|
||||
'Ca*a*',
|
||||
CRYPT_RSA_ASN1_SEQUENCE,
|
||||
$this->_encodeLength(strlen($rsaOID . $RSAPublicKey)),
|
||||
$rsaOID . $RSAPublicKey
|
||||
);
|
||||
|
||||
$RSAPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" .
|
||||
@ -1801,8 +1849,7 @@ class Crypt_RSA
|
||||
|
||||
$RSAPublicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($publicExponent), $publicExponent, strlen($modulus), $modulus);
|
||||
|
||||
switch($algorithm)
|
||||
{
|
||||
switch ($algorithm) {
|
||||
case 'sha256':
|
||||
$hash = new Crypt_Hash('sha256');
|
||||
$base = base64_encode($hash->hash($RSAPublicKey));
|
||||
|
@ -604,7 +604,9 @@ class Crypt_Twofish extends Crypt_Base
|
||||
$u^= 0x7fffffff & ($t >> 1);
|
||||
|
||||
// Add the modular polynomial on underflow.
|
||||
if ($t & 0x01) $u^= 0xa6 ;
|
||||
if ($t & 0x01) {
|
||||
$u^= 0xa6 ;
|
||||
}
|
||||
|
||||
// Remove t * (a + 1/a) * (x^3 + x).
|
||||
$B^= ($u << 24) | ($u << 8);
|
||||
|
@ -353,6 +353,7 @@ class File_ANSI
|
||||
//$back = $attr_cell->reverse ? &$attr_cell->foreground : &$attr_cell->background;
|
||||
$back = &$attr_cell->{ $attr_cell->reverse ? 'foreground' : 'background' };
|
||||
switch ($mod) {
|
||||
// @codingStandardsIgnoreStart
|
||||
case 30: $front = 'black'; break;
|
||||
case 31: $front = 'red'; break;
|
||||
case 32: $front = 'green'; break;
|
||||
@ -370,6 +371,7 @@ class File_ANSI
|
||||
case 45: $back = 'magenta'; break;
|
||||
case 46: $back = 'cyan'; break;
|
||||
case 47: $back = 'white'; break;
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
default:
|
||||
//user_error('Unsupported attribute: ' . $mod);
|
||||
|
@ -3329,8 +3329,7 @@ class File_X509
|
||||
// )
|
||||
//),
|
||||
'keyIdentifier' => $issuer->currentKeyIdentifier
|
||||
)
|
||||
);
|
||||
));
|
||||
//$extensions = &$this->currentCert['tbsCertificate']['extensions'];
|
||||
//if (isset($issuer->serialNumber)) {
|
||||
// $extensions[count($extensions) - 1]['authorityCertSerialNumber'] = $issuer->serialNumber;
|
||||
@ -3373,7 +3372,8 @@ class File_X509
|
||||
$keyUsage = array();
|
||||
}
|
||||
|
||||
$this->setExtension('id-ce-keyUsage',
|
||||
$this->setExtension(
|
||||
'id-ce-keyUsage',
|
||||
array_values(array_unique(array_merge($keyUsage, array('cRLSign', 'keyCertSign'))))
|
||||
);
|
||||
|
||||
@ -3382,8 +3382,11 @@ class File_X509
|
||||
$basicConstraints = array();
|
||||
}
|
||||
|
||||
$this->setExtension('id-ce-basicConstraints',
|
||||
array_unique(array_merge(array('cA' => true), $basicConstraints)), true);
|
||||
$this->setExtension(
|
||||
'id-ce-basicConstraints',
|
||||
array_unique(array_merge(array('cA' => true), $basicConstraints)),
|
||||
true
|
||||
);
|
||||
|
||||
if (!isset($subject->currentKeyIdentifier)) {
|
||||
$this->setExtension('id-ce-subjectKeyIdentifier', base64_encode($this->computeKeyIdentifier($this->currentCert)), false, false);
|
||||
@ -3623,8 +3626,7 @@ class File_X509
|
||||
// )
|
||||
//),
|
||||
'keyIdentifier' => $issuer->currentKeyIdentifier
|
||||
)
|
||||
);
|
||||
));
|
||||
//$extensions = &$tbsCertList['crlExtensions'];
|
||||
//if (isset($issuer->serialNumber)) {
|
||||
// $extensions[count($extensions) - 1]['authorityCertSerialNumber'] = $issuer->serialNumber;
|
||||
@ -4415,7 +4417,6 @@ class File_X509
|
||||
if (is_array($rclist = &$this->_subArray($this->currentCert, 'tbsCertList/revokedCertificates', true))) {
|
||||
if ($this->_revokedCertificate($rclist, $serial) === false) { // If not yet revoked
|
||||
if (($i = $this->_revokedCertificate($rclist, $serial, true)) !== false) {
|
||||
|
||||
if (!empty($date)) {
|
||||
$rclist[$i]['revocationDate'] = $this->_timeField($date);
|
||||
}
|
||||
|
@ -1675,17 +1675,23 @@ class Math_BigInteger
|
||||
'publicExponent' => pack('Ca*a*', 2, $this->_encodeASN1Length(strlen($components['publicExponent'])), $components['publicExponent'])
|
||||
);
|
||||
|
||||
$RSAPublicKey = pack('Ca*a*a*',
|
||||
48, $this->_encodeASN1Length(strlen($components['modulus']) + strlen($components['publicExponent'])),
|
||||
$components['modulus'], $components['publicExponent']
|
||||
$RSAPublicKey = pack(
|
||||
'Ca*a*a*',
|
||||
48,
|
||||
$this->_encodeASN1Length(strlen($components['modulus']) + strlen($components['publicExponent'])),
|
||||
$components['modulus'],
|
||||
$components['publicExponent']
|
||||
);
|
||||
|
||||
$rsaOID = pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA
|
||||
$RSAPublicKey = chr(0) . $RSAPublicKey;
|
||||
$RSAPublicKey = chr(3) . $this->_encodeASN1Length(strlen($RSAPublicKey)) . $RSAPublicKey;
|
||||
|
||||
$encapsulated = pack('Ca*a*',
|
||||
48, $this->_encodeASN1Length(strlen($rsaOID . $RSAPublicKey)), $rsaOID . $RSAPublicKey
|
||||
$encapsulated = pack(
|
||||
'Ca*a*',
|
||||
48,
|
||||
$this->_encodeASN1Length(strlen($rsaOID . $RSAPublicKey)),
|
||||
$rsaOID . $RSAPublicKey
|
||||
);
|
||||
|
||||
$RSAPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" .
|
||||
@ -1817,7 +1823,8 @@ class Math_BigInteger
|
||||
|
||||
// calculate the appropriate window size.
|
||||
// $window_size == 3 if $window_ranges is between 25 and 81, for example.
|
||||
for ($i = 0, $window_size = 1; $e_length > $window_ranges[$i] && $i < count($window_ranges); ++$window_size, ++$i);
|
||||
for ($i = 0, $window_size = 1; $e_length > $window_ranges[$i] && $i < count($window_ranges); ++$window_size, ++$i) {
|
||||
}
|
||||
|
||||
$n_value = $n->value;
|
||||
|
||||
@ -3018,7 +3025,8 @@ class Math_BigInteger
|
||||
}
|
||||
} else {
|
||||
$temp = ord($bits[0]);
|
||||
for ($i = 0; $temp >> $i; ++$i);
|
||||
for ($i = 0; $temp >> $i; ++$i) {
|
||||
}
|
||||
$precision = 8 * strlen($bits) - 8 + $i;
|
||||
$mask = chr((1 << ($precision & 0x7)) - 1) . str_repeat(chr(0xFF), $precision >> 3);
|
||||
}
|
||||
@ -3433,7 +3441,8 @@ class Math_BigInteger
|
||||
} else {
|
||||
for ($i = 0, $r_length = count($r_value); $i < $r_length; ++$i) {
|
||||
$temp = ~$r_value[$i] & 0xFFFFFF;
|
||||
for ($j = 1; ($temp >> $j) & 1; ++$j);
|
||||
for ($j = 1; ($temp >> $j) & 1; ++$j) {
|
||||
}
|
||||
if ($j != 25) {
|
||||
break;
|
||||
}
|
||||
|
@ -434,8 +434,15 @@ class Net_SFTP extends Net_SSH2
|
||||
|
||||
$this->window_size_server_to_client[NET_SFTP_CHANNEL] = $this->window_size;
|
||||
|
||||
$packet = pack('CNa*N3',
|
||||
NET_SSH2_MSG_CHANNEL_OPEN, strlen('session'), 'session', NET_SFTP_CHANNEL, $this->window_size, 0x4000);
|
||||
$packet = pack(
|
||||
'CNa*N3',
|
||||
NET_SSH2_MSG_CHANNEL_OPEN,
|
||||
strlen('session'),
|
||||
'session',
|
||||
NET_SFTP_CHANNEL,
|
||||
$this->window_size,
|
||||
0x4000
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
@ -448,8 +455,16 @@ class Net_SFTP extends Net_SSH2
|
||||
return false;
|
||||
}
|
||||
|
||||
$packet = pack('CNNa*CNa*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST, $this->server_channels[NET_SFTP_CHANNEL], strlen('subsystem'), 'subsystem', 1, strlen('sftp'), 'sftp');
|
||||
$packet = pack(
|
||||
'CNNa*CNa*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST,
|
||||
$this->server_channels[NET_SFTP_CHANNEL],
|
||||
strlen('subsystem'),
|
||||
'subsystem',
|
||||
1,
|
||||
strlen('sftp'),
|
||||
'sftp'
|
||||
);
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
}
|
||||
@ -464,8 +479,16 @@ class Net_SFTP extends Net_SSH2
|
||||
"exec sftp-server";
|
||||
// we don't do $this->exec($command, false) because exec() operates on a different channel and plus the SSH_MSG_CHANNEL_OPEN that exec() does
|
||||
// is redundant
|
||||
$packet = pack('CNNa*CNa*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST, $this->server_channels[NET_SFTP_CHANNEL], strlen('exec'), 'exec', 1, strlen($command), $command);
|
||||
$packet = pack(
|
||||
'CNNa*CNa*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST,
|
||||
$this->server_channels[NET_SFTP_CHANNEL],
|
||||
strlen('exec'),
|
||||
'exec',
|
||||
1,
|
||||
strlen($command),
|
||||
$command
|
||||
);
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
}
|
||||
@ -2416,13 +2439,20 @@ class Net_SFTP extends Net_SSH2
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case NET_SFTP_TYPE_BLOCK_DEVICE: return 'block';
|
||||
case NET_SFTP_TYPE_CHAR_DEVICE: return 'char';
|
||||
case NET_SFTP_TYPE_DIRECTORY: return 'dir';
|
||||
case NET_SFTP_TYPE_FIFO: return 'fifo';
|
||||
case NET_SFTP_TYPE_REGULAR: return 'file';
|
||||
case NET_SFTP_TYPE_SYMLINK: return 'link';
|
||||
default: return false;
|
||||
case NET_SFTP_TYPE_BLOCK_DEVICE:
|
||||
return 'block';
|
||||
case NET_SFTP_TYPE_CHAR_DEVICE:
|
||||
return 'char';
|
||||
case NET_SFTP_TYPE_DIRECTORY:
|
||||
return 'dir';
|
||||
case NET_SFTP_TYPE_FIFO:
|
||||
return 'fifo';
|
||||
case NET_SFTP_TYPE_REGULAR:
|
||||
return 'file';
|
||||
case NET_SFTP_TYPE_SYMLINK:
|
||||
return 'link';
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1323,14 +1323,32 @@ class Net_SSH2
|
||||
$first_kex_packet_follows = $first_kex_packet_follows != 0;
|
||||
|
||||
// the sending of SSH2_MSG_KEXINIT could go in one of two places. this is the second place.
|
||||
$kexinit_payload_client = pack('Ca*Na*Na*Na*Na*Na*Na*Na*Na*Na*Na*CN',
|
||||
NET_SSH2_MSG_KEXINIT, $client_cookie, strlen($str_kex_algorithms), $str_kex_algorithms,
|
||||
strlen($str_server_host_key_algorithms), $str_server_host_key_algorithms, strlen($encryption_algorithms_client_to_server),
|
||||
$encryption_algorithms_client_to_server, strlen($encryption_algorithms_server_to_client), $encryption_algorithms_server_to_client,
|
||||
strlen($mac_algorithms_client_to_server), $mac_algorithms_client_to_server, strlen($mac_algorithms_server_to_client),
|
||||
$mac_algorithms_server_to_client, strlen($compression_algorithms_client_to_server), $compression_algorithms_client_to_server,
|
||||
strlen($compression_algorithms_server_to_client), $compression_algorithms_server_to_client, 0, '', 0, '',
|
||||
0, 0
|
||||
$kexinit_payload_client = pack(
|
||||
'Ca*Na*Na*Na*Na*Na*Na*Na*Na*Na*Na*CN',
|
||||
NET_SSH2_MSG_KEXINIT,
|
||||
$client_cookie,
|
||||
strlen($str_kex_algorithms),
|
||||
$str_kex_algorithms,
|
||||
strlen($str_server_host_key_algorithms),
|
||||
$str_server_host_key_algorithms,
|
||||
strlen($encryption_algorithms_client_to_server),
|
||||
$encryption_algorithms_client_to_server,
|
||||
strlen($encryption_algorithms_server_to_client),
|
||||
$encryption_algorithms_server_to_client,
|
||||
strlen($mac_algorithms_client_to_server),
|
||||
$mac_algorithms_client_to_server,
|
||||
strlen($mac_algorithms_server_to_client),
|
||||
$mac_algorithms_server_to_client,
|
||||
strlen($compression_algorithms_client_to_server),
|
||||
$compression_algorithms_client_to_server,
|
||||
strlen($compression_algorithms_server_to_client),
|
||||
$compression_algorithms_server_to_client,
|
||||
0,
|
||||
'',
|
||||
0,
|
||||
'',
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($kexinit_payload_client)) {
|
||||
@ -1339,7 +1357,8 @@ class Net_SSH2
|
||||
// here ends the second place.
|
||||
|
||||
// we need to decide upon the symmetric encryption algorithms before we do the diffie-hellman key exchange
|
||||
for ($i = 0; $i < count($encryption_algorithms) && !in_array($encryption_algorithms[$i], $this->encryption_algorithms_server_to_client); $i++);
|
||||
for ($i = 0; $i < count($encryption_algorithms) && !in_array($encryption_algorithms[$i], $this->encryption_algorithms_server_to_client); $i++) {
|
||||
}
|
||||
if ($i == count($encryption_algorithms)) {
|
||||
user_error('No compatible server to client encryption algorithms found');
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
||||
@ -1385,7 +1404,8 @@ class Net_SSH2
|
||||
$decryptKeyLength = 0;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($encryption_algorithms) && !in_array($encryption_algorithms[$i], $this->encryption_algorithms_client_to_server); $i++);
|
||||
for ($i = 0; $i < count($encryption_algorithms) && !in_array($encryption_algorithms[$i], $this->encryption_algorithms_client_to_server); $i++) {
|
||||
}
|
||||
if ($i == count($encryption_algorithms)) {
|
||||
user_error('No compatible client to server encryption algorithms found');
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
||||
@ -1432,19 +1452,23 @@ class Net_SSH2
|
||||
$keyLength = $decryptKeyLength > $encryptKeyLength ? $decryptKeyLength : $encryptKeyLength;
|
||||
|
||||
// through diffie-hellman key exchange a symmetric key is obtained
|
||||
for ($i = 0; $i < count($kex_algorithms) && !in_array($kex_algorithms[$i], $this->kex_algorithms); $i++);
|
||||
for ($i = 0; $i < count($kex_algorithms) && !in_array($kex_algorithms[$i], $this->kex_algorithms);
|
||||
$i++) {
|
||||
}
|
||||
if ($i == count($kex_algorithms)) {
|
||||
user_error('No compatible key exchange algorithms found');
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
||||
}
|
||||
|
||||
if (strpos($kex_algorithms[$i], 'diffie-hellman-group-exchange') === 0) {
|
||||
$dh_group_sizes_packed = pack('NNN',
|
||||
$dh_group_sizes_packed = pack(
|
||||
'NNN',
|
||||
$this->kex_dh_group_size_min,
|
||||
$this->kex_dh_group_size_preferred,
|
||||
$this->kex_dh_group_size_max
|
||||
);
|
||||
$packet = pack('Ca*',
|
||||
$packet = pack(
|
||||
'Ca*',
|
||||
NET_SSH2_MSG_KEXDH_GEX_REQUEST,
|
||||
$dh_group_sizes_packed
|
||||
);
|
||||
@ -1471,10 +1495,13 @@ class Net_SSH2
|
||||
$gBytes = $this->_string_shift($response, $gLength);
|
||||
$g = new Math_BigInteger($gBytes, -256);
|
||||
|
||||
$exchange_hash_rfc4419 = pack('a*Na*Na*',
|
||||
$exchange_hash_rfc4419 = pack(
|
||||
'a*Na*Na*',
|
||||
$dh_group_sizes_packed,
|
||||
$primeLength, $primeBytes,
|
||||
$gLength, $gBytes
|
||||
$primeLength,
|
||||
$primeBytes,
|
||||
$gLength,
|
||||
$gBytes
|
||||
);
|
||||
|
||||
$clientKexInitMessage = NET_SSH2_MSG_KEXDH_GEX_INIT;
|
||||
@ -1572,16 +1599,25 @@ class Net_SSH2
|
||||
$key = $f->modPow($x, $prime);
|
||||
$keyBytes = $key->toBytes(true);
|
||||
|
||||
$this->exchange_hash = pack('Na*Na*Na*Na*Na*a*Na*Na*Na*',
|
||||
strlen($this->identifier), $this->identifier,
|
||||
strlen($this->server_identifier), $this->server_identifier,
|
||||
strlen($kexinit_payload_client), $kexinit_payload_client,
|
||||
strlen($kexinit_payload_server), $kexinit_payload_server,
|
||||
strlen($this->server_public_host_key), $this->server_public_host_key,
|
||||
$this->exchange_hash = pack(
|
||||
'Na*Na*Na*Na*Na*a*Na*Na*Na*',
|
||||
strlen($this->identifier),
|
||||
$this->identifier,
|
||||
strlen($this->server_identifier),
|
||||
$this->server_identifier,
|
||||
strlen($kexinit_payload_client),
|
||||
$kexinit_payload_client,
|
||||
strlen($kexinit_payload_server),
|
||||
$kexinit_payload_server,
|
||||
strlen($this->server_public_host_key),
|
||||
$this->server_public_host_key,
|
||||
$exchange_hash_rfc4419,
|
||||
strlen($eBytes), $eBytes,
|
||||
strlen($fBytes), $fBytes,
|
||||
strlen($keyBytes), $keyBytes
|
||||
strlen($eBytes),
|
||||
$eBytes,
|
||||
strlen($fBytes),
|
||||
$fBytes,
|
||||
strlen($keyBytes),
|
||||
$keyBytes
|
||||
);
|
||||
|
||||
$this->exchange_hash = $kexHash->hash($this->exchange_hash);
|
||||
@ -1590,7 +1626,8 @@ class Net_SSH2
|
||||
$this->session_id = $this->exchange_hash;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($server_host_key_algorithms) && !in_array($server_host_key_algorithms[$i], $this->server_host_key_algorithms); $i++);
|
||||
for ($i = 0; $i < count($server_host_key_algorithms) && !in_array($server_host_key_algorithms[$i], $this->server_host_key_algorithms); $i++) {
|
||||
}
|
||||
if ($i == count($server_host_key_algorithms)) {
|
||||
user_error('No compatible server host key algorithms found');
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
||||
@ -1601,7 +1638,8 @@ class Net_SSH2
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
||||
}
|
||||
|
||||
$packet = pack('C',
|
||||
$packet = pack(
|
||||
'C',
|
||||
NET_SSH2_MSG_NEWKEYS
|
||||
);
|
||||
|
||||
@ -1833,7 +1871,8 @@ class Net_SSH2
|
||||
$this->decrypt->decrypt(str_repeat("\0", 1536));
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($mac_algorithms) && !in_array($mac_algorithms[$i], $this->mac_algorithms_client_to_server); $i++);
|
||||
for ($i = 0; $i < count($mac_algorithms) && !in_array($mac_algorithms[$i], $this->mac_algorithms_client_to_server); $i++) {
|
||||
}
|
||||
if ($i == count($mac_algorithms)) {
|
||||
user_error('No compatible client to server message authentication algorithms found');
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
||||
@ -1862,7 +1901,8 @@ class Net_SSH2
|
||||
$createKeyLength = 16;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($mac_algorithms) && !in_array($mac_algorithms[$i], $this->mac_algorithms_server_to_client); $i++);
|
||||
for ($i = 0; $i < count($mac_algorithms) && !in_array($mac_algorithms[$i], $this->mac_algorithms_server_to_client); $i++) {
|
||||
}
|
||||
if ($i == count($mac_algorithms)) {
|
||||
user_error('No compatible server to client message authentication algorithms found');
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
||||
@ -1909,14 +1949,16 @@ class Net_SSH2
|
||||
}
|
||||
$this->hmac_check->setKey(substr($key, 0, $checkKeyLength));
|
||||
|
||||
for ($i = 0; $i < count($compression_algorithms) && !in_array($compression_algorithms[$i], $this->compression_algorithms_server_to_client); $i++);
|
||||
for ($i = 0; $i < count($compression_algorithms) && !in_array($compression_algorithms[$i], $this->compression_algorithms_server_to_client); $i++) {
|
||||
}
|
||||
if ($i == count($compression_algorithms)) {
|
||||
user_error('No compatible server to client compression algorithms found');
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
||||
}
|
||||
$this->decompress = $compression_algorithms[$i] == 'zlib';
|
||||
|
||||
for ($i = 0; $i < count($compression_algorithms) && !in_array($compression_algorithms[$i], $this->compression_algorithms_client_to_server); $i++);
|
||||
for ($i = 0; $i < count($compression_algorithms) && !in_array($compression_algorithms[$i], $this->compression_algorithms_client_to_server); $i++) {
|
||||
}
|
||||
if ($i == count($compression_algorithms)) {
|
||||
user_error('No compatible client to server compression algorithms found');
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
|
||||
@ -1992,8 +2034,11 @@ class Net_SSH2
|
||||
}
|
||||
|
||||
if (!($this->bitmap & NET_SSH2_MASK_LOGIN_REQ)) {
|
||||
$packet = pack('CNa*',
|
||||
NET_SSH2_MSG_SERVICE_REQUEST, strlen('ssh-userauth'), 'ssh-userauth'
|
||||
$packet = pack(
|
||||
'CNa*',
|
||||
NET_SSH2_MSG_SERVICE_REQUEST,
|
||||
strlen('ssh-userauth'),
|
||||
'ssh-userauth'
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
@ -2038,9 +2083,15 @@ class Net_SSH2
|
||||
}
|
||||
|
||||
if (!isset($password)) {
|
||||
$packet = pack('CNa*Na*Na*',
|
||||
NET_SSH2_MSG_USERAUTH_REQUEST, strlen($username), $username, strlen('ssh-connection'), 'ssh-connection',
|
||||
strlen('none'), 'none'
|
||||
$packet = pack(
|
||||
'CNa*Na*Na*',
|
||||
NET_SSH2_MSG_USERAUTH_REQUEST,
|
||||
strlen($username),
|
||||
$username,
|
||||
strlen('ssh-connection'),
|
||||
'ssh-connection',
|
||||
strlen('none'),
|
||||
'none'
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
@ -2065,18 +2116,36 @@ class Net_SSH2
|
||||
}
|
||||
}
|
||||
|
||||
$packet = pack('CNa*Na*Na*CNa*',
|
||||
NET_SSH2_MSG_USERAUTH_REQUEST, strlen($username), $username, strlen('ssh-connection'), 'ssh-connection',
|
||||
strlen('password'), 'password', 0, strlen($password), $password
|
||||
$packet = pack(
|
||||
'CNa*Na*Na*CNa*',
|
||||
NET_SSH2_MSG_USERAUTH_REQUEST,
|
||||
strlen($username),
|
||||
$username,
|
||||
strlen('ssh-connection'),
|
||||
'ssh-connection',
|
||||
strlen('password'),
|
||||
'password',
|
||||
0,
|
||||
strlen($password),
|
||||
$password
|
||||
);
|
||||
|
||||
// remove the username and password from the logged packet
|
||||
if (!defined('NET_SSH2_LOGGING')) {
|
||||
$logged = null;
|
||||
} else {
|
||||
$logged = pack('CNa*Na*Na*CNa*',
|
||||
NET_SSH2_MSG_USERAUTH_REQUEST, strlen('username'), 'username', strlen('ssh-connection'), 'ssh-connection',
|
||||
strlen('password'), 'password', 0, strlen('password'), 'password'
|
||||
$logged = pack(
|
||||
'CNa*Na*Na*CNa*',
|
||||
NET_SSH2_MSG_USERAUTH_REQUEST,
|
||||
strlen('username'),
|
||||
'username',
|
||||
strlen('ssh-connection'),
|
||||
'ssh-connection',
|
||||
strlen('password'),
|
||||
'password',
|
||||
0,
|
||||
strlen('password'),
|
||||
'password'
|
||||
);
|
||||
}
|
||||
|
||||
@ -2136,9 +2205,19 @@ class Net_SSH2
|
||||
*/
|
||||
function _keyboard_interactive_login($username, $password)
|
||||
{
|
||||
$packet = pack('CNa*Na*Na*Na*Na*',
|
||||
NET_SSH2_MSG_USERAUTH_REQUEST, strlen($username), $username, strlen('ssh-connection'), 'ssh-connection',
|
||||
strlen('keyboard-interactive'), 'keyboard-interactive', 0, '', 0, ''
|
||||
$packet = pack(
|
||||
'CNa*Na*Na*Na*Na*',
|
||||
NET_SSH2_MSG_USERAUTH_REQUEST,
|
||||
strlen($username),
|
||||
$username,
|
||||
strlen('ssh-connection'),
|
||||
'ssh-connection',
|
||||
strlen('keyboard-interactive'),
|
||||
'keyboard-interactive',
|
||||
0,
|
||||
'',
|
||||
0,
|
||||
''
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
@ -2305,13 +2384,25 @@ class Net_SSH2
|
||||
'e' => $publickey['e']->toBytes(true),
|
||||
'n' => $publickey['n']->toBytes(true)
|
||||
);
|
||||
$publickey = pack('Na*Na*Na*',
|
||||
strlen('ssh-rsa'), 'ssh-rsa', strlen($publickey['e']), $publickey['e'], strlen($publickey['n']), $publickey['n']
|
||||
$publickey = pack(
|
||||
'Na*Na*Na*',
|
||||
strlen('ssh-rsa'),
|
||||
'ssh-rsa',
|
||||
strlen($publickey['e']),
|
||||
$publickey['e'],
|
||||
strlen($publickey['n']),
|
||||
$publickey['n']
|
||||
);
|
||||
|
||||
$part1 = pack('CNa*Na*Na*',
|
||||
NET_SSH2_MSG_USERAUTH_REQUEST, strlen($username), $username, strlen('ssh-connection'), 'ssh-connection',
|
||||
strlen('publickey'), 'publickey'
|
||||
$part1 = pack(
|
||||
'CNa*Na*Na*',
|
||||
NET_SSH2_MSG_USERAUTH_REQUEST,
|
||||
strlen($username),
|
||||
$username,
|
||||
strlen('ssh-connection'),
|
||||
'ssh-connection',
|
||||
strlen('publickey'),
|
||||
'publickey'
|
||||
);
|
||||
$part2 = pack('Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($publickey), $publickey);
|
||||
|
||||
@ -2429,8 +2520,15 @@ class Net_SSH2
|
||||
// uses 0x4000, that's what will be used here, as well.
|
||||
$packet_size = 0x4000;
|
||||
|
||||
$packet = pack('CNa*N3',
|
||||
NET_SSH2_MSG_CHANNEL_OPEN, strlen('session'), 'session', NET_SSH2_CHANNEL_EXEC, $this->window_size_server_to_client[NET_SSH2_CHANNEL_EXEC], $packet_size);
|
||||
$packet = pack(
|
||||
'CNa*N3',
|
||||
NET_SSH2_MSG_CHANNEL_OPEN,
|
||||
strlen('session'),
|
||||
'session',
|
||||
NET_SSH2_CHANNEL_EXEC,
|
||||
$this->window_size_server_to_client[NET_SSH2_CHANNEL_EXEC],
|
||||
$packet_size
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
@ -2445,9 +2543,22 @@ class Net_SSH2
|
||||
|
||||
if ($this->request_pty === true) {
|
||||
$terminal_modes = pack('C', NET_SSH2_TTY_OP_END);
|
||||
$packet = pack('CNNa*CNa*N5a*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST, $this->server_channels[NET_SSH2_CHANNEL_EXEC], strlen('pty-req'), 'pty-req', 1, strlen('vt100'), 'vt100',
|
||||
$this->windowColumns, $this->windowRows, 0, 0, strlen($terminal_modes), $terminal_modes);
|
||||
$packet = pack(
|
||||
'CNNa*CNa*N5a*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST,
|
||||
$this->server_channels[NET_SSH2_CHANNEL_EXEC],
|
||||
strlen('pty-req'),
|
||||
'pty-req',
|
||||
1,
|
||||
strlen('vt100'),
|
||||
'vt100',
|
||||
$this->windowColumns,
|
||||
$this->windowRows,
|
||||
0,
|
||||
0,
|
||||
strlen($terminal_modes),
|
||||
$terminal_modes
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
@ -2481,8 +2592,16 @@ class Net_SSH2
|
||||
// although, in theory, the size of SSH_MSG_CHANNEL_REQUEST could exceed the maximum packet size established by
|
||||
// SSH_MSG_CHANNEL_OPEN_CONFIRMATION, RFC4254#section-5.1 states that the "maximum packet size" refers to the
|
||||
// "maximum size of an individual data packet". ie. SSH_MSG_CHANNEL_DATA. RFC4254#section-5.2 corroborates.
|
||||
$packet = pack('CNNa*CNa*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST, $this->server_channels[NET_SSH2_CHANNEL_EXEC], strlen('exec'), 'exec', 1, strlen($command), $command);
|
||||
$packet = pack(
|
||||
'CNNa*CNa*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST,
|
||||
$this->server_channels[NET_SSH2_CHANNEL_EXEC],
|
||||
strlen('exec'),
|
||||
'exec',
|
||||
1,
|
||||
strlen($command),
|
||||
$command
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
@ -2539,8 +2658,15 @@ class Net_SSH2
|
||||
$this->window_size_server_to_client[NET_SSH2_CHANNEL_SHELL] = $this->window_size;
|
||||
$packet_size = 0x4000;
|
||||
|
||||
$packet = pack('CNa*N3',
|
||||
NET_SSH2_MSG_CHANNEL_OPEN, strlen('session'), 'session', NET_SSH2_CHANNEL_SHELL, $this->window_size_server_to_client[NET_SSH2_CHANNEL_SHELL], $packet_size);
|
||||
$packet = pack(
|
||||
'CNa*N3',
|
||||
NET_SSH2_MSG_CHANNEL_OPEN,
|
||||
strlen('session'),
|
||||
'session',
|
||||
NET_SSH2_CHANNEL_SHELL,
|
||||
$this->window_size_server_to_client[NET_SSH2_CHANNEL_SHELL],
|
||||
$packet_size
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
@ -2554,9 +2680,22 @@ class Net_SSH2
|
||||
}
|
||||
|
||||
$terminal_modes = pack('C', NET_SSH2_TTY_OP_END);
|
||||
$packet = pack('CNNa*CNa*N5a*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST, $this->server_channels[NET_SSH2_CHANNEL_SHELL], strlen('pty-req'), 'pty-req', 1, strlen('vt100'), 'vt100',
|
||||
$this->windowColumns, $this->windowRows, 0, 0, strlen($terminal_modes), $terminal_modes);
|
||||
$packet = pack(
|
||||
'CNNa*CNa*N5a*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST,
|
||||
$this->server_channels[NET_SSH2_CHANNEL_SHELL],
|
||||
strlen('pty-req'),
|
||||
'pty-req',
|
||||
1,
|
||||
strlen('vt100'),
|
||||
'vt100',
|
||||
$this->windowColumns,
|
||||
$this->windowRows,
|
||||
0,
|
||||
0,
|
||||
strlen($terminal_modes),
|
||||
$terminal_modes
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
@ -2580,8 +2719,14 @@ class Net_SSH2
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
|
||||
}
|
||||
|
||||
$packet = pack('CNNa*C',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST, $this->server_channels[NET_SSH2_CHANNEL_SHELL], strlen('shell'), 'shell', 1);
|
||||
$packet = pack(
|
||||
'CNNa*C',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST,
|
||||
$this->server_channels[NET_SSH2_CHANNEL_SHELL],
|
||||
strlen('shell'),
|
||||
'shell',
|
||||
1
|
||||
);
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
}
|
||||
@ -2728,8 +2873,15 @@ class Net_SSH2
|
||||
{
|
||||
$this->window_size_server_to_client[NET_SSH2_CHANNEL_SUBSYSTEM] = $this->window_size;
|
||||
|
||||
$packet = pack('CNa*N3',
|
||||
NET_SSH2_MSG_CHANNEL_OPEN, strlen('session'), 'session', NET_SSH2_CHANNEL_SUBSYSTEM, $this->window_size, 0x4000);
|
||||
$packet = pack(
|
||||
'CNa*N3',
|
||||
NET_SSH2_MSG_CHANNEL_OPEN,
|
||||
strlen('session'),
|
||||
'session',
|
||||
NET_SSH2_CHANNEL_SUBSYSTEM,
|
||||
$this->window_size,
|
||||
0x4000
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
@ -2742,8 +2894,16 @@ class Net_SSH2
|
||||
return false;
|
||||
}
|
||||
|
||||
$packet = pack('CNNa*CNa*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST, $this->server_channels[NET_SSH2_CHANNEL_SUBSYSTEM], strlen('subsystem'), 'subsystem', 1, strlen($subsystem), $subsystem);
|
||||
$packet = pack(
|
||||
'CNNa*CNa*',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST,
|
||||
$this->server_channels[NET_SSH2_CHANNEL_SUBSYSTEM],
|
||||
strlen('subsystem'),
|
||||
'subsystem',
|
||||
1,
|
||||
strlen($subsystem),
|
||||
$subsystem
|
||||
);
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return false;
|
||||
}
|
||||
@ -3012,8 +3172,14 @@ class Net_SSH2
|
||||
|
||||
$packet_size = 0x4000;
|
||||
|
||||
$packet = pack('CN4',
|
||||
NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, $server_channel, $new_channel, $packet_size, $packet_size);
|
||||
$packet = pack(
|
||||
'CN4',
|
||||
NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION,
|
||||
$server_channel,
|
||||
$new_channel,
|
||||
$packet_size,
|
||||
$packet_size
|
||||
);
|
||||
|
||||
$this->server_channels[$new_channel] = $server_channel;
|
||||
$this->channel_status[$new_channel] = NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION;
|
||||
@ -3023,8 +3189,16 @@ class Net_SSH2
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$packet = pack('CN3a*Na*',
|
||||
NET_SSH2_MSG_REQUEST_FAILURE, $server_channel, NET_SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED, 0, '', 0, '');
|
||||
$packet = pack(
|
||||
'CN3a*Na*',
|
||||
NET_SSH2_MSG_REQUEST_FAILURE,
|
||||
$server_channel,
|
||||
NET_SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED,
|
||||
0,
|
||||
'',
|
||||
0,
|
||||
''
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
|
||||
@ -3500,7 +3674,8 @@ class Net_SSH2
|
||||
);
|
||||
|
||||
$temp = $this->_string_shift($data, $max_size);
|
||||
$packet = pack('CN2a*',
|
||||
$packet = pack(
|
||||
'CN2a*',
|
||||
NET_SSH2_MSG_CHANNEL_DATA,
|
||||
$this->server_channels[$client_channel],
|
||||
strlen($temp),
|
||||
@ -3541,7 +3716,8 @@ class Net_SSH2
|
||||
|
||||
$this->curTimeout = 0;
|
||||
|
||||
while (!is_bool($this->_get_channel_packet($client_channel)));
|
||||
while (!is_bool($this->_get_channel_packet($client_channel))) {
|
||||
}
|
||||
|
||||
if ($want_reply) {
|
||||
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$client_channel]));
|
||||
|
@ -378,8 +378,14 @@ class System_SSH_Agent
|
||||
return false;
|
||||
}
|
||||
|
||||
$packet = pack('CNNa*C',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST, $ssh->server_channels[$request_channel], strlen('auth-agent-req@openssh.com'), 'auth-agent-req@openssh.com', 1);
|
||||
$packet = pack(
|
||||
'CNNa*C',
|
||||
NET_SSH2_MSG_CHANNEL_REQUEST,
|
||||
$ssh->server_channels[$request_channel],
|
||||
strlen('auth-agent-req@openssh.com'),
|
||||
'auth-agent-req@openssh.com',
|
||||
1
|
||||
);
|
||||
|
||||
$ssh->channel_status[$request_channel] = NET_SSH2_MSG_CHANNEL_REQUEST;
|
||||
|
||||
|
@ -12,7 +12,7 @@ class Functional_Net_SCPSSH2UserStoryTest extends PhpseclibFunctionalTestCase
|
||||
static protected $exampleData;
|
||||
static protected $exampleDataLength;
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
self::$remoteFile = uniqid('phpseclib-scp-ssh2-') . '.txt';
|
||||
|
@ -10,7 +10,7 @@ require_once 'Crypt/Base.php';
|
||||
|
||||
class Functional_Net_SFTPLargeFileTest extends Functional_Net_SFTPTestCase
|
||||
{
|
||||
static public function setUpBeforeClass()
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
if (!extension_loaded('mcrypt') && !extension_loaded('openssl')) {
|
||||
self::markTestSkipped('This test depends on mcrypt or openssl for performance.');
|
||||
|
@ -13,7 +13,7 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
||||
static protected $exampleDataLength;
|
||||
static protected $buffer;
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
@ -137,7 +137,9 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
||||
{
|
||||
$r = substr(self::$buffer, 0, $length);
|
||||
self::$buffer = substr(self::$buffer, $length);
|
||||
if (strlen($r)) return $r;
|
||||
if (strlen($r)) {
|
||||
return $r;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -335,7 +337,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
||||
if ($sftp->is_file($file)) {
|
||||
$cur_size = $sftp->size($file);
|
||||
$this->assertLessThanOrEqual(
|
||||
$last_size, $cur_size,
|
||||
$last_size,
|
||||
$cur_size,
|
||||
'Failed asserting that nlist() is in descending order'
|
||||
);
|
||||
$last_size = $cur_size;
|
||||
@ -386,7 +389,8 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
||||
$stat = $sftp->stat('symlink');
|
||||
$lstat = $sftp->lstat('symlink');
|
||||
$this->assertNotEquals(
|
||||
$stat, $lstat,
|
||||
$stat,
|
||||
$lstat,
|
||||
'Failed asserting that stat and lstat returned different output for a symlink'
|
||||
);
|
||||
|
||||
@ -419,7 +423,9 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
||||
*/
|
||||
public function testReadlink($sftp)
|
||||
{
|
||||
$this->assertInternalType('string', $sftp->readlink('symlink'),
|
||||
$this->assertInternalType(
|
||||
'string',
|
||||
$sftp->readlink('symlink'),
|
||||
'Failed asserting that a symlink\'s target could be read'
|
||||
);
|
||||
|
||||
@ -434,12 +440,14 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
||||
{
|
||||
$stat = $sftp->stat('.');
|
||||
$this->assertInternalType(
|
||||
'array', $stat,
|
||||
'array',
|
||||
$stat,
|
||||
'Failed asserting that stat on . returns an array'
|
||||
);
|
||||
$lstat = $sftp->lstat('.');
|
||||
$this->assertInternalType(
|
||||
'array', $lstat,
|
||||
'array',
|
||||
$lstat,
|
||||
'Failed asserting that lstat on . returns an array'
|
||||
);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
abstract class PhpseclibFunctionalTestCase extends PhpseclibTestCase
|
||||
{
|
||||
static public function setUpBeforeClass()
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
if (extension_loaded('runkit')) {
|
||||
if (extension_loaded('gmp')) {
|
||||
|
@ -53,7 +53,7 @@ abstract class PhpseclibTestCase extends PHPUnit_Framework_TestCase
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static protected function ensureConstant($constant, $expected)
|
||||
protected static function ensureConstant($constant, $expected)
|
||||
{
|
||||
if (defined($constant)) {
|
||||
$value = constant($constant);
|
||||
@ -86,7 +86,7 @@ abstract class PhpseclibTestCase extends PHPUnit_Framework_TestCase
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
static protected function reRequireFile($filename)
|
||||
protected static function reRequireFile($filename)
|
||||
{
|
||||
if (function_exists('runkit_import')) {
|
||||
$result = runkit_import(
|
||||
|
@ -20,7 +20,7 @@ class Unit_Crypt_Hash_MD5Test extends Unit_Crypt_Hash_TestCase
|
||||
$this->assertHashesTo($this->getInstance(), $message, $result);
|
||||
}
|
||||
|
||||
static public function hashData()
|
||||
public static function hashData()
|
||||
{
|
||||
return array(
|
||||
array('', 'd41d8cd98f00b204e9800998ecf8427e'),
|
||||
@ -37,7 +37,7 @@ class Unit_Crypt_Hash_MD5Test extends Unit_Crypt_Hash_TestCase
|
||||
$this->assertHMACsTo($this->getInstance(), $key, $message, $result);
|
||||
}
|
||||
|
||||
static public function hmacData()
|
||||
public static function hmacData()
|
||||
{
|
||||
return array(
|
||||
array('', '', '74e6f7298a9c2d168935f58c001bad88'),
|
||||
|
@ -20,7 +20,7 @@ class Unit_Crypt_Hash_SHA256Test extends Unit_Crypt_Hash_TestCase
|
||||
$this->assertHashesTo($this->getInstance(), $message, $result);
|
||||
}
|
||||
|
||||
static public function hashData()
|
||||
public static function hashData()
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
@ -46,7 +46,7 @@ class Unit_Crypt_Hash_SHA256Test extends Unit_Crypt_Hash_TestCase
|
||||
$this->assertHMACsTo($this->getInstance(), $key, $message, $result);
|
||||
}
|
||||
|
||||
static public function hmacData()
|
||||
public static function hmacData()
|
||||
{
|
||||
return array(
|
||||
// RFC 4231
|
||||
|
@ -20,7 +20,7 @@ class Unit_Crypt_Hash_SHA512Test extends Unit_Crypt_Hash_TestCase
|
||||
$this->assertHashesTo($this->getInstance(), $message, $result);
|
||||
}
|
||||
|
||||
static public function hashData()
|
||||
public static function hashData()
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
@ -46,7 +46,7 @@ class Unit_Crypt_Hash_SHA512Test extends Unit_Crypt_Hash_TestCase
|
||||
$this->assertHMACsTo($this->getInstance(), $key, $message, $result);
|
||||
}
|
||||
|
||||
static public function hmacData()
|
||||
public static function hmacData()
|
||||
{
|
||||
return array(
|
||||
// RFC 4231
|
||||
|
@ -9,7 +9,7 @@ require_once 'Crypt/Hash.php';
|
||||
|
||||
abstract class Unit_Crypt_Hash_TestCase extends PhpseclibTestCase
|
||||
{
|
||||
static public function setUpBeforeClass()
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
if (!defined('CRYPT_HASH_MODE')) {
|
||||
define('CRYPT_HASH_MODE', CRYPT_HASH_MODE_INTERNAL);
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
class Unit_Math_BigInteger_BCMathTest extends Unit_Math_BigInteger_TestCase
|
||||
{
|
||||
static public function setUpBeforeClass()
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
if (!extension_loaded('bcmath')) {
|
||||
self::markTestSkipped('BCMath extension is not available.');
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
class Unit_Math_BigInteger_GMPTest extends Unit_Math_BigInteger_TestCase
|
||||
{
|
||||
static public function setUpBeforeClass()
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
if (!extension_loaded('gmp')) {
|
||||
self::markTestSkipped('GNU Multiple Precision (GMP) extension is not available.');
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
class Unit_Math_BigInteger_InternalOpenSSLTest extends Unit_Math_BigInteger_TestCase
|
||||
{
|
||||
static public function setUpBeforeClass()
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
if (!function_exists('openssl_public_encrypt')) {
|
||||
self::markTestSkipped('openssl_public_encrypt() function is not available.');
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
class Unit_Math_BigInteger_InternalTest extends Unit_Math_BigInteger_TestCase
|
||||
{
|
||||
static public function setUpBeforeClass()
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
@ -9,7 +9,7 @@ require_once 'Math/BigInteger.php';
|
||||
|
||||
abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
|
||||
{
|
||||
static public function setUpBeforeClass()
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user