mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-17 02:35:10 +00:00
Merge pull request #200 from bantu/cs-else-no-newline
CodeSniffer: Fix PEAR.ControlStructures.ControlSignature sniff. * bantu/cs-else-no-newline: Ignore coding style for "HAC 4.49" block in Math/BigInteger.php. CS: Fix PEAR.ControlStructures.ControlSignature sniff.
This commit is contained in:
commit
8271f0fd29
@ -418,8 +418,7 @@ class Crypt_Blowfish extends Crypt_Base
|
|||||||
|
|
||||||
if (!$keylength) {
|
if (!$keylength) {
|
||||||
$key = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
$key = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||||
}
|
} elseif ($keylength > 56) {
|
||||||
elseif ($keylength > 56) {
|
|
||||||
$key = substr($key, 0, 56);
|
$key = substr($key, 0, 56);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -593,8 +593,7 @@ class File_ASN1
|
|||||||
if (isset($child['class'])) {
|
if (isset($child['class'])) {
|
||||||
$childClass = $child['class'];
|
$childClass = $child['class'];
|
||||||
$constant = $child['cast'];
|
$constant = $child['cast'];
|
||||||
}
|
} elseif (isset($child['constant'])) {
|
||||||
elseif (isset($child['constant'])) {
|
|
||||||
$childClass = FILE_ASN1_CLASS_CONTEXT_SPECIFIC;
|
$childClass = FILE_ASN1_CLASS_CONTEXT_SPECIFIC;
|
||||||
$constant = $child['constant'];
|
$constant = $child['constant'];
|
||||||
}
|
}
|
||||||
@ -666,8 +665,7 @@ class File_ASN1
|
|||||||
if (isset($child['class'])) {
|
if (isset($child['class'])) {
|
||||||
$childClass = $child['class'];
|
$childClass = $child['class'];
|
||||||
$constant = $child['cast'];
|
$constant = $child['cast'];
|
||||||
}
|
} elseif (isset($child['constant'])) {
|
||||||
elseif (isset($child['constant'])) {
|
|
||||||
$childClass = FILE_ASN1_CLASS_CONTEXT_SPECIFIC;
|
$childClass = FILE_ASN1_CLASS_CONTEXT_SPECIFIC;
|
||||||
$constant = $child['constant'];
|
$constant = $child['constant'];
|
||||||
}
|
}
|
||||||
|
@ -1715,8 +1715,7 @@ class File_X509
|
|||||||
if ($map === false) {
|
if ($map === false) {
|
||||||
user_error($id . ' is not a currently supported attribute', E_USER_NOTICE);
|
user_error($id . ' is not a currently supported attribute', E_USER_NOTICE);
|
||||||
unset($attributes[$i]);
|
unset($attributes[$i]);
|
||||||
}
|
} elseif (is_array($attributes[$i]['value'])) {
|
||||||
elseif (is_array($attributes[$i]['value'])) {
|
|
||||||
$values = &$attributes[$i]['value'];
|
$values = &$attributes[$i]['value'];
|
||||||
for ($j = 0; $j < count($values); $j++) {
|
for ($j = 0; $j < count($values); $j++) {
|
||||||
switch ($id) {
|
switch ($id) {
|
||||||
@ -3400,8 +3399,7 @@ class File_X509
|
|||||||
|
|
||||||
if (!empty($this->serialNumber)) {
|
if (!empty($this->serialNumber)) {
|
||||||
$crlNumber = $this->serialNumber;
|
$crlNumber = $this->serialNumber;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$crlNumber = $this->getExtension('id-ce-cRLNumber');
|
$crlNumber = $this->getExtension('id-ce-cRLNumber');
|
||||||
$crlNumber = $crlNumber !== false ? $crlNumber->add(new Math_BigInteger(1)) : null;
|
$crlNumber = $crlNumber !== false ? $crlNumber->add(new Math_BigInteger(1)) : null;
|
||||||
}
|
}
|
||||||
@ -3414,8 +3412,7 @@ class File_X509
|
|||||||
if (!$version) {
|
if (!$version) {
|
||||||
if (!empty($tbsCertList['crlExtensions'])) {
|
if (!empty($tbsCertList['crlExtensions'])) {
|
||||||
$version = 1; // v2.
|
$version = 1; // v2.
|
||||||
}
|
} elseif (!empty($tbsCertList['revokedCertificates'])) {
|
||||||
elseif (!empty($tbsCertList['revokedCertificates'])) {
|
|
||||||
foreach ($tbsCertList['revokedCertificates'] as $cert) {
|
foreach ($tbsCertList['revokedCertificates'] as $cert) {
|
||||||
if (!empty($cert['crlEntryExtensions'])) {
|
if (!empty($cert['crlEntryExtensions'])) {
|
||||||
$version = 1; // v2.
|
$version = 1; // v2.
|
||||||
|
@ -3299,6 +3299,7 @@ class Math_BigInteger
|
|||||||
|
|
||||||
if (!$t) {
|
if (!$t) {
|
||||||
// see HAC 4.49 "Note (controlling the error probability)"
|
// see HAC 4.49 "Note (controlling the error probability)"
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
if ($length >= 163) { $t = 2; } // floor(1300 / 8)
|
if ($length >= 163) { $t = 2; } // floor(1300 / 8)
|
||||||
else if ($length >= 106) { $t = 3; } // floor( 850 / 8)
|
else if ($length >= 106) { $t = 3; } // floor( 850 / 8)
|
||||||
else if ($length >= 81 ) { $t = 4; } // floor( 650 / 8)
|
else if ($length >= 81 ) { $t = 4; } // floor( 650 / 8)
|
||||||
@ -3311,6 +3312,7 @@ class Math_BigInteger
|
|||||||
else if ($length >= 25 ) { $t = 15; } // floor( 200 / 8)
|
else if ($length >= 25 ) { $t = 15; } // floor( 200 / 8)
|
||||||
else if ($length >= 18 ) { $t = 18; } // floor( 150 / 8)
|
else if ($length >= 18 ) { $t = 18; } // floor( 150 / 8)
|
||||||
else { $t = 27; }
|
else { $t = 27; }
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
// ie. gmp_testbit($this, 0)
|
// ie. gmp_testbit($this, 0)
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParams"><severity>0</severity></rule>
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParams"><severity>0</severity></rule>
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParams"><severity>0</severity></rule>
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParams"><severity>0</severity></rule>
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeTags"><severity>0</severity></rule>
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeTags"><severity>0</severity></rule>
|
||||||
<rule ref="PEAR.ControlStructures.ControlSignature"><severity>0</severity></rule>
|
|
||||||
<rule ref="PEAR.Files.IncludingFile.BracketsNotRequired"><severity>0</severity></rule>
|
<rule ref="PEAR.Files.IncludingFile.BracketsNotRequired"><severity>0</severity></rule>
|
||||||
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce"><severity>0</severity></rule>
|
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce"><severity>0</severity></rule>
|
||||||
<rule ref="PEAR.Formatting.MultiLineAssignment.EqualSignLine"><severity>0</severity></rule>
|
<rule ref="PEAR.Formatting.MultiLineAssignment.EqualSignLine"><severity>0</severity></rule>
|
||||||
|
Loading…
Reference in New Issue
Block a user