Whitespace php-cs-fixer.php rules added

This commit is contained in:
Jack Worman 2022-02-04 10:52:27 -06:00
parent 30eeb49583
commit 25e336614d
147 changed files with 646 additions and 630 deletions

View File

@ -19,5 +19,21 @@ return (new PhpCsFixer\Config())
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'const', 'function']],
'single_import_per_statement' => true,
'single_line_after_imports' => true,
// Whitespace
'array_indentation' => true,
'blank_line_before_statement' => ['statements' => []],
'compact_nullable_typehint' => true,
// TODO: Enable when minimum PHP requirement is >= 7.3
//'heredoc_indentation' => ['indentation' => 'start_plus_one'],
'indentation_type' => true,
'line_ending' => true,
'method_chaining_indentation' => true,
// TODO: Try this rule out in its own PR...
//'no_extra_blank_lines' => ['tokens' => ['break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'switch', 'throw', 'use', 'use_trait']],
'no_spaces_around_offset' => ['positions' => ['inside', 'outside']],
'no_spaces_inside_parenthesis' => true,
'no_trailing_whitespace' => true,
'single_blank_line_at_eof' => true,
'types_spaces' => ['space' => 'none'],
]
);

View File

@ -390,13 +390,13 @@ class Blowfish extends BlockCipher
$data = "\0\0\0\0\0\0\0\0";
for ($i = 0; $i < 18; $i += 2) {
list($l, $r) = array_values(unpack('N*', $data = $this->encryptBlock($data)));
$this->bctx['p'][$i ] = $l;
$this->bctx['p'][$i] = $l;
$this->bctx['p'][$i + 1] = $r;
}
for ($i = 0; $i < 4; ++$i) {
for ($j = 0; $j < 256; $j += 2) {
list($l, $r) = array_values(unpack('N*', $data = $this->encryptBlock($data)));
$this->bctx['sb'][$i][$j ] = $l;
$this->bctx['sb'][$i][$j] = $l;
$this->bctx['sb'][$i][$j + 1] = $r;
}
}
@ -545,11 +545,11 @@ class Blowfish extends BlockCipher
$this->inline_crypt = $this->createInlineCryptFunction(
[
'init_crypt' => $init_crypt,
'init_encrypt' => '',
'init_decrypt' => '',
'encrypt_block' => $encrypt_block,
'decrypt_block' => $decrypt_block
'init_crypt' => $init_crypt,
'init_encrypt' => '',
'init_decrypt' => '',
'encrypt_block' => $encrypt_block,
'decrypt_block' => $decrypt_block
]
);
}

View File

@ -77,4 +77,4 @@ abstract class PKCS
{
self::$format = self::MODE_ANY;
}
}
}

View File

@ -220,4 +220,4 @@ abstract class PKCS1 extends PKCS
chunk_split(Base64::encode($key), 64) .
"-----END $type PUBLIC KEY-----";
}
}
}

View File

@ -277,45 +277,45 @@ abstract class PKCS8 extends PKCS
if (!self::$oidsLoaded) {
// from https://tools.ietf.org/html/rfc2898
ASN1::loadOIDs([
// PBES1 encryption schemes
'pbeWithMD2AndDES-CBC' => '1.2.840.113549.1.5.1',
'pbeWithMD2AndRC2-CBC' => '1.2.840.113549.1.5.4',
'pbeWithMD5AndDES-CBC' => '1.2.840.113549.1.5.3',
'pbeWithMD5AndRC2-CBC' => '1.2.840.113549.1.5.6',
'pbeWithSHA1AndDES-CBC'=> '1.2.840.113549.1.5.10',
'pbeWithSHA1AndRC2-CBC'=> '1.2.840.113549.1.5.11',
// PBES1 encryption schemes
'pbeWithMD2AndDES-CBC' => '1.2.840.113549.1.5.1',
'pbeWithMD2AndRC2-CBC' => '1.2.840.113549.1.5.4',
'pbeWithMD5AndDES-CBC' => '1.2.840.113549.1.5.3',
'pbeWithMD5AndRC2-CBC' => '1.2.840.113549.1.5.6',
'pbeWithSHA1AndDES-CBC'=> '1.2.840.113549.1.5.10',
'pbeWithSHA1AndRC2-CBC'=> '1.2.840.113549.1.5.11',
// from PKCS#12:
// https://tools.ietf.org/html/rfc7292
'pbeWithSHAAnd128BitRC4' => '1.2.840.113549.1.12.1.1',
'pbeWithSHAAnd40BitRC4' => '1.2.840.113549.1.12.1.2',
'pbeWithSHAAnd3-KeyTripleDES-CBC' => '1.2.840.113549.1.12.1.3',
'pbeWithSHAAnd2-KeyTripleDES-CBC' => '1.2.840.113549.1.12.1.4',
'pbeWithSHAAnd128BitRC2-CBC' => '1.2.840.113549.1.12.1.5',
'pbeWithSHAAnd40BitRC2-CBC' => '1.2.840.113549.1.12.1.6',
// from PKCS#12:
// https://tools.ietf.org/html/rfc7292
'pbeWithSHAAnd128BitRC4' => '1.2.840.113549.1.12.1.1',
'pbeWithSHAAnd40BitRC4' => '1.2.840.113549.1.12.1.2',
'pbeWithSHAAnd3-KeyTripleDES-CBC' => '1.2.840.113549.1.12.1.3',
'pbeWithSHAAnd2-KeyTripleDES-CBC' => '1.2.840.113549.1.12.1.4',
'pbeWithSHAAnd128BitRC2-CBC' => '1.2.840.113549.1.12.1.5',
'pbeWithSHAAnd40BitRC2-CBC' => '1.2.840.113549.1.12.1.6',
'id-PBKDF2' => '1.2.840.113549.1.5.12',
'id-PBES2' => '1.2.840.113549.1.5.13',
'id-PBMAC1' => '1.2.840.113549.1.5.14',
'id-PBKDF2' => '1.2.840.113549.1.5.12',
'id-PBES2' => '1.2.840.113549.1.5.13',
'id-PBMAC1' => '1.2.840.113549.1.5.14',
// from PKCS#5 v2.1:
// http://www.rsa.com/rsalabs/pkcs/files/h11302-wp-pkcs5v2-1-password-based-cryptography-standard.pdf
'id-hmacWithSHA1' => '1.2.840.113549.2.7',
'id-hmacWithSHA224' => '1.2.840.113549.2.8',
'id-hmacWithSHA256' => '1.2.840.113549.2.9',
'id-hmacWithSHA384'=> '1.2.840.113549.2.10',
'id-hmacWithSHA512'=> '1.2.840.113549.2.11',
'id-hmacWithSHA512-224'=> '1.2.840.113549.2.12',
'id-hmacWithSHA512-256'=> '1.2.840.113549.2.13',
// from PKCS#5 v2.1:
// http://www.rsa.com/rsalabs/pkcs/files/h11302-wp-pkcs5v2-1-password-based-cryptography-standard.pdf
'id-hmacWithSHA1' => '1.2.840.113549.2.7',
'id-hmacWithSHA224' => '1.2.840.113549.2.8',
'id-hmacWithSHA256' => '1.2.840.113549.2.9',
'id-hmacWithSHA384'=> '1.2.840.113549.2.10',
'id-hmacWithSHA512'=> '1.2.840.113549.2.11',
'id-hmacWithSHA512-224'=> '1.2.840.113549.2.12',
'id-hmacWithSHA512-256'=> '1.2.840.113549.2.13',
'desCBC' => '1.3.14.3.2.7',
'des-EDE3-CBC' => '1.2.840.113549.3.7',
'rc2CBC' => '1.2.840.113549.3.2',
'rc5-CBC-PAD' => '1.2.840.113549.3.9',
'desCBC' => '1.3.14.3.2.7',
'des-EDE3-CBC' => '1.2.840.113549.3.7',
'rc2CBC' => '1.2.840.113549.3.2',
'rc5-CBC-PAD' => '1.2.840.113549.3.9',
'aes128-CBC-PAD' => '2.16.840.1.101.3.4.1.2',
'aes192-CBC-PAD'=> '2.16.840.1.101.3.4.1.22',
'aes256-CBC-PAD'=> '2.16.840.1.101.3.4.1.42'
'aes128-CBC-PAD' => '2.16.840.1.101.3.4.1.2',
'aes192-CBC-PAD'=> '2.16.840.1.101.3.4.1.22',
'aes256-CBC-PAD'=> '2.16.840.1.101.3.4.1.42'
]);
self::$oidsLoaded = true;
}
@ -520,7 +520,7 @@ abstract class PKCS8 extends PKCS
'privateKeyAlgorithm' => [
'algorithm' => is_string(static::OID_NAME) ? static::OID_NAME : $oid,
'parameters' => $params
],
],
'privateKey' => $key
];
if (!empty($attr)) {

View File

@ -59,4 +59,4 @@ trait Fingerprint
return false;
}
}
}
}

View File

@ -48,4 +48,4 @@ trait PasswordProtected
$new->password = $password;
return $new;
}
}
}

View File

@ -711,11 +711,11 @@ class DES extends BlockCipher
// Do the initial IP permutation.
$t = unpack('Nl/Nr', $block);
list($l, $r) = [$t['l'], $t['r']];
$block = ($shuffleip[ $r & 0xFF] & "\x80\x80\x80\x80\x80\x80\x80\x80") |
$block = ($shuffleip[$r & 0xFF] & "\x80\x80\x80\x80\x80\x80\x80\x80") |
($shuffleip[($r >> 8) & 0xFF] & "\x40\x40\x40\x40\x40\x40\x40\x40") |
($shuffleip[($r >> 16) & 0xFF] & "\x20\x20\x20\x20\x20\x20\x20\x20") |
($shuffleip[($r >> 24) & 0xFF] & "\x10\x10\x10\x10\x10\x10\x10\x10") |
($shuffleip[ $l & 0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
($shuffleip[$l & 0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
($shuffleip[($l >> 8) & 0xFF] & "\x04\x04\x04\x04\x04\x04\x04\x04") |
($shuffleip[($l >> 16) & 0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
($shuffleip[($l >> 24) & 0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01");
@ -737,7 +737,7 @@ class DES extends BlockCipher
$t = $sbox1[($b1 >> 24) & 0x3F] ^ $sbox2[($b2 >> 24) & 0x3F] ^
$sbox3[($b1 >> 16) & 0x3F] ^ $sbox4[($b2 >> 16) & 0x3F] ^
$sbox5[($b1 >> 8) & 0x3F] ^ $sbox6[($b2 >> 8) & 0x3F] ^
$sbox7[ $b1 & 0x3F] ^ $sbox8[ $b2 & 0x3F] ^ $l;
$sbox7[$b1 & 0x3F] ^ $sbox8[$b2 & 0x3F] ^ $l;
// end of "the Feistel (F) function"
$l = $r;
@ -757,8 +757,8 @@ class DES extends BlockCipher
($shuffleinvip[($l >> 16) & 0xFF] & "\x10\x10\x10\x10\x10\x10\x10\x10") |
($shuffleinvip[($r >> 8) & 0xFF] & "\x08\x08\x08\x08\x08\x08\x08\x08") |
($shuffleinvip[($l >> 8) & 0xFF] & "\x04\x04\x04\x04\x04\x04\x04\x04") |
($shuffleinvip[ $r & 0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
($shuffleinvip[ $l & 0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01");
($shuffleinvip[$r & 0xFF] & "\x02\x02\x02\x02\x02\x02\x02\x02") |
($shuffleinvip[$l & 0xFF] & "\x01\x01\x01\x01\x01\x01\x01\x01");
}
/**
@ -1232,16 +1232,16 @@ class DES extends BlockCipher
// Perform the PC/1 transformation and compute C and D.
$t = unpack('Nl/Nr', $key);
list($l, $r) = [$t['l'], $t['r']];
$key = (self::$shuffle[$pc1map[ $r & 0xFF]] & "\x80\x80\x80\x80\x80\x80\x80\x00") |
$key = (self::$shuffle[$pc1map[$r & 0xFF]] & "\x80\x80\x80\x80\x80\x80\x80\x00") |
(self::$shuffle[$pc1map[($r >> 8) & 0xFF]] & "\x40\x40\x40\x40\x40\x40\x40\x00") |
(self::$shuffle[$pc1map[($r >> 16) & 0xFF]] & "\x20\x20\x20\x20\x20\x20\x20\x00") |
(self::$shuffle[$pc1map[($r >> 24) & 0xFF]] & "\x10\x10\x10\x10\x10\x10\x10\x00") |
(self::$shuffle[$pc1map[ $l & 0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x00") |
(self::$shuffle[$pc1map[$l & 0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x00") |
(self::$shuffle[$pc1map[($l >> 8) & 0xFF]] & "\x04\x04\x04\x04\x04\x04\x04\x00") |
(self::$shuffle[$pc1map[($l >> 16) & 0xFF]] & "\x02\x02\x02\x02\x02\x02\x02\x00") |
(self::$shuffle[$pc1map[($l >> 24) & 0xFF]] & "\x01\x01\x01\x01\x01\x01\x01\x00");
$key = unpack('Nc/Nd', $key);
$c = ( $key['c'] >> 4) & 0x0FFFFFFF;
$c = ($key['c'] >> 4) & 0x0FFFFFFF;
$d = (($key['d'] >> 4) & 0x0FFFFFF0) | ($key['c'] & 0x0F);
$keys[$des_round] = [
@ -1255,20 +1255,20 @@ class DES extends BlockCipher
$d = ($d | ($d >> 28)) & 0x0FFFFFFF;
// Perform the PC-2 transformation.
$cp = $pc2mapc1[ $c >> 24 ] | $pc2mapc2[($c >> 16) & 0xFF] |
$pc2mapc3[($c >> 8) & 0xFF] | $pc2mapc4[ $c & 0xFF];
$dp = $pc2mapd1[ $d >> 24 ] | $pc2mapd2[($d >> 16) & 0xFF] |
$pc2mapd3[($d >> 8) & 0xFF] | $pc2mapd4[ $d & 0xFF];
$cp = $pc2mapc1[$c >> 24] | $pc2mapc2[($c >> 16) & 0xFF] |
$pc2mapc3[($c >> 8) & 0xFF] | $pc2mapc4[$c & 0xFF];
$dp = $pc2mapd1[$d >> 24] | $pc2mapd2[($d >> 16) & 0xFF] |
$pc2mapd3[($d >> 8) & 0xFF] | $pc2mapd4[$d & 0xFF];
// Reorder: odd bytes/even bytes. Push the result in key schedule.
$val1 = ( $cp & 0xFF000000) | (($cp << 8) & 0x00FF0000) |
$val1 = ($cp & 0xFF000000) | (($cp << 8) & 0x00FF0000) |
(($dp >> 16) & 0x0000FF00) | (($dp >> 8) & 0x000000FF);
$val2 = (($cp << 8) & 0xFF000000) | (($cp << 16) & 0x00FF0000) |
(($dp >> 8) & 0x0000FF00) | ( $dp & 0x000000FF);
$keys[$des_round][self::ENCRYPT][ ] = $val1;
(($dp >> 8) & 0x0000FF00) | ($dp & 0x000000FF);
$keys[$des_round][self::ENCRYPT][] = $val1;
$keys[$des_round][self::DECRYPT][$ki - 1] = $val1;
$keys[$des_round][self::ENCRYPT][ ] = $val2;
$keys[$des_round][self::DECRYPT][$ki ] = $val2;
$keys[$des_round][self::ENCRYPT][] = $val2;
$keys[$des_round][self::DECRYPT][$ki] = $val2;
}
}
@ -1400,11 +1400,11 @@ class DES extends BlockCipher
// Creates the inline-crypt function
$this->inline_crypt = $this->createInlineCryptFunction(
[
'init_crypt' => $init_crypt,
'init_encrypt' => $init_encrypt,
'init_decrypt' => $init_decrypt,
'encrypt_block' => $crypt_block[self::ENCRYPT],
'decrypt_block' => $crypt_block[self::DECRYPT]
'init_crypt' => $init_crypt,
'init_encrypt' => $init_encrypt,
'init_decrypt' => $init_decrypt,
'encrypt_block' => $crypt_block[self::ENCRYPT],
'decrypt_block' => $crypt_block[self::DECRYPT]
]
);
}

View File

@ -154,4 +154,4 @@ abstract class PKCS8 extends Progenitor
$key = ASN1::encodeDER($publicKey, ['type' => ASN1::TYPE_INTEGER]);
return self::wrapPublicKey($key, $params);
}
}
}

View File

@ -474,4 +474,4 @@ abstract class EC extends AsymmetricKey
return parent::__toString();
}
}
}

View File

@ -320,4 +320,4 @@ class KoblitzPrime extends Prime
['a' => $a2, 'b' => $b2]
];
}
}
}

View File

@ -280,4 +280,4 @@ class Montgomery extends Base
list($x, $z) = $p;
return [$x->divide($z)];
}
}
}

View File

@ -554,11 +554,11 @@ class Prime extends Base
-1, /* -1 0 */
-5, /* -1 1 */
-7, /* 0 -1 */
0, /* 0 -1 */
7, /* 0 1 */
5, /* 1 -1 */
1, /* 1 0 */
3 /* 1 1 */
0, /* 0 -1 */
7, /* 0 1 */
5, /* 1 -1 */
1, /* 1 0 */
3 /* 1 1 */
];
$jsf = self::getJSFPoints($scalars[$a], $scalars[$b]);
@ -771,4 +771,4 @@ class Prime extends Base
$p['fresh'] = true;
return $p;
}
}
}

View File

@ -216,4 +216,4 @@ class TwistedEdwards extends Base
return $lhs->equals($rhs);
}
}
}

View File

@ -80,4 +80,4 @@ class Curve25519 extends Montgomery
throw new \RangeException('x must be a positive integer less than 256 bytes in length');
}
}
}
}

View File

@ -87,4 +87,4 @@ class Curve448 extends Montgomery
throw new \RangeException('x must be a positive integer less than 446 bytes in length');
}
}
}
}

View File

@ -33,7 +33,7 @@ class Ed448 extends TwistedEdwards
$this->setCoefficients(
new BigInteger(1),
// -39081
new BigInteger('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE' .
new BigInteger('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE' .
'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6756', 16)
);
$this->setBasePoint(
@ -263,4 +263,4 @@ class Ed448 extends TwistedEdwards
return [$x3, $y3, $z3];
}
}
}

View File

@ -33,4 +33,4 @@ class brainpoolP160r1 extends Prime
);
$this->setOrder(new BigInteger('E95E4A5F737059DC60DF5991D45029409E60FC09', 16));
}
}
}

View File

@ -46,4 +46,4 @@ class brainpoolP160t1 extends Prime
);
$this->setOrder(new BigInteger('E95E4A5F737059DC60DF5991D45029409E60FC09', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class brainpoolP192r1 extends Prime
);
$this->setOrder(new BigInteger('C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class brainpoolP192t1 extends Prime
);
$this->setOrder(new BigInteger('C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class brainpoolP224r1 extends Prime
);
$this->setOrder(new BigInteger('D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class brainpoolP224t1 extends Prime
);
$this->setOrder(new BigInteger('D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class brainpoolP256r1 extends Prime
);
$this->setOrder(new BigInteger('A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7', 16));
}
}
}

View File

@ -39,4 +39,4 @@ class brainpoolP320r1 extends Prime
$this->setOrder(new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D4' .
'82EC7EE8658E98691555B44C59311', 16));
}
}
}

View File

@ -39,4 +39,4 @@ class brainpoolP320t1 extends Prime
$this->setOrder(new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D4' .
'82EC7EE8658E98691555B44C59311', 16));
}
}
}

View File

@ -45,4 +45,4 @@ class brainpoolP384r1 extends Prime
'8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC31' .
'03B883202E9046565', 16));
}
}
}

View File

@ -45,4 +45,4 @@ class brainpoolP384t1 extends Prime
'8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC31' .
'03B883202E9046565', 16));
}
}
}

View File

@ -45,4 +45,4 @@ class brainpoolP512r1 extends Prime
'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA' .
'92619418661197FAC10471DB1D381085DDADDB58796829CA90069', 16));
}
}
}

View File

@ -45,4 +45,4 @@ class brainpoolP512t1 extends Prime
'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA' .
'92619418661197FAC10471DB1D381085DDADDB58796829CA90069', 16));
}
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistb233 extends sect233r1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistb409 extends sect409r1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistk163 extends sect163k1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistk233 extends sect233k1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistk283 extends sect283k1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistk409 extends sect409k1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistp192 extends secp192r1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistp224 extends secp224r1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistp256 extends secp256r1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistp384 extends secp384r1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistp521 extends secp521r1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class nistt571 extends sect571k1
{
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class prime192v1 extends secp192r1
{
}
}

View File

@ -33,4 +33,4 @@ class prime192v2 extends Prime
);
$this->setOrder(new BigInteger('FFFFFFFFFFFFFFFFFFFFFFFE5FB1A724DC80418648D8DD31', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class prime192v3 extends Prime
);
$this->setOrder(new BigInteger('FFFFFFFFFFFFFFFFFFFFFFFF7A62D031C83F4294F640EC13', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class prime239v1 extends Prime
);
$this->setOrder(new BigInteger('7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF9E5E9A9F5D9071FBD1522688909D0B', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class prime239v2 extends Prime
);
$this->setOrder(new BigInteger('7FFFFFFFFFFFFFFFFFFFFFFF800000CFA7E8594377D414C03821BC582063', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class prime239v3 extends Prime
);
$this->setOrder(new BigInteger('7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF975DEB41B3A6057C3C432146526551', 16));
}
}
}

View File

@ -17,4 +17,4 @@ namespace phpseclib3\Crypt\EC\Curves;
final class prime256v1 extends secp256r1
{
}
}

View File

@ -33,4 +33,4 @@ class secp112r1 extends Prime
);
$this->setOrder(new BigInteger('DB7C2ABF62E35E7628DFAC6561C5', 16));
}
}
}

View File

@ -34,4 +34,4 @@ class secp112r2 extends Prime
);
$this->setOrder(new BigInteger('36DF0AAFD8B8D7597CA10520D04B', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class secp128r1 extends Prime
);
$this->setOrder(new BigInteger('FFFFFFFE0000000075A30D1B9038A115', 16));
}
}
}

View File

@ -34,4 +34,4 @@ class secp128r2 extends Prime
);
$this->setOrder(new BigInteger('3FFFFFFF7FFFFFFFBE0024720613B5A3', 16));
}
}
}

View File

@ -45,4 +45,4 @@ class secp160k1 extends KoblitzPrime
];
$this->beta = $this->factory->newInteger(new BigInteger('645B7345A143464942CC46D7CF4D5D1E1E6CBB68', -16));
}
}
}

View File

@ -33,4 +33,4 @@ class secp160r1 extends Prime
);
$this->setOrder(new BigInteger('0100000000000000000001F4C8F927AED3CA752257', 16));
}
}
}

View File

@ -34,4 +34,4 @@ class secp160r2 extends Prime
);
$this->setOrder(new BigInteger('0100000000000000000000351EE786A818F3A1A16B', 16));
}
}
}

View File

@ -44,4 +44,4 @@ class secp192k1 extends KoblitzPrime
];
$this->beta = $this->factory->newInteger(new BigInteger('447A96E6C647963E2F7809FEAAB46947F34B0AA3CA0BBA74', -16));
}
}
}

View File

@ -36,7 +36,7 @@ class secp192r1 extends Prime
now, if PHP supported unsigned integers things might be different. no bit-shifting
would be required for the PHP engine and it'd be a lot faster. but as is, BigInteger
uses base-2**31 or base-2**26 depending on whether or not the system is has a 32-bit
or a 64-bit OS.
or a 64-bit OS.
*/
/*
$m_length = $this->getLengthInBytes();
@ -77,4 +77,4 @@ class secp192r1 extends Prime
);
$this->setOrder(new BigInteger('FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831', 16));
}
}
}

View File

@ -44,4 +44,4 @@ class secp224k1 extends KoblitzPrime
];
$this->beta = $this->factory->newInteger(new BigInteger('01F178FFA4B17C89E6F73AECE2AAD57AF4C0A748B63C830947B27E04', -16));
}
}
}

View File

@ -48,4 +48,4 @@ class secp256k1 extends KoblitzPrime
];
$this->beta = $this->factory->newInteger(new BigInteger('7AE96A2B657C07106E64479EAC3434E99CF0497512F58995C1396C28719501EE', -16));
}
}
}

View File

@ -51,4 +51,4 @@ class secp384r1 extends Prime
16
));
}
}
}

View File

@ -45,4 +45,4 @@ class secp521r1 extends Prime
'FFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E9138' .
'6409', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class sect113r1 extends Binary
);
$this->setOrder(new BigInteger('0100000000000000D9CCEC8A39E56F', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class sect113r2 extends Binary
);
$this->setOrder(new BigInteger('010000000000000108789B2496AF93', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class sect131r1 extends Binary
);
$this->setOrder(new BigInteger('0400000000000000023123953A9464B54D', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class sect131r2 extends Binary
);
$this->setOrder(new BigInteger('0400000000000000016954A233049BA98F', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class sect163k1 extends Binary
);
$this->setOrder(new BigInteger('04000000000000000000020108A2E0CC0D99F8A5EF', 16));
}
}
}

View File

@ -33,4 +33,4 @@ class sect163r1 extends Binary
);
$this->setOrder(new BigInteger('03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B', 16));
}
}
}

View File

@ -65,7 +65,7 @@ abstract class OpenSSH extends Progenitor
if ($type != $parsed['type']) {
throw new \RuntimeException("The public and private keys are not of the same type ($type vs $parsed[type])");
}
if ($type == 'ssh-ed25519' ) {
if ($type == 'ssh-ed25519') {
list(, $key, $comment) = Strings::unpackSSH2('sss', $paddedKey);
$key = libsodium::load($key);
$key['comment'] = $comment;

View File

@ -1378,16 +1378,16 @@ class Hash
// Extend the sixteen 32-bit words into eighty 32-bit words
for ($i = 16; $i < 80; $i++) {
$temp = [
$w[$i - 15]->bitwise_rightRotate(1),
$w[$i - 15]->bitwise_rightRotate(8),
$w[$i - 15]->bitwise_rightShift(7)
$w[$i - 15]->bitwise_rightRotate(1),
$w[$i - 15]->bitwise_rightRotate(8),
$w[$i - 15]->bitwise_rightShift(7)
];
$s0 = $temp[0]->bitwise_xor($temp[1]);
$s0 = $s0->bitwise_xor($temp[2]);
$temp = [
$w[$i - 2]->bitwise_rightRotate(19),
$w[$i - 2]->bitwise_rightRotate(61),
$w[$i - 2]->bitwise_rightShift(6)
$w[$i - 2]->bitwise_rightRotate(19),
$w[$i - 2]->bitwise_rightRotate(61),
$w[$i - 2]->bitwise_rightShift(6)
];
$s1 = $temp[0]->bitwise_xor($temp[1]);
$s1 = $s1->bitwise_xor($temp[2]);

View File

@ -660,9 +660,9 @@ class RC2 extends BlockCipher
// Creates the inline-crypt function
$this->inline_crypt = $this->createInlineCryptFunction(
[
'init_crypt' => $init_crypt,
'encrypt_block' => $encrypt_block,
'decrypt_block' => $decrypt_block
'init_crypt' => $init_crypt,
'encrypt_block' => $encrypt_block,
'decrypt_block' => $decrypt_block
]
);
}

View File

@ -959,4 +959,4 @@ abstract class RSA extends AsymmetricKey
{
static::$enableBlinding = false;
}
}
}

View File

@ -969,11 +969,11 @@ class Rijndael extends BlockCipher
$this->inline_crypt = $this->createInlineCryptFunction(
[
'init_crypt' => '',
'init_encrypt' => $init_encrypt,
'init_decrypt' => $init_decrypt,
'encrypt_block' => $encrypt_block,
'decrypt_block' => $decrypt_block
'init_crypt' => '',
'init_encrypt' => $init_encrypt,
'init_decrypt' => $init_decrypt,
'encrypt_block' => $encrypt_block,
'decrypt_block' => $decrypt_block
]
);
}

View File

@ -460,13 +460,13 @@ class Salsa20 extends StreamCipher
protected static function doubleRound(&$x0, &$x1, &$x2, &$x3, &$x4, &$x5, &$x6, &$x7, &$x8, &$x9, &$x10, &$x11, &$x12, &$x13, &$x14, &$x15)
{
// columnRound
static::quarterRound( $x0, $x4, $x8, $x12);
static::quarterRound( $x5, $x9, $x13, $x1);
static::quarterRound($x0, $x4, $x8, $x12);
static::quarterRound($x5, $x9, $x13, $x1);
static::quarterRound($x10, $x14, $x2, $x6);
static::quarterRound($x15, $x3, $x7, $x11);
// rowRound
static::quarterRound( $x0, $x1, $x2, $x3);
static::quarterRound( $x5, $x6, $x7, $x4);
static::quarterRound($x0, $x1, $x2, $x3);
static::quarterRound($x5, $x6, $x7, $x4);
static::quarterRound($x10, $x11, $x8, $x9);
static::quarterRound($x15, $x12, $x13, $x14);
}

View File

@ -464,7 +464,7 @@ class Twofish extends BlockCipher
list($s7, $s6, $s5, $s4) = $this->mdsrem($le_longs[1], $le_longs[2]);
list($s3, $s2, $s1, $s0) = $this->mdsrem($le_longs[3], $le_longs[4]);
for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) {
$A = $m0[$q0[$q0[$i] ^ $key[ 9]] ^ $key[1]] ^
$A = $m0[$q0[$q0[$i] ^ $key[9]] ^ $key[1]] ^
$m1[$q0[$q1[$i] ^ $key[10]] ^ $key[2]] ^
$m2[$q1[$q0[$i] ^ $key[11]] ^ $key[3]] ^
$m3[$q1[$q1[$i] ^ $key[12]] ^ $key[4]];
@ -490,7 +490,7 @@ class Twofish extends BlockCipher
list($s7, $s6, $s5, $s4) = $this->mdsrem($le_longs[3], $le_longs[4]);
list($s3, $s2, $s1, $s0) = $this->mdsrem($le_longs[5], $le_longs[6]);
for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) {
$A = $m0[$q0[$q0[$q1[$i] ^ $key[17]] ^ $key[ 9]] ^ $key[1]] ^
$A = $m0[$q0[$q0[$q1[$i] ^ $key[17]] ^ $key[9]] ^ $key[1]] ^
$m1[$q0[$q1[$q1[$i] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^
$m2[$q1[$q0[$q0[$i] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^
$m3[$q1[$q1[$q0[$i] ^ $key[20]] ^ $key[12]] ^ $key[4]];
@ -517,7 +517,7 @@ class Twofish extends BlockCipher
list($s7, $s6, $s5, $s4) = $this->mdsrem($le_longs[5], $le_longs[6]);
list($s3, $s2, $s1, $s0) = $this->mdsrem($le_longs[7], $le_longs[8]);
for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) {
$A = $m0[$q0[$q0[$q1[$q1[$i] ^ $key[25]] ^ $key[17]] ^ $key[ 9]] ^ $key[1]] ^
$A = $m0[$q0[$q0[$q1[$q1[$i] ^ $key[25]] ^ $key[17]] ^ $key[9]] ^ $key[1]] ^
$m1[$q0[$q1[$q1[$q0[$i] ^ $key[26]] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^
$m2[$q1[$q0[$q0[$q0[$i] ^ $key[27]] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^
$m3[$q1[$q1[$q0[$q1[$i] ^ $key[28]] ^ $key[20]] ^ $key[12]] ^ $key[4]];
@ -617,24 +617,24 @@ class Twofish extends BlockCipher
$ki = 7;
while ($ki < 39) {
$t0 = $S0[ $R0 & 0xff] ^
$t0 = $S0[$R0 & 0xff] ^
$S1[($R0 >> 8) & 0xff] ^
$S2[($R0 >> 16) & 0xff] ^
$S3[($R0 >> 24) & 0xff];
$t1 = $S0[($R1 >> 24) & 0xff] ^
$S1[ $R1 & 0xff] ^
$S1[$R1 & 0xff] ^
$S2[($R1 >> 8) & 0xff] ^
$S3[($R1 >> 16) & 0xff];
$R2^= self::safe_intval($t0 + $t1 + $K[++$ki]);
$R2 = ($R2 >> 1 & 0x7fffffff) | ($R2 << 31);
$R3 = ((($R3 >> 31) & 1) | ($R3 << 1)) ^ self::safe_intval($t0 + ($t1 << 1) + $K[++$ki]);
$t0 = $S0[ $R2 & 0xff] ^
$t0 = $S0[$R2 & 0xff] ^
$S1[($R2 >> 8) & 0xff] ^
$S2[($R2 >> 16) & 0xff] ^
$S3[($R2 >> 24) & 0xff];
$t1 = $S0[($R3 >> 24) & 0xff] ^
$S1[ $R3 & 0xff] ^
$S1[$R3 & 0xff] ^
$S2[($R3 >> 8) & 0xff] ^
$S3[($R3 >> 16) & 0xff];
$R0^= self::safe_intval($t0 + $t1 + $K[++$ki]);
@ -815,11 +815,11 @@ class Twofish extends BlockCipher
$this->inline_crypt = $this->createInlineCryptFunction(
[
'init_crypt' => $init_crypt,
'init_encrypt' => '',
'init_decrypt' => '',
'encrypt_block' => $encrypt_block,
'decrypt_block' => $decrypt_block
'init_crypt' => $init_crypt,
'init_encrypt' => '',
'init_decrypt' => '',
'encrypt_block' => $encrypt_block,
'decrypt_block' => $decrypt_block
]
);
}

View File

@ -188,14 +188,14 @@ abstract class ASN1
* @access public
*/
const STRING_TYPE_SIZE = [
self::TYPE_UTF8_STRING => 0,
self::TYPE_BMP_STRING => 2,
self::TYPE_UNIVERSAL_STRING => 4,
self::TYPE_PRINTABLE_STRING => 1,
self::TYPE_TELETEX_STRING => 1,
self::TYPE_IA5_STRING => 1,
self::TYPE_VISIBLE_STRING => 1,
];
self::TYPE_UTF8_STRING => 0,
self::TYPE_BMP_STRING => 2,
self::TYPE_UNIVERSAL_STRING => 4,
self::TYPE_PRINTABLE_STRING => 1,
self::TYPE_TELETEX_STRING => 1,
self::TYPE_IA5_STRING => 1,
self::TYPE_VISIBLE_STRING => 1,
];
/**
* Parse BER-encoding

View File

@ -33,7 +33,7 @@ abstract class AlgorithmIdentifier
'parameters' => [
'type' => ASN1::TYPE_ANY,
'optional' => true
]
]
]
];
}

View File

@ -29,13 +29,13 @@ abstract class AnotherName
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'type-id' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'value' => [
'type' => ASN1::TYPE_ANY,
'constant' => 0,
'optional' => true,
'explicit' => true
]
'type-id' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'value' => [
'type' => ASN1::TYPE_ANY,
'constant' => 0,
'optional' => true,
'explicit' => true
]
]
];
}

View File

@ -31,10 +31,10 @@ abstract class Attribute
'children' => [
'type' => AttributeType::MAP,
'value'=> [
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => AttributeValue::MAP
'type' => ASN1::TYPE_SET,
'min' => 1,
'max' => -1,
'children' => AttributeValue::MAP
]
]
];

View File

@ -30,20 +30,20 @@ abstract class AuthorityKeyIdentifier
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'keyIdentifier' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + KeyIdentifier::MAP,
'constant' => 0,
'optional' => true,
'implicit' => true
] + KeyIdentifier::MAP,
'authorityCertIssuer' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP,
'constant' => 1,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP,
'authorityCertSerialNumber' => [
'constant' => 2,
'optional' => true,
'implicit' => true
] + CertificateSerialNumber::MAP
'constant' => 2,
'optional' => true,
'implicit' => true
] + CertificateSerialNumber::MAP
]
];
}

View File

@ -30,14 +30,14 @@ abstract class BasicConstraints
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'cA' => [
'type' => ASN1::TYPE_BOOLEAN,
'optional' => true,
'default' => false
],
'type' => ASN1::TYPE_BOOLEAN,
'optional' => true,
'default' => false
],
'pathLenConstraint' => [
'type' => ASN1::TYPE_INTEGER,
'optional' => true
]
'type' => ASN1::TYPE_INTEGER,
'optional' => true
]
]
];
}

View File

@ -29,8 +29,8 @@ abstract class BuiltInDomainDefinedAttribute
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'type' => ['type' => ASN1::TYPE_PRINTABLE_STRING],
'value' => ['type' => ASN1::TYPE_PRINTABLE_STRING]
'type' => ['type' => ASN1::TYPE_PRINTABLE_STRING],
'value' => ['type' => ASN1::TYPE_PRINTABLE_STRING]
]
];
}

View File

@ -32,40 +32,40 @@ abstract class BuiltInStandardAttributes
'country-name' => ['optional' => true] + CountryName::MAP,
'administration-domain-name' => ['optional' => true] + AdministrationDomainName::MAP,
'network-address' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + NetworkAddress::MAP,
'constant' => 0,
'optional' => true,
'implicit' => true
] + NetworkAddress::MAP,
'terminal-identifier' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + TerminalIdentifier::MAP,
'constant' => 1,
'optional' => true,
'implicit' => true
] + TerminalIdentifier::MAP,
'private-domain-name' => [
'constant' => 2,
'optional' => true,
'explicit' => true
] + PrivateDomainName::MAP,
'constant' => 2,
'optional' => true,
'explicit' => true
] + PrivateDomainName::MAP,
'organization-name' => [
'constant' => 3,
'optional' => true,
'implicit' => true
] + OrganizationName::MAP,
'constant' => 3,
'optional' => true,
'implicit' => true
] + OrganizationName::MAP,
'numeric-user-identifier' => [
'constant' => 4,
'optional' => true,
'implicit' => true
] + NumericUserIdentifier::MAP,
'constant' => 4,
'optional' => true,
'implicit' => true
] + NumericUserIdentifier::MAP,
'personal-name' => [
'constant' => 5,
'optional' => true,
'implicit' => true
] + PersonalName::MAP,
'constant' => 5,
'optional' => true,
'implicit' => true
] + PersonalName::MAP,
'organizational-unit-names' => [
'constant' => 6,
'optional' => true,
'implicit' => true
] + OrganizationalUnitNames::MAP
'constant' => 6,
'optional' => true,
'implicit' => true
] + OrganizationalUnitNames::MAP
]
];
}

View File

@ -29,17 +29,17 @@ abstract class CRLReason
const MAP = [
'type' => ASN1::TYPE_ENUMERATED,
'mapping' => [
'unspecified',
'keyCompromise',
'cACompromise',
'affiliationChanged',
'superseded',
'cessationOfOperation',
'certificateHold',
// Value 7 is not used.
8 => 'removeFromCRL',
'privilegeWithdrawn',
'aACompromise'
'unspecified',
'keyCompromise',
'cACompromise',
'affiliationChanged',
'superseded',
'cessationOfOperation',
'certificateHold',
// Value 7 is not used.
8 => 'removeFromCRL',
'privilegeWithdrawn',
'aACompromise'
]
];
}

View File

@ -29,9 +29,9 @@ abstract class Certificate
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'tbsCertificate' => TBSCertificate::MAP,
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING]
'tbsCertificate' => TBSCertificate::MAP,
'signatureAlgorithm' => AlgorithmIdentifier::MAP,
'signature' => ['type' => ASN1::TYPE_BIT_STRING]
]
];
}

View File

@ -30,16 +30,16 @@ abstract class CertificationRequestInfo
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'version' => [
'type' => ASN1::TYPE_INTEGER,
'mapping' => ['v1']
],
'type' => ASN1::TYPE_INTEGER,
'mapping' => ['v1']
],
'subject' => Name::MAP,
'subjectPKInfo' => SubjectPublicKeyInfo::MAP,
'attributes' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + Attributes::MAP,
'constant' => 0,
'optional' => true,
'implicit' => true
] + Attributes::MAP,
]
];
}

View File

@ -37,4 +37,4 @@ abstract class Characteristic_two
]
]
];
}
}

View File

@ -37,4 +37,4 @@ abstract class DSAPrivateKey
'x' => ['type' => ASN1::TYPE_INTEGER]
]
];
}
}

View File

@ -30,20 +30,20 @@ abstract class DistributionPoint
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'distributionPoint' => [
'constant' => 0,
'optional' => true,
'explicit' => true
] + DistributionPointName::MAP,
'constant' => 0,
'optional' => true,
'explicit' => true
] + DistributionPointName::MAP,
'reasons' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + ReasonFlags::MAP,
'constant' => 1,
'optional' => true,
'implicit' => true
] + ReasonFlags::MAP,
'cRLIssuer' => [
'constant' => 2,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP
'constant' => 2,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP
]
];
}

View File

@ -30,15 +30,15 @@ abstract class DistributionPointName
'type' => ASN1::TYPE_CHOICE,
'children' => [
'fullName' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP,
'constant' => 0,
'optional' => true,
'implicit' => true
] + GeneralNames::MAP,
'nameRelativeToCRLIssuer' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + RelativeDistinguishedName::MAP
'constant' => 1,
'optional' => true,
'implicit' => true
] + RelativeDistinguishedName::MAP
]
];
}

View File

@ -29,18 +29,18 @@ abstract class EDIPartyName
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'nameAssigner' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + DirectoryString::MAP,
// partyName is technically required but \phpseclib3\File\ASN1 doesn't currently support non-optional constants and
// setting it to optional gets the job done in any event.
'partyName' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + DirectoryString::MAP
'nameAssigner' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + DirectoryString::MAP,
// partyName is technically required but \phpseclib3\File\ASN1 doesn't currently support non-optional constants and
// setting it to optional gets the job done in any event.
'partyName' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + DirectoryString::MAP
]
];
}

View File

@ -37,10 +37,10 @@ abstract class Extension
'children' => [
'extnId' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
'critical' => [
'type' => ASN1::TYPE_BOOLEAN,
'optional' => true,
'default' => false
],
'type' => ASN1::TYPE_BOOLEAN,
'optional' => true,
'default' => false
],
'extnValue' => ['type' => ASN1::TYPE_OCTET_STRING]
]
];

View File

@ -29,18 +29,18 @@ abstract class ExtensionAttribute
const MAP = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'extension-attribute-type' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 0,
'optional' => true,
'implicit' => true
],
'extension-attribute-value' => [
'type' => ASN1::TYPE_ANY,
'constant' => 1,
'optional' => true,
'explicit' => true
]
'extension-attribute-type' => [
'type' => ASN1::TYPE_PRINTABLE_STRING,
'constant' => 0,
'optional' => true,
'implicit' => true
],
'extension-attribute-value' => [
'type' => ASN1::TYPE_ANY,
'constant' => 1,
'optional' => true,
'explicit' => true
]
]
];
}

View File

@ -36,4 +36,4 @@ abstract class FieldID
]
]
];
}
}

View File

@ -30,55 +30,55 @@ abstract class GeneralName
'type' => ASN1::TYPE_CHOICE,
'children' => [
'otherName' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + AnotherName::MAP,
'constant' => 0,
'optional' => true,
'implicit' => true
] + AnotherName::MAP,
'rfc822Name' => [
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 1,
'optional' => true,
'implicit' => true
],
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 1,
'optional' => true,
'implicit' => true
],
'dNSName' => [
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 2,
'optional' => true,
'implicit' => true
],
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 2,
'optional' => true,
'implicit' => true
],
'x400Address' => [
'constant' => 3,
'optional' => true,
'implicit' => true
] + ORAddress::MAP,
'constant' => 3,
'optional' => true,
'implicit' => true
] + ORAddress::MAP,
'directoryName' => [
'constant' => 4,
'optional' => true,
'explicit' => true
] + Name::MAP,
'constant' => 4,
'optional' => true,
'explicit' => true
] + Name::MAP,
'ediPartyName' => [
'constant' => 5,
'optional' => true,
'implicit' => true
] + EDIPartyName::MAP,
'constant' => 5,
'optional' => true,
'implicit' => true
] + EDIPartyName::MAP,
'uniformResourceIdentifier' => [
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 6,
'optional' => true,
'implicit' => true
],
'type' => ASN1::TYPE_IA5_STRING,
'constant' => 6,
'optional' => true,
'implicit' => true
],
'iPAddress' => [
'type' => ASN1::TYPE_OCTET_STRING,
'constant' => 7,
'optional' => true,
'implicit' => true
],
'type' => ASN1::TYPE_OCTET_STRING,
'constant' => 7,
'optional' => true,
'implicit' => true
],
'registeredID' => [
'type' => ASN1::TYPE_OBJECT_IDENTIFIER,
'constant' => 8,
'optional' => true,
'implicit' => true
]
'type' => ASN1::TYPE_OBJECT_IDENTIFIER,
'constant' => 8,
'optional' => true,
'implicit' => true
]
]
];
}

View File

@ -31,16 +31,16 @@ abstract class GeneralSubtree
'children' => [
'base' => GeneralName::MAP,
'minimum' => [
'constant' => 0,
'optional' => true,
'implicit' => true,
'default' => '0'
] + BaseDistance::MAP,
'constant' => 0,
'optional' => true,
'implicit' => true,
'default' => '0'
] + BaseDistance::MAP,
'maximum' => [
'constant' => 1,
'optional' => true,
'implicit' => true,
] + BaseDistance::MAP
'constant' => 1,
'optional' => true,
'implicit' => true,
] + BaseDistance::MAP
]
];
}

View File

@ -27,4 +27,4 @@ use phpseclib3\File\ASN1;
abstract class HashAlgorithm
{
const MAP = AlgorithmIdentifier::MAP;
}
}

View File

@ -30,43 +30,43 @@ abstract class IssuingDistributionPoint
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'distributionPoint' => [
'constant' => 0,
'optional' => true,
'explicit' => true
] + DistributionPointName::MAP,
'constant' => 0,
'optional' => true,
'explicit' => true
] + DistributionPointName::MAP,
'onlyContainsUserCerts' => [
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 1,
'optional' => true,
'default' => false,
'implicit' => true
],
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 1,
'optional' => true,
'default' => false,
'implicit' => true
],
'onlyContainsCACerts' => [
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 2,
'optional' => true,
'default' => false,
'implicit' => true
],
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 2,
'optional' => true,
'default' => false,
'implicit' => true
],
'onlySomeReasons' => [
'constant' => 3,
'optional' => true,
'implicit' => true
] + ReasonFlags::MAP,
'constant' => 3,
'optional' => true,
'implicit' => true
] + ReasonFlags::MAP,
'indirectCRL' => [
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 4,
'optional' => true,
'default' => false,
'implicit' => true
],
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 4,
'optional' => true,
'default' => false,
'implicit' => true
],
'onlyContainsAttributeCerts' =>[
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 5,
'optional' => true,
'default' => false,
'implicit' => true
]
]
'type' => ASN1::TYPE_BOOLEAN,
'constant' => 5,
'optional' => true,
'default' => false,
'implicit' => true
]
]
];
}

View File

@ -27,4 +27,4 @@ use phpseclib3\File\ASN1;
abstract class MaskGenAlgorithm
{
const MAP = AlgorithmIdentifier::MAP;
}
}

View File

@ -30,15 +30,15 @@ abstract class NameConstraints
'type' => ASN1::TYPE_SEQUENCE,
'children' => [
'permittedSubtrees' => [
'constant' => 0,
'optional' => true,
'implicit' => true
] + GeneralSubtrees::MAP,
'constant' => 0,
'optional' => true,
'implicit' => true
] + GeneralSubtrees::MAP,
'excludedSubtrees' => [
'constant' => 1,
'optional' => true,
'implicit' => true
] + GeneralSubtrees::MAP
'constant' => 1,
'optional' => true,
'implicit' => true
] + GeneralSubtrees::MAP
]
];
}

Some files were not shown because too many files have changed in this diff Show More