mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-17 02:35:10 +00:00
CS: Fix "PEAR.Formatting.MultiLineAssignment.EqualSignLine" sniff.
This commit is contained in:
parent
10b47a1e5a
commit
cee0f3343b
@ -1336,12 +1336,14 @@ class Crypt_DES extends Crypt_Base
|
|||||||
$pc2mapd3[($d >> 8) & 0xFF] | $pc2mapd4[ $d & 0xFF];
|
$pc2mapd3[($d >> 8) & 0xFF] | $pc2mapd4[ $d & 0xFF];
|
||||||
|
|
||||||
// Reorder: odd bytes/even bytes. Push the result in key schedule.
|
// Reorder: odd bytes/even bytes. Push the result in key schedule.
|
||||||
$keys[$des_round][CRYPT_DES_ENCRYPT][ ] =
|
$val1 = ( $cp & 0xFF000000) | (($cp << 8) & 0x00FF0000) |
|
||||||
$keys[$des_round][CRYPT_DES_DECRYPT][$ki - 1] = ( $cp & 0xFF000000) | (($cp << 8) & 0x00FF0000) |
|
|
||||||
(($dp >> 16) & 0x0000FF00) | (($dp >> 8) & 0x000000FF);
|
(($dp >> 16) & 0x0000FF00) | (($dp >> 8) & 0x000000FF);
|
||||||
$keys[$des_round][CRYPT_DES_ENCRYPT][ ] =
|
$val2 = (($cp << 8) & 0xFF000000) | (($cp << 16) & 0x00FF0000) |
|
||||||
$keys[$des_round][CRYPT_DES_DECRYPT][$ki ] = (($cp << 8) & 0xFF000000) | (($cp << 16) & 0x00FF0000) |
|
|
||||||
(($dp >> 8) & 0x0000FF00) | ( $dp & 0x000000FF);
|
(($dp >> 8) & 0x0000FF00) | ( $dp & 0x000000FF);
|
||||||
|
$keys[$des_round][CRYPT_DES_ENCRYPT][ ] = $val1;
|
||||||
|
$keys[$des_round][CRYPT_DES_DECRYPT][$ki - 1] = $val1;
|
||||||
|
$keys[$des_round][CRYPT_DES_ENCRYPT][ ] = $val2;
|
||||||
|
$keys[$des_round][CRYPT_DES_DECRYPT][$ki ] = $val2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1496,33 +1496,33 @@ class File_X509
|
|||||||
default:
|
default:
|
||||||
switch ($algorithm) {
|
switch ($algorithm) {
|
||||||
case 'rsaEncryption':
|
case 'rsaEncryption':
|
||||||
$cert['tbsCertificate']['subjectPublicKeyInfo']['subjectPublicKey'] =
|
$cert['tbsCertificate']['subjectPublicKeyInfo']['subjectPublicKey']
|
||||||
base64_encode("\0" . base64_decode(preg_replace('#-.+-|[\r\n]#', '', $cert['tbsCertificate']['subjectPublicKeyInfo']['subjectPublicKey'])));
|
= base64_encode("\0" . base64_decode(preg_replace('#-.+-|[\r\n]#', '', $cert['tbsCertificate']['subjectPublicKeyInfo']['subjectPublicKey'])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$asn1 = new File_ASN1();
|
$asn1 = new File_ASN1();
|
||||||
|
|
||||||
$asn1->loadOIDs($this->oids);
|
$asn1->loadOIDs($this->oids);
|
||||||
|
|
||||||
$filters = array();
|
$filters = array();
|
||||||
$filters['tbsCertificate']['signature']['parameters'] =
|
$type_utf8_string = array('type' => FILE_ASN1_TYPE_UTF8_STRING);
|
||||||
$filters['tbsCertificate']['signature']['issuer']['rdnSequence']['value'] =
|
$filters['tbsCertificate']['signature']['parameters'] = $type_utf8_string;
|
||||||
$filters['tbsCertificate']['issuer']['rdnSequence']['value'] =
|
$filters['tbsCertificate']['signature']['issuer']['rdnSequence']['value'] = $type_utf8_string;
|
||||||
$filters['tbsCertificate']['subject']['rdnSequence']['value'] =
|
$filters['tbsCertificate']['issuer']['rdnSequence']['value'] = $type_utf8_string;
|
||||||
$filters['tbsCertificate']['subjectPublicKeyInfo']['algorithm']['parameters'] =
|
$filters['tbsCertificate']['subject']['rdnSequence']['value'] = $type_utf8_string;
|
||||||
$filters['signatureAlgorithm']['parameters'] =
|
$filters['tbsCertificate']['subjectPublicKeyInfo']['algorithm']['parameters'] = $type_utf8_string;
|
||||||
$filters['authorityCertIssuer']['directoryName']['rdnSequence']['value'] =
|
$filters['signatureAlgorithm']['parameters'] = $type_utf8_string;
|
||||||
//$filters['policyQualifiers']['qualifier'] =
|
$filters['authorityCertIssuer']['directoryName']['rdnSequence']['value'] = $type_utf8_string;
|
||||||
$filters['distributionPoint']['fullName']['directoryName']['rdnSequence']['value'] =
|
//$filters['policyQualifiers']['qualifier'] = $type_utf8_string;
|
||||||
$filters['directoryName']['rdnSequence']['value'] =
|
$filters['distributionPoint']['fullName']['directoryName']['rdnSequence']['value'] = $type_utf8_string;
|
||||||
array('type' => FILE_ASN1_TYPE_UTF8_STRING);
|
$filters['directoryName']['rdnSequence']['value'] = $type_utf8_string;
|
||||||
|
|
||||||
/* in the case of policyQualifiers/qualifier, the type has to be FILE_ASN1_TYPE_IA5_STRING.
|
/* in the case of policyQualifiers/qualifier, the type has to be FILE_ASN1_TYPE_IA5_STRING.
|
||||||
FILE_ASN1_TYPE_PRINTABLE_STRING will cause OpenSSL's X.509 parser to spit out random
|
FILE_ASN1_TYPE_PRINTABLE_STRING will cause OpenSSL's X.509 parser to spit out random
|
||||||
characters.
|
characters.
|
||||||
*/
|
*/
|
||||||
$filters['policyQualifiers']['qualifier'] =
|
$filters['policyQualifiers']['qualifier']
|
||||||
array('type' => FILE_ASN1_TYPE_IA5_STRING);
|
= array('type' => FILE_ASN1_TYPE_IA5_STRING);
|
||||||
|
|
||||||
$asn1->loadFilters($filters);
|
$asn1->loadFilters($filters);
|
||||||
|
|
||||||
@ -2901,8 +2901,8 @@ class File_X509
|
|||||||
default:
|
default:
|
||||||
switch ($algorithm) {
|
switch ($algorithm) {
|
||||||
case 'rsaEncryption':
|
case 'rsaEncryption':
|
||||||
$csr['certificationRequestInfo']['subjectPKInfo']['subjectPublicKey'] =
|
$csr['certificationRequestInfo']['subjectPKInfo']['subjectPublicKey']
|
||||||
base64_encode("\0" . base64_decode(preg_replace('#-.+-|[\r\n]#', '', $csr['certificationRequestInfo']['subjectPKInfo']['subjectPublicKey'])));
|
= base64_encode("\0" . base64_decode(preg_replace('#-.+-|[\r\n]#', '', $csr['certificationRequestInfo']['subjectPKInfo']['subjectPublicKey'])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2911,8 +2911,8 @@ class File_X509
|
|||||||
$asn1->loadOIDs($this->oids);
|
$asn1->loadOIDs($this->oids);
|
||||||
|
|
||||||
$filters = array();
|
$filters = array();
|
||||||
$filters['certificationRequestInfo']['subject']['rdnSequence']['value'] =
|
$filters['certificationRequestInfo']['subject']['rdnSequence']['value']
|
||||||
array('type' => FILE_ASN1_TYPE_UTF8_STRING);
|
= array('type' => FILE_ASN1_TYPE_UTF8_STRING);
|
||||||
|
|
||||||
$asn1->loadFilters($filters);
|
$asn1->loadFilters($filters);
|
||||||
|
|
||||||
@ -3079,19 +3079,21 @@ class File_X509
|
|||||||
$asn1->loadOIDs($this->oids);
|
$asn1->loadOIDs($this->oids);
|
||||||
|
|
||||||
$filters = array();
|
$filters = array();
|
||||||
$filters['tbsCertList']['issuer']['rdnSequence']['value'] =
|
$filters['tbsCertList']['issuer']['rdnSequence']['value']
|
||||||
$filters['tbsCertList']['signature']['parameters'] =
|
= array('type' => FILE_ASN1_TYPE_UTF8_STRING);
|
||||||
$filters['signatureAlgorithm']['parameters'] =
|
$filters['tbsCertList']['signature']['parameters']
|
||||||
array('type' => FILE_ASN1_TYPE_UTF8_STRING);
|
= array('type' => FILE_ASN1_TYPE_UTF8_STRING);
|
||||||
|
$filters['signatureAlgorithm']['parameters']
|
||||||
|
= array('type' => FILE_ASN1_TYPE_UTF8_STRING);
|
||||||
|
|
||||||
if (empty($crl['tbsCertList']['signature']['parameters'])) {
|
if (empty($crl['tbsCertList']['signature']['parameters'])) {
|
||||||
$filters['tbsCertList']['signature']['parameters'] =
|
$filters['tbsCertList']['signature']['parameters']
|
||||||
array('type' => FILE_ASN1_TYPE_NULL);
|
= array('type' => FILE_ASN1_TYPE_NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($crl['signatureAlgorithm']['parameters'])) {
|
if (empty($crl['signatureAlgorithm']['parameters'])) {
|
||||||
$filters['signatureAlgorithm']['parameters'] =
|
$filters['signatureAlgorithm']['parameters']
|
||||||
array('type' => FILE_ASN1_TYPE_NULL);
|
= array('type' => FILE_ASN1_TYPE_NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
$asn1->loadFilters($filters);
|
$asn1->loadFilters($filters);
|
||||||
@ -3143,9 +3145,9 @@ class File_X509
|
|||||||
|
|
||||||
if (isset($subject->currentCert) && is_array($subject->currentCert) && isset($subject->currentCert['tbsCertificate'])) {
|
if (isset($subject->currentCert) && is_array($subject->currentCert) && isset($subject->currentCert['tbsCertificate'])) {
|
||||||
$this->currentCert = $subject->currentCert;
|
$this->currentCert = $subject->currentCert;
|
||||||
$this->currentCert['tbsCertificate']['signature']['algorithm'] =
|
$this->currentCert['tbsCertificate']['signature']['algorithm'] = $signatureAlgorithm;
|
||||||
$this->currentCert['signatureAlgorithm']['algorithm'] =
|
$this->currentCert['signatureAlgorithm']['algorithm'] = $signatureAlgorithm;
|
||||||
$signatureAlgorithm;
|
|
||||||
if (!empty($this->startDate)) {
|
if (!empty($this->startDate)) {
|
||||||
$this->currentCert['tbsCertificate']['validity']['notBefore']['generalTime'] = $this->startDate;
|
$this->currentCert['tbsCertificate']['validity']['notBefore']['generalTime'] = $this->startDate;
|
||||||
unset($this->currentCert['tbsCertificate']['validity']['notBefore']['utcTime']);
|
unset($this->currentCert['tbsCertificate']['validity']['notBefore']['utcTime']);
|
||||||
@ -3315,8 +3317,7 @@ class File_X509
|
|||||||
$signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject: null;
|
$signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject: null;
|
||||||
|
|
||||||
if (isset($this->currentCert) && is_array($this->currentCert) && isset($this->currentCert['certificationRequestInfo'])) {
|
if (isset($this->currentCert) && is_array($this->currentCert) && isset($this->currentCert['certificationRequestInfo'])) {
|
||||||
$this->currentCert['signatureAlgorithm']['algorithm'] =
|
$this->currentCert['signatureAlgorithm']['algorithm'] = $signatureAlgorithm;
|
||||||
$signatureAlgorithm;
|
|
||||||
if (!empty($this->dn)) {
|
if (!empty($this->dn)) {
|
||||||
$this->currentCert['certificationRequestInfo']['subject'] = $this->dn;
|
$this->currentCert['certificationRequestInfo']['subject'] = $this->dn;
|
||||||
}
|
}
|
||||||
|
@ -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.Formatting.MultiLineAssignment.EqualSignLine"><severity>0</severity></rule>
|
|
||||||
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"><severity>0</severity></rule>
|
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"><severity>0</severity></rule>
|
||||||
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine"><severity>0</severity></rule>
|
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine"><severity>0</severity></rule>
|
||||||
<rule ref="PEAR.Functions.FunctionCallSignature.Indent"><severity>0</severity></rule>
|
<rule ref="PEAR.Functions.FunctionCallSignature.Indent"><severity>0</severity></rule>
|
||||||
|
Loading…
Reference in New Issue
Block a user