diff --git a/build/php-cs-fixer.php b/build/php-cs-fixer.php index cadfa567..f51e0f72 100644 --- a/build/php-cs-fixer.php +++ b/build/php-cs-fixer.php @@ -26,9 +26,7 @@ return (new PhpCsFixer\Config()) 'phpdoc_trim_consecutive_blank_line_separation' => true, 'phpdoc_trim' => true, - '@PHP70Migration' => true, - '@PHP70Migration:risky' => true, - '@PHP71Migration' => true, '@PHP71Migration:risky' => true, + '@PHP73Migration' => true, ] ); diff --git a/build/psalm_baseline.xml b/build/psalm_baseline.xml index 9fc0cd61..f012cc1a 100644 --- a/build/psalm_baseline.xml +++ b/build/psalm_baseline.xml @@ -1,5 +1,5 @@ - + $var @@ -2048,7 +2048,7 @@ [static::OID_NAME => static::OID_VALUE] - + $algorithm $encryptionAlgorithm $encryptionScheme @@ -2057,6 +2057,7 @@ $key $key $key['privateKeyAlgorithm']['parameters'] + $key['publicKeyAlgorithm']['parameters'] $meta['meta']['algorithm'] $meta['meta']['cipher'] $meta['meta']['keyDerivationFunc'] @@ -7808,7 +7809,7 @@ $t - RSA + PrivateKey $primes[$i] @@ -9965,10 +9966,14 @@ $this->x $this->x + 1 - + $match[2] - 1 $this->x $this->x + $this->x + $this->x + $this->x + $this->x $this->x += $match[1] $this->x -= $match[1] @@ -9987,7 +9992,7 @@ \phpseclib3\File\ANSI - + $ansi $attr_row $attrs @@ -9996,6 +10001,7 @@ $max_history $max_x $max_y + $old_x $old_y $screen $tokenization @@ -10009,6 +10015,9 @@ $this->screen $this->screen + + $old_x + @@ -14441,7 +14450,7 @@ readlink realpath - + $a['filename'] $attr['mode'] $b['filename'] @@ -14475,7 +14484,6 @@ $fp $fp $length - $length + $res_offset $link $link $link @@ -14492,8 +14500,6 @@ $remote_file $remote_file $stat['atime'] - $stat['atime'] - $stat['mtime'] $stat['mtime'] $status $status @@ -14539,7 +14545,7 @@ $this->requestBuffer[$packet_id] $this->requestBuffer[$request_id] - + $a[$sort] $attr $attr @@ -14576,7 +14582,6 @@ $props $remote_file $remote_file - $res_offset $response $response $response @@ -14588,9 +14593,6 @@ $result $result $size - $size - $size - $size $subtemp $temp $temp @@ -14619,7 +14621,7 @@ string string|bool - + $a[$sort] $a[$sort] $attr @@ -14636,11 +14638,8 @@ $key $length $offset - $res_offset $shortname $shortname - $size - $size $start $subtemp $temp @@ -14737,7 +14736,7 @@ $this->channel_status[self::CHANNEL] $this->server_channels[self::CHANNEL] - + $a['filename'] $a['filename'] $a['filename'] @@ -14749,13 +14748,7 @@ $b['filename'] $b['filename'] $stat['atime'] - $stat['atime'] - $stat['atime'] $stat['mtime'] - $stat['mtime'] - $stat['mtime'] - $stat['size'] - $stat['size'] $stat['type'] $this->stat($remote_file)['size'] @@ -17114,8 +17107,7 @@ $args - - $key + $r['primes'] $r['primes'] $rsa->getPublicKey()->toString('PKCS1') @@ -17124,21 +17116,19 @@ $privatekey $publickey - + $actual $ciphertext - $key $plaintext $prime $signature [$publickey, $privatekey] - + decrypt encrypt getLength toString - toString $r['primes'] @@ -17149,13 +17139,10 @@ CreateKeyTest CreateKeyTest - - getPublicKey - getPublicKey + getPublicKey sign verify - withPassword CreateKeyTest @@ -17609,11 +17596,10 @@ 'phpseclib3\Math\BigInteger' - $privateKey - - - $authority->sign($issuer, $subject) $publicKey + + + $authority->sign($issuer, $subject) $result $subjectKey @@ -17628,11 +17614,10 @@ $extension['extnValue'] $loader->loadX509($cert)['tbsCertificate'] - + $customExtensionDecodedData $decodedData $extension - $publicKey $result $subjectKey @@ -17651,9 +17636,6 @@ X509ExtensionTest X509ExtensionTest - - getPublicKey - X509ExtensionTest diff --git a/composer.json b/composer.json index 50a71acd..6ed2577a 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ } ], "require": { - "php": ">=7.1", + "php": ">=7.3", "paragonie/constant_time_encoding": "^2" }, "require-dev": { @@ -79,5 +79,22 @@ }, "config": { "sort-packages": true + }, + "scripts": { + "lint": "parallel-lint --show-deprecated build phpseclib tests", + "php_codesniffer": "phpcs --standard=build/php_codesniffer.xml", + "php_codesniffer-fix": "phpcbf --standard=build/php_codesniffer.xml", + "php-cs-fixer": "php-cs-fixer fix --config=build/php-cs-fixer.php --diff --using-cache=no --dry-run", + "php-cs-fixer-fix": "php-cs-fixer fix --config=build/php-cs-fixer.php --diff --using-cache=no", + "psalm": "psalm --config=build/psalm.xml --no-cache --long-progress", + "psalm-set-baseline": "psalm --config=build/psalm.xml --no-cache --long-progress --set-baseline=psalm_baseline.xml", + "test": "vendor/bin/phpunit --configuration tests/phpunit.xml", + "all-quality-tools": [ + "@lint", + "@phpcs", + "@php-cs-fixer", + "@psalm", + "@test" + ] } } diff --git a/phpseclib/Crypt/Blowfish.php b/phpseclib/Crypt/Blowfish.php index 03e10c2e..980ecb46 100644 --- a/phpseclib/Crypt/Blowfish.php +++ b/phpseclib/Crypt/Blowfish.php @@ -171,7 +171,7 @@ class Blowfish extends BlockCipher 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, - 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, ]; /** @@ -211,7 +211,7 @@ class Blowfish extends BlockCipher 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, - 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, ]; /** @@ -251,7 +251,7 @@ class Blowfish extends BlockCipher 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, - 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, ]; /** @@ -291,7 +291,7 @@ class Blowfish extends BlockCipher 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, - 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, ]; /** @@ -302,7 +302,7 @@ class Blowfish extends BlockCipher private static $parray = [ 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, - 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b, ]; /** @@ -406,8 +406,8 @@ class Blowfish extends BlockCipher self::$sbox0, self::$sbox1, self::$sbox2, - self::$sbox3 - ] + self::$sbox3, + ], ]; // unpack binary string in unsigned chars @@ -802,7 +802,7 @@ class Blowfish extends BlockCipher 'init_encrypt' => '', 'init_decrypt' => '', 'encrypt_block' => $encrypt_block, - 'decrypt_block' => $decrypt_block + 'decrypt_block' => $decrypt_block, ] ); } diff --git a/phpseclib/Crypt/Common/AsymmetricKey.php b/phpseclib/Crypt/Common/AsymmetricKey.php index f7ecfd34..465dbbb5 100644 --- a/phpseclib/Crypt/Common/AsymmetricKey.php +++ b/phpseclib/Crypt/Common/AsymmetricKey.php @@ -391,7 +391,7 @@ abstract class AsymmetricKey // this test can be satisfied by either of the following: // http://php.net/manual/en/book.sodium.php // https://github.com/paragonie/sodium_compat - 'libsodium' => function_exists('sodium_crypto_sign_keypair') + 'libsodium' => function_exists('sodium_crypto_sign_keypair'), ]; return static::$engines; @@ -405,7 +405,7 @@ abstract class AsymmetricKey static::$engines = [ 'PHP' => true, 'OpenSSL' => false, - 'libsodium' => false + 'libsodium' => false, ]; } diff --git a/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php b/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php index 5340da63..99142844 100644 --- a/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php @@ -285,7 +285,7 @@ abstract class PKCS8 extends PKCS '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' + 'aes256-CBC-PAD' => '2.16.840.1.101.3.4.1.42', ]); self::$oidsLoaded = true; } @@ -401,7 +401,7 @@ abstract class PKCS8 extends PKCS 'pbkdf2', $hash, $salt, - (int) $iterationCount->toString() + (int) $iterationCount->toString(), ]; if (isset($keyLength)) { $params[] = (int) $keyLength->toString(); @@ -496,9 +496,9 @@ abstract class PKCS8 extends PKCS $key = [ 'version' => 'v1', 'privateKeyAlgorithm' => [ - 'algorithm' => is_string(static::OID_NAME) ? static::OID_NAME : $oid + 'algorithm' => is_string(static::OID_NAME) ? static::OID_NAME : $oid, ], - 'privateKey' => $key + 'privateKey' => $key, ]; if ($oid != 'id-Ed25519' && $oid != 'id-Ed448') { $key['privateKeyAlgorithm']['parameters'] = $params; @@ -528,7 +528,7 @@ abstract class PKCS8 extends PKCS $PBKDF2params = [ 'salt' => $salt, 'iterationCount' => $iterationCount, - 'prf' => ['algorithm' => $prf, 'parameters' => null] + 'prf' => ['algorithm' => $prf, 'parameters' => null], ]; $PBKDF2params = ASN1::encodeDER($PBKDF2params, Maps\PBKDF2params::MAP); @@ -537,7 +537,7 @@ abstract class PKCS8 extends PKCS } else { $params = [ 'rc2ParametersVersion' => 58, - 'iv' => $iv + 'iv' => $iv, ]; $params = ASN1::encodeDER($params, Maps\RC2CBCParameter::MAP); $params = new ASN1\Element($params); @@ -546,12 +546,12 @@ abstract class PKCS8 extends PKCS $params = [ 'keyDerivationFunc' => [ 'algorithm' => 'id-PBKDF2', - 'parameters' => new ASN1\Element($PBKDF2params) + 'parameters' => new ASN1\Element($PBKDF2params), ], 'encryptionScheme' => [ 'algorithm' => $encryptionScheme, - 'parameters' => $params - ] + 'parameters' => $params, + ], ]; $params = ASN1::encodeDER($params, Maps\PBES2params::MAP); @@ -563,7 +563,7 @@ abstract class PKCS8 extends PKCS $params = [ 'salt' => $salt, - 'iterationCount' => $iterationCount + 'iterationCount' => $iterationCount, ]; $params = ASN1::encodeDER($params, Maps\PBEParameter::MAP); } @@ -573,9 +573,9 @@ abstract class PKCS8 extends PKCS $key = [ 'encryptionAlgorithm' => [ 'algorithm' => $encryptionAlgorithm, - 'parameters' => new ASN1\Element($params) + 'parameters' => new ASN1\Element($params), ], - 'encryptedData' => $key + 'encryptedData' => $key, ]; $key = ASN1::encodeDER($key, Maps\EncryptedPrivateKeyInfo::MAP); @@ -599,9 +599,9 @@ abstract class PKCS8 extends PKCS $key = [ 'publicKeyAlgorithm' => [ - 'algorithm' => is_string(static::OID_NAME) ? static::OID_NAME : $oid + 'algorithm' => is_string(static::OID_NAME) ? static::OID_NAME : $oid, ], - 'publicKey' => "\0" . $key + 'publicKey' => "\0" . $key, ]; if ($oid != 'id-Ed25519' && $oid != 'id-Ed448') { diff --git a/phpseclib/Crypt/Common/Formats/Signature/Raw.php b/phpseclib/Crypt/Common/Formats/Signature/Raw.php index 6d6d3fdf..c3db69cb 100644 --- a/phpseclib/Crypt/Common/Formats/Signature/Raw.php +++ b/phpseclib/Crypt/Common/Formats/Signature/Raw.php @@ -43,7 +43,7 @@ abstract class Raw return [ 'r' => $sig['r'], - 's' => $sig['s'] + 's' => $sig['s'], ]; } diff --git a/phpseclib/Crypt/Common/SymmetricKey.php b/phpseclib/Crypt/Common/SymmetricKey.php index edbfca00..2c453f84 100644 --- a/phpseclib/Crypt/Common/SymmetricKey.php +++ b/phpseclib/Crypt/Common/SymmetricKey.php @@ -142,7 +142,7 @@ abstract class SymmetricKey 'ofb' => self::MODE_OFB, 'ofb8' => self::MODE_OFB8, 'gcm' => self::MODE_GCM, - 'stream' => self::MODE_STREAM + 'stream' => self::MODE_STREAM, ]; /** @@ -186,7 +186,7 @@ abstract class SymmetricKey self::ENGINE_EVAL => 'Eval', self::ENGINE_OPENSSL => 'OpenSSL', self::ENGINE_LIBSODIUM => 'libsodium', - self::ENGINE_OPENSSL_GCM => 'OpenSSL (GCM)' + self::ENGINE_OPENSSL_GCM => 'OpenSSL (GCM)', ]; /** @@ -1996,7 +1996,7 @@ abstract class SymmetricKey self::ENGINE_LIBSODIUM, self::ENGINE_OPENSSL_GCM, self::ENGINE_OPENSSL, - self::ENGINE_EVAL + self::ENGINE_EVAL, ]; if (isset($this->preferredEngine)) { $temp = [$this->preferredEngine]; @@ -2778,16 +2778,16 @@ abstract class SymmetricKey // @see https://github.com/phpseclib/phpseclib/pull/1143 /** @var \Closure $func */ $func = eval(<< 'des-ecb', self::MODE_CBC => 'des-cbc', self::MODE_CFB => 'des-cfb', - self::MODE_OFB => 'des-ofb' + self::MODE_OFB => 'des-ofb', // self::MODE_CTR is undefined for DES ]; @@ -268,7 +268,7 @@ class DES extends BlockCipher "\xFF\xFF\xFF\xFF\xFF\x00\x00\x00", "\xFF\xFF\xFF\xFF\xFF\x00\x00\xFF", "\xFF\xFF\xFF\xFF\xFF\x00\xFF\x00", "\xFF\xFF\xFF\xFF\xFF\x00\xFF\xFF", "\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00", "\xFF\xFF\xFF\xFF\xFF\xFF\x00\xFF", - "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00", "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" + "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00", "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", ]; /** @@ -310,7 +310,7 @@ class DES extends BlockCipher 0x8C, 0x9C, 0x8D, 0x9D, 0xAC, 0xBC, 0xAD, 0xBD, 0x8E, 0x9E, 0x8F, 0x9F, 0xAE, 0xBE, 0xAF, 0xBF, 0xCC, 0xDC, 0xCD, 0xDD, 0xEC, 0xFC, 0xED, 0xFD, - 0xCE, 0xDE, 0xCF, 0xDF, 0xEE, 0xFE, 0xEF, 0xFF + 0xCE, 0xDE, 0xCF, 0xDF, 0xEE, 0xFE, 0xEF, 0xFF, ]; /** @@ -351,7 +351,7 @@ class DES extends BlockCipher 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF + 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF, ]; /** @@ -378,7 +378,7 @@ class DES extends BlockCipher 0x00808202, 0x00008002, 0x00808000, 0x00800202, 0x00800002, 0x00000202, 0x00008202, 0x00808200, 0x00000202, 0x00800200, 0x00800200, 0x00000000, - 0x00008002, 0x00008200, 0x00000000, 0x00808002 + 0x00008002, 0x00008200, 0x00000000, 0x00808002, ]; /** @@ -402,7 +402,7 @@ class DES extends BlockCipher 0x00004010, 0x40084000, 0x00080000, 0x40000010, 0x00080010, 0x40004010, 0x40000010, 0x00080010, 0x00084000, 0x00000000, 0x40004000, 0x00004010, - 0x40000000, 0x40080010, 0x40084010, 0x00084000 + 0x40000000, 0x40080010, 0x40084010, 0x00084000, ]; /** @@ -426,7 +426,7 @@ class DES extends BlockCipher 0x04000104, 0x00010000, 0x04000000, 0x04010104, 0x00000004, 0x00010104, 0x00010100, 0x04000004, 0x04010000, 0x04000104, 0x00000104, 0x04010000, - 0x00010104, 0x00000004, 0x04010004, 0x00010100 + 0x00010104, 0x00000004, 0x04010004, 0x00010100, ]; /** @@ -450,7 +450,7 @@ class DES extends BlockCipher 0x80401040, 0x80000040, 0x80000000, 0x00001000, 0x80400000, 0x80001000, 0x00401040, 0x80400040, 0x80001000, 0x00001040, 0x00400000, 0x80401000, - 0x00000040, 0x00400000, 0x00001000, 0x00401040 + 0x00000040, 0x00400000, 0x00001000, 0x00401040, ]; /** @@ -474,7 +474,7 @@ class DES extends BlockCipher 0x21040080, 0x00040080, 0x21000000, 0x21040080, 0x01040000, 0x00000000, 0x20040000, 0x21000000, 0x00040080, 0x01000080, 0x20000080, 0x00040000, - 0x00000000, 0x20040000, 0x01040080, 0x20000080 + 0x00000000, 0x20040000, 0x01040080, 0x20000080, ]; /** @@ -498,7 +498,7 @@ class DES extends BlockCipher 0x00202008, 0x10202000, 0x00000000, 0x10200008, 0x00000008, 0x00002000, 0x10200000, 0x00202008, 0x00002000, 0x00200008, 0x10002008, 0x00000000, - 0x10202000, 0x10000000, 0x00200008, 0x10002008 + 0x10202000, 0x10000000, 0x00200008, 0x10002008, ]; /** @@ -522,7 +522,7 @@ class DES extends BlockCipher 0x00000401, 0x02000001, 0x02100401, 0x02100000, 0x00100400, 0x00000000, 0x00000001, 0x02100401, 0x00000000, 0x00100401, 0x02100000, 0x00000400, - 0x02000001, 0x02000400, 0x00000400, 0x00100001 + 0x02000001, 0x02000400, 0x00000400, 0x00100001, ]; /** @@ -546,7 +546,7 @@ class DES extends BlockCipher 0x00000000, 0x08020820, 0x00020020, 0x08000020, 0x08020000, 0x08000800, 0x08000820, 0x00000000, 0x08020820, 0x00020800, 0x00020800, 0x00000820, - 0x00000820, 0x00020020, 0x08000000, 0x08020800 + 0x00000820, 0x00020020, 0x08000000, 0x08020800, ]; /** @@ -725,7 +725,7 @@ class DES extends BlockCipher $this->kl = ['key' => $this->key, 'des_rounds' => $this->des_rounds]; static $shifts = [ // number of key bits shifted per round - 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 + 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, ]; static $pc1map = [ @@ -760,7 +760,7 @@ class DES extends BlockCipher 0xE0, 0xE0, 0xE8, 0xE8, 0xE4, 0xE4, 0xEC, 0xEC, 0xE2, 0xE2, 0xEA, 0xEA, 0xE6, 0xE6, 0xEE, 0xEE, 0xF0, 0xF0, 0xF8, 0xF8, 0xF4, 0xF4, 0xFC, 0xFC, - 0xF2, 0xF2, 0xFA, 0xFA, 0xF6, 0xF6, 0xFE, 0xFE + 0xF2, 0xF2, 0xFA, 0xFA, 0xF6, 0xF6, 0xFE, 0xFE, ]; // Mapping tables for the PC-2 transformation. @@ -768,7 +768,7 @@ class DES extends BlockCipher 0x00000000, 0x00000400, 0x00200000, 0x00200400, 0x00000001, 0x00000401, 0x00200001, 0x00200401, 0x02000000, 0x02000400, 0x02200000, 0x02200400, - 0x02000001, 0x02000401, 0x02200001, 0x02200401 + 0x02000001, 0x02000401, 0x02200001, 0x02200401, ]; static $pc2mapc2 = [ 0x00000000, 0x00000800, 0x08000000, 0x08000800, @@ -834,7 +834,7 @@ class DES extends BlockCipher 0x01040110, 0x01040910, 0x09040110, 0x09040910, 0x01050110, 0x01050910, 0x09050110, 0x09050910, 0x01040110, 0x01040910, 0x09040110, 0x09040910, - 0x01050110, 0x01050910, 0x09050110, 0x09050910 + 0x01050110, 0x01050910, 0x09050110, 0x09050910, ]; static $pc2mapc3 = [ 0x00000000, 0x00000004, 0x00001000, 0x00001004, @@ -900,7 +900,7 @@ class DES extends BlockCipher 0x20080022, 0x20080026, 0x20081022, 0x20081026, 0x20080022, 0x20080026, 0x20081022, 0x20081026, 0x30080022, 0x30080026, 0x30081022, 0x30081026, - 0x30080022, 0x30080026, 0x30081022, 0x30081026 + 0x30080022, 0x30080026, 0x30081022, 0x30081026, ]; static $pc2mapc4 = [ 0x00000000, 0x00100000, 0x00000008, 0x00100008, @@ -966,13 +966,13 @@ class DES extends BlockCipher 0x04022000, 0x04122000, 0x04022008, 0x04122008, 0x04022200, 0x04122200, 0x04022208, 0x04122208, 0x04022000, 0x04122000, 0x04022008, 0x04122008, - 0x04022200, 0x04122200, 0x04022208, 0x04122208 + 0x04022200, 0x04122200, 0x04022208, 0x04122208, ]; static $pc2mapd1 = [ 0x00000000, 0x00000001, 0x08000000, 0x08000001, 0x00200000, 0x00200001, 0x08200000, 0x08200001, 0x00000002, 0x00000003, 0x08000002, 0x08000003, - 0x00200002, 0x00200003, 0x08200002, 0x08200003 + 0x00200002, 0x00200003, 0x08200002, 0x08200003, ]; static $pc2mapd2 = [ 0x00000000, 0x00100000, 0x00000800, 0x00100800, @@ -1038,7 +1038,7 @@ class DES extends BlockCipher 0x00020204, 0x00120204, 0x00020A04, 0x00120A04, 0x00020204, 0x00120204, 0x00020A04, 0x00120A04, 0x04020204, 0x04120204, 0x04020A04, 0x04120A04, - 0x04020204, 0x04120204, 0x04020A04, 0x04120A04 + 0x04020204, 0x04120204, 0x04020A04, 0x04120A04, ]; static $pc2mapd3 = [ 0x00000000, 0x00010000, 0x02000000, 0x02010000, @@ -1104,7 +1104,7 @@ class DES extends BlockCipher 0x20002010, 0x20012010, 0x22002010, 0x22012010, 0x20002030, 0x20012030, 0x22002030, 0x22012030, 0x20042010, 0x20052010, 0x22042010, 0x22052010, - 0x20042030, 0x20052030, 0x22042030, 0x22052030 + 0x20042030, 0x20052030, 0x22042030, 0x22052030, ]; static $pc2mapd4 = [ 0x00000000, 0x00000400, 0x01000000, 0x01000400, @@ -1170,7 +1170,7 @@ class DES extends BlockCipher 0x10081008, 0x10081408, 0x11081008, 0x11081408, 0x10081008, 0x10081408, 0x11081008, 0x11081408, 0x10081108, 0x10081508, 0x11081108, 0x11081508, - 0x10081108, 0x10081508, 0x11081108, 0x11081508 + 0x10081108, 0x10081508, 0x11081108, 0x11081508, ]; $keys = []; @@ -1195,7 +1195,7 @@ class DES extends BlockCipher $keys[$des_round] = [ self::ENCRYPT => [], - self::DECRYPT => array_fill(0, 32, 0) + self::DECRYPT => array_fill(0, 32, 0), ]; for ($i = 0, $ki = 31; $i < 16; ++$i, $ki -= 2) { $c <<= $shifts[$i]; @@ -1233,14 +1233,14 @@ class DES extends BlockCipher $keys[2][self::DECRYPT], $keys[1][self::ENCRYPT], $keys[0][self::DECRYPT] - ) + ), ]; break; // case 1: // DES keys default: $this->keys = [ self::ENCRYPT => $keys[0][self::ENCRYPT], - self::DECRYPT => $keys[0][self::DECRYPT] + self::DECRYPT => $keys[0][self::DECRYPT], ]; } } @@ -1277,7 +1277,7 @@ class DES extends BlockCipher $k = [ self::ENCRYPT => $this->keys[self::ENCRYPT], - self::DECRYPT => $this->keys[self::DECRYPT] + self::DECRYPT => $this->keys[self::DECRYPT], ]; $init_encrypt = ''; $init_decrypt = ''; @@ -1352,7 +1352,7 @@ class DES extends BlockCipher 'init_encrypt' => $init_encrypt, 'init_decrypt' => $init_decrypt, 'encrypt_block' => $crypt_block[self::ENCRYPT], - 'decrypt_block' => $crypt_block[self::DECRYPT] + 'decrypt_block' => $crypt_block[self::DECRYPT], ] ); } diff --git a/phpseclib/Crypt/DH/Formats/Keys/PKCS1.php b/phpseclib/Crypt/DH/Formats/Keys/PKCS1.php index 93d9c987..a2dca24a 100644 --- a/phpseclib/Crypt/DH/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/DH/Formats/Keys/PKCS1.php @@ -64,7 +64,7 @@ abstract class PKCS1 extends Progenitor { $params = [ 'prime' => $prime, - 'base' => $base + 'base' => $base, ]; $params = ASN1::encodeDER($params, Maps\DHParameter::MAP); diff --git a/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php b/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php index 493eaba2..c774f0c0 100644 --- a/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php @@ -107,7 +107,7 @@ abstract class PKCS8 extends Progenitor { $params = [ 'prime' => $prime, - 'base' => $base + 'base' => $base, ]; $params = ASN1::encodeDER($params, Maps\DHParameter::MAP); $params = new ASN1\Element($params); @@ -124,7 +124,7 @@ abstract class PKCS8 extends Progenitor { $params = [ 'prime' => $prime, - 'base' => $base + 'base' => $base, ]; $params = ASN1::encodeDER($params, Maps\DHParameter::MAP); $params = new ASN1\Element($params); diff --git a/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php b/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php index a59d8e80..37926aab 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php @@ -82,7 +82,7 @@ abstract class PKCS1 extends Progenitor $key = [ 'p' => $p, 'q' => $q, - 'g' => $g + 'g' => $g, ]; $key = ASN1::encodeDER($key, Maps\DSAParams::MAP); @@ -106,7 +106,7 @@ abstract class PKCS1 extends Progenitor 'q' => $q, 'g' => $g, 'y' => $y, - 'x' => $x + 'x' => $x, ]; $key = ASN1::encodeDER($key, Maps\DSAPrivateKey::MAP); diff --git a/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php b/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php index 911cef3f..f5a440a0 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php @@ -118,7 +118,7 @@ abstract class PKCS8 extends Progenitor $params = [ 'p' => $p, 'q' => $q, - 'g' => $g + 'g' => $g, ]; $params = ASN1::encodeDER($params, Maps\DSAParams::MAP); $params = new ASN1\Element($params); @@ -136,7 +136,7 @@ abstract class PKCS8 extends Progenitor $params = [ 'p' => $p, 'q' => $q, - 'g' => $g + 'g' => $g, ]; $params = ASN1::encodeDER($params, Maps\DSAParams::MAP); $params = new ASN1\Element($params); diff --git a/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php b/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php index 6dba270a..5d1ba361 100644 --- a/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php +++ b/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php @@ -47,7 +47,7 @@ abstract class SSH2 return [ 'r' => new BigInteger(substr($blob, 0, 20), 256), - 's' => new BigInteger(substr($blob, 20), 256) + 's' => new BigInteger(substr($blob, 20), 256), ]; } diff --git a/phpseclib/Crypt/EC/BaseCurves/Base.php b/phpseclib/Crypt/EC/BaseCurves/Base.php index 325b9a64..0be3cd2a 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Base.php +++ b/phpseclib/Crypt/EC/BaseCurves/Base.php @@ -189,7 +189,7 @@ abstract class Base { $temp = [ $p[0], - $p[1]->negate() + $p[1]->negate(), ]; if (isset($p[2])) { $temp[] = $p[2]; diff --git a/phpseclib/Crypt/EC/BaseCurves/Binary.php b/phpseclib/Crypt/EC/BaseCurves/Binary.php index 209cce45..bfd2636d 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Binary.php +++ b/phpseclib/Crypt/EC/BaseCurves/Binary.php @@ -125,7 +125,7 @@ class Binary extends Base } $this->p = [ is_string($x) ? $this->factory->newInteger(pack('H*', $x)) : $x, - is_string($y) ? $this->factory->newInteger(pack('H*', $y)) : $y + is_string($y) ? $this->factory->newInteger(pack('H*', $y)) : $y, ]; } @@ -346,7 +346,7 @@ class Binary extends Base $z2 = $z->multiply($z); return [ $x->multiply($z2), - $y->multiply($z2)->multiply($z) + $y->multiply($z2)->multiply($z), ]; } diff --git a/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php b/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php index 780f0f5a..d3ca4628 100644 --- a/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php +++ b/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php @@ -77,7 +77,7 @@ class KoblitzPrime extends Prime $s = $this->three->negate()->squareRoot()->multiply($inv); $betas = [ $inv->add($s), - $inv->subtract($s) + $inv->subtract($s), ]; $this->beta = $betas[0]->compare($betas[1]) < 0 ? $betas[0] : $betas[1]; //echo strtoupper($this->beta->toHex(true)) . "\n"; exit; @@ -94,7 +94,7 @@ class KoblitzPrime extends Prime $lambdas = [ $inv->add($s), - $inv->subtract($s) + $inv->subtract($s), ]; $lhs = $this->multiplyPoint($this->p, $lambdas[0])[0]; @@ -143,7 +143,7 @@ class KoblitzPrime extends Prime $beta = [ $p[0]->multiply($this->beta), $p[1], - clone $this->one + clone $this->one, ]; if (isset($p['naf'])) { @@ -151,7 +151,7 @@ class KoblitzPrime extends Prime return [ $p[0]->multiply($this->beta), $p[1], - clone $this->one + clone $this->one, ]; }, $p['naf']); $beta['nafwidth'] = $p['nafwidth']; @@ -324,7 +324,7 @@ class KoblitzPrime extends Prime return [ ['a' => $a1, 'b' => $b1], - ['a' => $a2, 'b' => $b2] + ['a' => $a2, 'b' => $b2], ]; } } diff --git a/phpseclib/Crypt/EC/BaseCurves/Montgomery.php b/phpseclib/Crypt/EC/BaseCurves/Montgomery.php index 66c98817..d2fb6da4 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Montgomery.php +++ b/phpseclib/Crypt/EC/BaseCurves/Montgomery.php @@ -139,7 +139,7 @@ class Montgomery extends Base } $this->p = [ $x instanceof BigInteger ? $this->factory->newInteger($x) : $x, - $y instanceof BigInteger ? $this->factory->newInteger($y) : $y + $y instanceof BigInteger ? $this->factory->newInteger($y) : $y, ]; } @@ -204,7 +204,7 @@ class Montgomery extends Base return [ [$x4, $z4], - [$x5, $z5] + [$x5, $z5], ]; } diff --git a/phpseclib/Crypt/EC/BaseCurves/Prime.php b/phpseclib/Crypt/EC/BaseCurves/Prime.php index 93b55a15..1d471e05 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Prime.php +++ b/phpseclib/Crypt/EC/BaseCurves/Prime.php @@ -159,7 +159,7 @@ class Prime extends Base } $this->p = [ $x instanceof BigInteger ? $this->factory->newInteger($x) : $x, - $y instanceof BigInteger ? $this->factory->newInteger($y) : $y + $y instanceof BigInteger ? $this->factory->newInteger($y) : $y, ]; } @@ -549,7 +549,7 @@ class Prime extends Base $points[$a], // 1 null, // 3 null, // 5 - $points[$b] // 7 + $points[$b], // 7 ]; $comb[1] = $this->addPoint($points[$a], $points[$b]); @@ -564,7 +564,7 @@ class Prime extends Base 7, /* 0 1 */ 5, /* 1 -1 */ 1, /* 1 0 */ - 3 /* 1 1 */ + 3, /* 1 1 */ ]; $jsf = self::getJSFPoints($scalars[$a], $scalars[$b]); @@ -760,7 +760,7 @@ class Prime extends Base $z2 = $z->multiply($z); return [ $x->multiply($z2), - $y->multiply($z2)->multiply($z) + $y->multiply($z2)->multiply($z), ]; } diff --git a/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php b/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php index efd3833f..0cb0e206 100644 --- a/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php +++ b/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php @@ -128,7 +128,7 @@ class TwistedEdwards extends Base } $this->p = [ $x instanceof BigInteger ? $this->factory->newInteger($x) : $x, - $y instanceof BigInteger ? $this->factory->newInteger($y) : $y + $y instanceof BigInteger ? $this->factory->newInteger($y) : $y, ]; } @@ -182,7 +182,7 @@ class TwistedEdwards extends Base $z = $this->one->divide($z); return [ $x->multiply($z), - $y->multiply($z) + $y->multiply($z), ]; } diff --git a/phpseclib/Crypt/EC/Curves/secp160k1.php b/phpseclib/Crypt/EC/Curves/secp160k1.php index 6a4d273c..f86aa1a4 100644 --- a/phpseclib/Crypt/EC/Curves/secp160k1.php +++ b/phpseclib/Crypt/EC/Curves/secp160k1.php @@ -37,11 +37,11 @@ class secp160k1 extends KoblitzPrime $this->basis = []; $this->basis[] = [ 'a' => new BigInteger('0096341F1138933BC2F505', -16), - 'b' => new BigInteger('FF6E9D0418C67BB8D5F562', -16) + 'b' => new BigInteger('FF6E9D0418C67BB8D5F562', -16), ]; $this->basis[] = [ 'a' => new BigInteger('01BDCB3A09AAAABEAFF4A8', -16), - 'b' => new BigInteger('04D12329FF0EF498EA67', -16) + 'b' => new BigInteger('04D12329FF0EF498EA67', -16), ]; $this->beta = $this->factory->newInteger(new BigInteger('645B7345A143464942CC46D7CF4D5D1E1E6CBB68', -16)); } diff --git a/phpseclib/Crypt/EC/Curves/secp192k1.php b/phpseclib/Crypt/EC/Curves/secp192k1.php index 952c56e0..0515e0b5 100644 --- a/phpseclib/Crypt/EC/Curves/secp192k1.php +++ b/phpseclib/Crypt/EC/Curves/secp192k1.php @@ -36,11 +36,11 @@ class secp192k1 extends KoblitzPrime $this->basis = []; $this->basis[] = [ 'a' => new BigInteger('00B3FB3400DEC5C4ADCEB8655C', -16), - 'b' => new BigInteger('8EE96418CCF4CFC7124FDA0F', -16) + 'b' => new BigInteger('8EE96418CCF4CFC7124FDA0F', -16), ]; $this->basis[] = [ 'a' => new BigInteger('01D90D03E8F096B9948B20F0A9', -16), - 'b' => new BigInteger('42E49819ABBA9474E1083F6B', -16) + 'b' => new BigInteger('42E49819ABBA9474E1083F6B', -16), ]; $this->beta = $this->factory->newInteger(new BigInteger('447A96E6C647963E2F7809FEAAB46947F34B0AA3CA0BBA74', -16)); } diff --git a/phpseclib/Crypt/EC/Curves/secp224k1.php b/phpseclib/Crypt/EC/Curves/secp224k1.php index bf45dc82..4796a568 100644 --- a/phpseclib/Crypt/EC/Curves/secp224k1.php +++ b/phpseclib/Crypt/EC/Curves/secp224k1.php @@ -36,11 +36,11 @@ class secp224k1 extends KoblitzPrime $this->basis = []; $this->basis[] = [ 'a' => new BigInteger('00B8ADF1378A6EB73409FA6C9C637D', -16), - 'b' => new BigInteger('94730F82B358A3776A826298FA6F', -16) + 'b' => new BigInteger('94730F82B358A3776A826298FA6F', -16), ]; $this->basis[] = [ 'a' => new BigInteger('01DCE8D2EC6184CAF0A972769FCC8B', -16), - 'b' => new BigInteger('4D2100BA3DC75AAB747CCF355DEC', -16) + 'b' => new BigInteger('4D2100BA3DC75AAB747CCF355DEC', -16), ]; $this->beta = $this->factory->newInteger(new BigInteger('01F178FFA4B17C89E6F73AECE2AAD57AF4C0A748B63C830947B27E04', -16)); } diff --git a/phpseclib/Crypt/EC/Curves/secp256k1.php b/phpseclib/Crypt/EC/Curves/secp256k1.php index e886e592..8ec9e3ac 100644 --- a/phpseclib/Crypt/EC/Curves/secp256k1.php +++ b/phpseclib/Crypt/EC/Curves/secp256k1.php @@ -40,11 +40,11 @@ class secp256k1 extends KoblitzPrime $this->basis = []; $this->basis[] = [ 'a' => new BigInteger('3086D221A7D46BCDE86C90E49284EB15', -16), - 'b' => new BigInteger('FF1BBC8129FEF177D790AB8056F5401B3D', -16) + 'b' => new BigInteger('FF1BBC8129FEF177D790AB8056F5401B3D', -16), ]; $this->basis[] = [ 'a' => new BigInteger('114CA50F7A8E2F3F657C1108D9D44CFD8', -16), - 'b' => new BigInteger('3086D221A7D46BCDE86C90E49284EB15', -16) + 'b' => new BigInteger('3086D221A7D46BCDE86C90E49284EB15', -16), ]; $this->beta = $this->factory->newInteger(new BigInteger('7AE96A2B657C07106E64479EAC3434E99CF0497512F58995C1396C28719501EE', -16)); } diff --git a/phpseclib/Crypt/EC/Formats/Keys/Common.php b/phpseclib/Crypt/EC/Formats/Keys/Common.php index 913108ff..0489263e 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/Common.php +++ b/phpseclib/Crypt/EC/Formats/Keys/Common.php @@ -166,7 +166,7 @@ trait Common 'brainpoolP384r1' => '1.3.36.3.3.2.8.1.1.11', 'brainpoolP384t1' => '1.3.36.3.3.2.8.1.1.12', 'brainpoolP512r1' => '1.3.36.3.3.2.8.1.1.13', - 'brainpoolP512t1' => '1.3.36.3.3.2.8.1.1.14' + 'brainpoolP512t1' => '1.3.36.3.3.2.8.1.1.14', ]; ASN1::loadOIDs([ 'prime-field' => '1.2.840.10045.1.1', @@ -175,7 +175,7 @@ trait Common // per http://www.secg.org/SEC1-Ver-1.0.pdf#page=84, gnBasis "not used here" 'gnBasis' => '1.2.840.10045.1.2.3.1', // NULL 'tpBasis' => '1.2.840.10045.1.2.3.2', // Trinomial - 'ppBasis' => '1.2.840.10045.1.2.3.3' // Pentanomial + 'ppBasis' => '1.2.840.10045.1.2.3.3', // Pentanomial ] + self::$curveOIDs); } } @@ -316,7 +316,7 @@ trait Common } $point = [ $curve->convertInteger(new BigInteger($x, 256)), - $curve->convertInteger(new BigInteger($y, 256)) + $curve->convertInteger(new BigInteger($y, 256)), ]; if (!$curve->verifyPoint($point)) { @@ -449,14 +449,14 @@ trait Common 'version' => 'ecdpVer1', 'fieldID' => [ 'fieldType' => 'prime-field', - 'parameters' => $curve->getModulo() + 'parameters' => $curve->getModulo(), ], 'curve' => [ 'a' => $curve->getA()->toBytes(), - 'b' => $curve->getB()->toBytes() + 'b' => $curve->getB()->toBytes(), ], 'base' => "\4" . $x . $y, - 'order' => $order + 'order' => $order, ]; return $returnArray ? @@ -480,7 +480,7 @@ trait Common $modulo = [ 'k1' => new BigInteger($modulo[2]), 'k2' => new BigInteger($modulo[1]), - 'k3' => new BigInteger($modulo[0]) + 'k3' => new BigInteger($modulo[0]), ]; $modulo = ASN1::encodeDER($modulo, Maps\Pentanomial::MAP); $modulo = new ASN1\Element($modulo); @@ -488,7 +488,7 @@ trait Common $params = ASN1::encodeDER([ 'm' => new BigInteger($m), 'basis' => $basis, - 'parameters' => $modulo + 'parameters' => $modulo, ], Maps\Characteristic_two::MAP); $params = new ASN1\Element($params); $a = ltrim($curve->getA()->toBytes(), "\0"); @@ -503,14 +503,14 @@ trait Common 'version' => 'ecdpVer1', 'fieldID' => [ 'fieldType' => 'characteristic-two-field', - 'parameters' => $params + 'parameters' => $params, ], 'curve' => [ 'a' => $a, - 'b' => $b + 'b' => $b, ], 'base' => "\4" . $x . $y, - 'order' => $order + 'order' => $order, ]; return $returnArray ? diff --git a/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php b/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php index 48990e1c..84f1d108 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php +++ b/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php @@ -42,7 +42,7 @@ abstract class OpenSSH extends Progenitor 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', - 'ssh-ed25519' + 'ssh-ed25519', ]; /** @@ -73,7 +73,7 @@ abstract class OpenSSH extends Progenitor 'curve' => $curve, 'dA' => $privateKey, 'QA' => self::extractPoint("\0$publicKey", $curve), - 'comment' => $comment + 'comment' => $comment, ]; } @@ -95,7 +95,7 @@ abstract class OpenSSH extends Progenitor return [ 'curve' => $curve, 'QA' => $qa, - 'comment' => $parsed['comment'] + 'comment' => $parsed['comment'], ]; } diff --git a/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php b/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php index 77f631bb..efa61230 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php @@ -178,7 +178,7 @@ abstract class PKCS1 extends Progenitor 'version' => 'ecPrivkeyVer1', 'privateKey' => $privateKey->toBytes(), 'parameters' => new ASN1\Element(self::encodeParameters($curve)), - 'publicKey' => "\0" . $publicKey + 'publicKey' => "\0" . $publicKey, ]; $key = ASN1::encodeDER($key, Maps\ECPrivateKey::MAP); diff --git a/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php b/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php index 6ea8d81e..c1c89c67 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php @@ -229,7 +229,7 @@ abstract class PKCS8 extends Progenitor 'version' => 'ecPrivkeyVer1', 'privateKey' => $privateKey->toBytes(), //'parameters' => $params, - 'publicKey' => "\0" . $publicKey + 'publicKey' => "\0" . $publicKey, ]; $key = ASN1::encodeDER($key, Maps\ECPrivateKey::MAP); diff --git a/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php b/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php index 9d00b3b9..889324d7 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php +++ b/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php @@ -47,7 +47,7 @@ abstract class PuTTY extends Progenitor 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', - 'ssh-ed25519' + 'ssh-ed25519', ]; /** diff --git a/phpseclib/Crypt/EC/Formats/Keys/XML.php b/phpseclib/Crypt/EC/Formats/Keys/XML.php index 894b2fed..7e34f3b6 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/XML.php +++ b/phpseclib/Crypt/EC/Formats/Keys/XML.php @@ -178,7 +178,7 @@ abstract class XML } $point = [ $curve->convertInteger(new BigInteger($x->item(0)->getAttribute('Value'))), - $curve->convertInteger(new BigInteger($y->item(0)->getAttribute('Value'))) + $curve->convertInteger(new BigInteger($y->item(0)->getAttribute('Value'))), ]; if (!$curve->verifyPoint($point)) { throw new \RuntimeException('Unable to verify that point exists on curve'); @@ -225,7 +225,7 @@ abstract class XML 'gnb' => ['fieldid/gnb/m'], 'tnb' => ['fieldid/tnb/k'], 'pnb' => ['fieldid/pnb/k1', 'fieldid/pnb/k2', 'fieldid/pnb/k3'], - 'unknown' => [] + 'unknown' => [], ]; foreach ($fieldTypes as $type => $queries) { @@ -275,7 +275,7 @@ abstract class XML { $fieldTypes = [ 'prime-field' => ['primefieldparamstype/p'], - 'unknown' => [] + 'unknown' => [], ]; foreach ($fieldTypes as $type => $queries) { diff --git a/phpseclib/Crypt/EC/Formats/Signature/SSH2.php b/phpseclib/Crypt/EC/Formats/Signature/SSH2.php index dd1f1122..c380ea0d 100644 --- a/phpseclib/Crypt/EC/Formats/Signature/SSH2.php +++ b/phpseclib/Crypt/EC/Formats/Signature/SSH2.php @@ -58,7 +58,7 @@ abstract class SSH2 return [ 'r' => $result[0], - 's' => $result[1] + 's' => $result[1], ]; } diff --git a/phpseclib/Crypt/Hash.php b/phpseclib/Crypt/Hash.php index af270574..afeba8e6 100644 --- a/phpseclib/Crypt/Hash.php +++ b/phpseclib/Crypt/Hash.php @@ -389,7 +389,7 @@ class Hash 'capacity' => 1600 - $this->blockSize, 'rate' => $this->blockSize, 'length' => $this->length, - 'padding' => $this->paddingType + 'padding' => $this->paddingType, ]; $hash = ['phpseclib3\Crypt\Hash', PHP_INT_SIZE == 8 ? 'sha3_64' : 'sha3_32']; } @@ -403,11 +403,11 @@ class Hash $initial = $hash == 'sha512/256' ? [ '22312194FC2BF72C', '9F555FA3C84C64C2', '2393B86B6F53B151', '963877195940EABD', - '96283EE2A88EFFE3', 'BE5E1E2553863992', '2B0199FC2C85B8AA', '0EB72DDC81C52CA2' + '96283EE2A88EFFE3', 'BE5E1E2553863992', '2B0199FC2C85B8AA', '0EB72DDC81C52CA2', ] : [ '8C3D37C819544DA2', '73E1996689DCD4D6', '1DFAB7AE32FF9C82', '679DD514582F9FCF', - '0F6D2B697BD44DA8', '77E36F7304C48942', '3F9D85A86A1D36C8', '1112E6AD91D692A1' + '0F6D2B697BD44DA8', '77E36F7304C48942', '3F9D85A86A1D36C8', '1112E6AD91D692A1', ]; for ($i = 0; $i < 8; $i++) { $initial[$i] = new BigInteger($initial[$i], 16); @@ -936,7 +936,7 @@ class Hash [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], - [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]] + [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], ]; $p = str_split($p, $block_size); @@ -982,7 +982,7 @@ class Hash [36, 44, 6, 55, 20], [ 3, 10, 43, 25, 39], [41, 45, 15, 21, 8], - [18, 2, 61, 56, 14] + [18, 2, 61, 56, 14], ]; // the standards give these constants in hexadecimal notation. it's tempting to want to use @@ -1012,7 +1012,7 @@ class Hash [-2147483648, -2147450751], [-2147483648, 32896], [0, -2147483647], - [-2147483648, -2147450872] + [-2147483648, -2147450872], ]; for ($round = 0; $round < 24; $round++) { @@ -1021,7 +1021,7 @@ class Hash for ($i = 0; $i < 5; $i++) { $parity[] = [ $s[0][$i][0] ^ $s[1][$i][0] ^ $s[2][$i][0] ^ $s[3][$i][0] ^ $s[4][$i][0], - $s[0][$i][1] ^ $s[1][$i][1] ^ $s[2][$i][1] ^ $s[3][$i][1] ^ $s[4][$i][1] + $s[0][$i][1] ^ $s[1][$i][1] ^ $s[2][$i][1] ^ $s[3][$i][1] ^ $s[4][$i][1], ]; $rotated[] = static::rotateLeft32($parity[$i], 1); } @@ -1031,7 +1031,7 @@ class Hash [$parity[0][0] ^ $rotated[2][0], $parity[0][1] ^ $rotated[2][1]], [$parity[1][0] ^ $rotated[3][0], $parity[1][1] ^ $rotated[3][1]], [$parity[2][0] ^ $rotated[4][0], $parity[2][1] ^ $rotated[4][1]], - [$parity[3][0] ^ $rotated[0][0], $parity[3][1] ^ $rotated[0][1]] + [$parity[3][0] ^ $rotated[0][0], $parity[3][1] ^ $rotated[0][1]], ]; for ($i = 0; $i < 5; $i++) { for ($j = 0; $j < 5; $j++) { @@ -1053,23 +1053,23 @@ class Hash for ($i = 0; $i < 5; $i++) { $s[$i][0] = [ $st[$i][0][0] ^ (~$st[$i][1][0] & $st[$i][2][0]), - $st[$i][0][1] ^ (~$st[$i][1][1] & $st[$i][2][1]) + $st[$i][0][1] ^ (~$st[$i][1][1] & $st[$i][2][1]), ]; $s[$i][1] = [ $st[$i][1][0] ^ (~$st[$i][2][0] & $st[$i][3][0]), - $st[$i][1][1] ^ (~$st[$i][2][1] & $st[$i][3][1]) + $st[$i][1][1] ^ (~$st[$i][2][1] & $st[$i][3][1]), ]; $s[$i][2] = [ $st[$i][2][0] ^ (~$st[$i][3][0] & $st[$i][4][0]), - $st[$i][2][1] ^ (~$st[$i][3][1] & $st[$i][4][1]) + $st[$i][2][1] ^ (~$st[$i][3][1] & $st[$i][4][1]), ]; $s[$i][3] = [ $st[$i][3][0] ^ (~$st[$i][4][0] & $st[$i][0][0]), - $st[$i][3][1] ^ (~$st[$i][4][1] & $st[$i][0][1]) + $st[$i][3][1] ^ (~$st[$i][4][1] & $st[$i][0][1]), ]; $s[$i][4] = [ $st[$i][4][0] ^ (~$st[$i][0][0] & $st[$i][1][0]), - $st[$i][4][1] ^ (~$st[$i][0][1] & $st[$i][1][1]) + $st[$i][4][1] ^ (~$st[$i][0][1] & $st[$i][1][1]), ]; } @@ -1093,7 +1093,7 @@ class Hash return [ ($hi << $shift) | (($lo >> (32 - $shift)) & (1 << $shift) - 1), - ($lo << $shift) | (($hi >> (32 - $shift)) & (1 << $shift) - 1) + ($lo << $shift) | (($hi >> (32 - $shift)) & (1 << $shift) - 1), ]; } @@ -1115,7 +1115,7 @@ class Hash [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], - [0, 0, 0, 0, 0] + [0, 0, 0, 0, 0], ]; $p = str_split($p, $block_size); @@ -1160,7 +1160,7 @@ class Hash [36, 44, 6, 55, 20], [ 3, 10, 43, 25, 39], [41, 45, 15, 21, 8], - [18, 2, 61, 56, 14] + [18, 2, 61, 56, 14], ]; static $roundConstants = [ @@ -1187,7 +1187,7 @@ class Hash -9223372034707259263, -9223372036854742912, 2147483649, - -9223372034707259384 + -9223372034707259384, ]; for ($round = 0; $round < 24; $round++) { @@ -1201,7 +1201,7 @@ class Hash $parity[0] ^ static::rotateLeft64($parity[2], 1), $parity[1] ^ static::rotateLeft64($parity[3], 1), $parity[2] ^ static::rotateLeft64($parity[4], 1), - $parity[3] ^ static::rotateLeft64($parity[0], 1) + $parity[3] ^ static::rotateLeft64($parity[0], 1), ]; for ($i = 0; $i < 5; $i++) { for ($j = 0; $j < 5; $j++) { @@ -1225,7 +1225,7 @@ class Hash $st[$i][1] ^ (~$st[$i][2] & $st[$i][3]), $st[$i][2] ^ (~$st[$i][3] & $st[$i][4]), $st[$i][3] ^ (~$st[$i][4] & $st[$i][0]), - $st[$i][4] ^ (~$st[$i][0] & $st[$i][1]) + $st[$i][4] ^ (~$st[$i][0] & $st[$i][1]), ]; } @@ -1272,7 +1272,7 @@ class Hash 'ca273eceea26619c', 'd186b8c721c0c207', 'eada7dd6cde0eb1e', 'f57d4f7fee6ed178', '06f067aa72176fba', '0a637dc5a2c898a6', '113f9804bef90dae', '1b710b35131c471b', '28db77f523047d84', '32caab7b40c72493', '3c9ebe0a15c9bebc', '431d67c49c100d4c', - '4cc5d4becb3e42b6', '597f299cfc657e2a', '5fcb6fab3ad6faec', '6c44198c4a475817' + '4cc5d4becb3e42b6', '597f299cfc657e2a', '5fcb6fab3ad6faec', '6c44198c4a475817', ]; for ($i = 0; $i < 80; $i++) { @@ -1303,14 +1303,14 @@ class Hash $temp = [ $w[$i - 15]->bitwise_rightRotate(1), $w[$i - 15]->bitwise_rightRotate(8), - $w[$i - 15]->bitwise_rightShift(7) + $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_rightShift(6), ]; $s1 = $temp[0]->bitwise_xor($temp[1]); $s1 = $s1->bitwise_xor($temp[2]); @@ -1335,14 +1335,14 @@ class Hash $temp = [ $a->bitwise_rightRotate(28), $a->bitwise_rightRotate(34), - $a->bitwise_rightRotate(39) + $a->bitwise_rightRotate(39), ]; $s0 = $temp[0]->bitwise_xor($temp[1]); $s0 = $s0->bitwise_xor($temp[2]); $temp = [ $a->bitwise_and($b), $a->bitwise_and($c), - $b->bitwise_and($c) + $b->bitwise_and($c), ]; $maj = $temp[0]->bitwise_xor($temp[1]); $maj = $maj->bitwise_xor($temp[2]); @@ -1351,13 +1351,13 @@ class Hash $temp = [ $e->bitwise_rightRotate(14), $e->bitwise_rightRotate(18), - $e->bitwise_rightRotate(41) + $e->bitwise_rightRotate(41), ]; $s1 = $temp[0]->bitwise_xor($temp[1]); $s1 = $s1->bitwise_xor($temp[2]); $temp = [ $e->bitwise_and($f), - $g->bitwise_and($e->bitwise_not()) + $g->bitwise_and($e->bitwise_not()), ]; $ch = $temp[0]->bitwise_xor($temp[1]); $t1 = $h->add($s1); @@ -1384,7 +1384,7 @@ class Hash $hash[4]->add($e), $hash[5]->add($f), $hash[6]->add($g), - $hash[7]->add($h) + $hash[7]->add($h), ]; } diff --git a/phpseclib/Crypt/RC2.php b/phpseclib/Crypt/RC2.php index a7b8e525..b83422f4 100644 --- a/phpseclib/Crypt/RC2.php +++ b/phpseclib/Crypt/RC2.php @@ -182,7 +182,7 @@ class RC2 extends BlockCipher 0x0D, 0x38, 0x34, 0x1B, 0xAB, 0x33, 0xFF, 0xB0, 0xBB, 0x48, 0x0C, 0x5F, 0xB9, 0xB1, 0xCD, 0x2E, 0xC5, 0xF3, 0xDB, 0x47, 0xE5, 0xA5, 0x9C, 0x77, - 0x0A, 0xA6, 0x20, 0x68, 0xFE, 0x7F, 0xC1, 0xAD + 0x0A, 0xA6, 0x20, 0x68, 0xFE, 0x7F, 0xC1, 0xAD, ]; /** @@ -223,7 +223,7 @@ class RC2 extends BlockCipher 0xA1, 0xD4, 0xDD, 0xC4, 0x56, 0xF4, 0xD2, 0x77, 0x81, 0x09, 0x82, 0x33, 0x9F, 0x07, 0x86, 0x75, 0x38, 0x4E, 0x69, 0xF1, 0xAD, 0x23, 0x73, 0x87, - 0x70, 0x02, 0xC2, 0x1E, 0xB8, 0x0A, 0xFC, 0xE6 + 0x70, 0x02, 0xC2, 0x1E, 0xB8, 0x0A, 0xFC, 0xE6, ]; /** @@ -599,7 +599,7 @@ class RC2 extends BlockCipher [ 'init_crypt' => $init_crypt, 'encrypt_block' => $encrypt_block, - 'decrypt_block' => $decrypt_block + 'decrypt_block' => $decrypt_block, ] ); } diff --git a/phpseclib/Crypt/RC4.php b/phpseclib/Crypt/RC4.php index 4b62c439..6745ba3d 100644 --- a/phpseclib/Crypt/RC4.php +++ b/phpseclib/Crypt/RC4.php @@ -228,7 +228,7 @@ class RC4 extends StreamCipher $this->stream[self::DECRYPT] = $this->stream[self::ENCRYPT] = [ 0, // index $i 0, // index $j - $keyStream + $keyStream, ]; } diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 323290f9..0374eae1 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -339,7 +339,7 @@ abstract class RSA extends AsymmetricKey $exponents = $coefficients = $primes = []; $lcm = [ 'top' => clone self::$one, - 'bottom' => false + 'bottom' => false, ]; do { @@ -794,7 +794,7 @@ abstract class RSA extends AsymmetricKey $masks = [ self::ENCRYPTION_OAEP, self::ENCRYPTION_PKCS1, - self::ENCRYPTION_NONE + self::ENCRYPTION_NONE, ]; $numSelected = 0; $selected = 0; @@ -812,7 +812,7 @@ abstract class RSA extends AsymmetricKey $masks = [ self::SIGNATURE_PSS, self::SIGNATURE_RELAXED_PKCS1, - self::SIGNATURE_PKCS1 + self::SIGNATURE_PKCS1, ]; $numSelected = 0; $selected = 0; diff --git a/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php b/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php index 579c3fac..2a86f2d1 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php @@ -83,7 +83,7 @@ abstract class OpenSSH extends Progenitor 'isPublicKey' => true, 'modulus' => $modulus, 'publicExponent' => $publicExponent, - 'comment' => $parsed['comment'] + 'comment' => $parsed['comment'], ]; } diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php b/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php index a5723558..0a35afba 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php @@ -72,7 +72,7 @@ abstract class PKCS1 extends Progenitor 'privateExponent' => $key['privateExponent'], 'primes' => [1 => $key['prime1'], $key['prime2']], 'exponents' => [1 => $key['exponent1'], $key['exponent2']], - 'coefficients' => [2 => $key['coefficient']] + 'coefficients' => [2 => $key['coefficient']], ]; if ($key['version'] == 'multi') { foreach ($key['otherPrimeInfos'] as $primeInfo) { @@ -118,13 +118,13 @@ abstract class PKCS1 extends Progenitor 'prime2' => $primes[2], 'exponent1' => $exponents[1], 'exponent2' => $exponents[2], - 'coefficient' => $coefficients[2] + 'coefficient' => $coefficients[2], ]; for ($i = 3; $i <= $num_primes; $i++) { $key['otherPrimeInfos'][] = [ 'prime' => $primes[$i], 'exponent' => $exponents[$i], - 'coefficient' => $coefficients[$i] + 'coefficient' => $coefficients[$i], ]; } @@ -140,7 +140,7 @@ abstract class PKCS1 extends Progenitor { $key = [ 'modulus' => $n, - 'publicExponent' => $e + 'publicExponent' => $e, ]; $key = ASN1::encodeDER($key, Maps\RSAPublicKey::MAP); diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PSS.php b/phpseclib/Crypt/RSA/Formats/Keys/PSS.php index e4b64dda..bf3b09bb 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PSS.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PSS.php @@ -84,7 +84,7 @@ abstract class PSS extends Progenitor 'id-sha512/224' => '2.16.840.1.101.3.4.2.5', 'id-sha512/256' => '2.16.840.1.101.3.4.2.6', - 'id-mgf1' => '1.2.840.113549.1.1.8' + 'id-mgf1' => '1.2.840.113549.1.1.8', ]); self::$oidsLoaded = true; } @@ -130,7 +130,7 @@ abstract class PSS extends Progenitor } else { $params['maskGenAlgorithm'] = [ 'algorithm' => 'id-mgf1', - 'parameters' => ['algorithm' => 'id-sha1'] + 'parameters' => ['algorithm' => 'id-sha1'], ]; } @@ -202,7 +202,7 @@ abstract class PSS extends Progenitor source: https://tools.ietf.org/html/rfc4055#page-9 */ $params = [ - 'trailerField' => new BigInteger(1) + 'trailerField' => new BigInteger(1), ]; if (isset($options['hash'])) { $params['hashAlgorithm']['algorithm'] = 'id-' . $options['hash']; @@ -212,7 +212,7 @@ abstract class PSS extends Progenitor $temp = ASN1::encodeDER($temp, Maps\HashAlgorithm::MAP); $params['maskGenAlgorithm'] = [ 'algorithm' => 'id-mgf1', - 'parameters' => new ASN1\Element($temp) + 'parameters' => new ASN1\Element($temp), ]; } if (isset($options['saltLength'])) { diff --git a/phpseclib/Crypt/RSA/Formats/Keys/Raw.php b/phpseclib/Crypt/RSA/Formats/Keys/Raw.php index 73b27a5e..ff667dee 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/Raw.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/Raw.php @@ -73,7 +73,7 @@ abstract class Raw } elseif (isset($key['p']) && isset($key['q'])) { $indices = [ ['p', 'q'], - ['prime1', 'prime2'] + ['prime1', 'prime2'], ]; foreach ($indices as $index) { [$i0, $i1] = $index; @@ -88,7 +88,7 @@ abstract class Raw } else { $indices = [ ['dp', 'dq'], - ['exponent1', 'exponent2'] + ['exponent1', 'exponent2'], ]; foreach ($indices as $index) { [$i0, $i1] = $index; @@ -157,7 +157,7 @@ abstract class Raw }, $exponents), 'coefficients' => array_map(function ($var) { return clone $var; - }, $coefficients) + }, $coefficients), ]); } diff --git a/phpseclib/Crypt/RSA/Formats/Keys/XML.php b/phpseclib/Crypt/RSA/Formats/Keys/XML.php index 8de03ad6..e0287c04 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/XML.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/XML.php @@ -54,7 +54,7 @@ abstract class XML 'isPublicKey' => false, 'primes' => [], 'exponents' => [], - 'coefficients' => [] + 'coefficients' => [], ]; $use_errors = libxml_use_internal_errors(true); diff --git a/phpseclib/Crypt/RSA/PrivateKey.php b/phpseclib/Crypt/RSA/PrivateKey.php index 315500df..78633916 100644 --- a/phpseclib/Crypt/RSA/PrivateKey.php +++ b/phpseclib/Crypt/RSA/PrivateKey.php @@ -100,7 +100,7 @@ class PrivateKey extends RSA implements Common\PrivateKey if (!static::$enableBlinding) { $m_i = [ 1 => $x->modPow($this->exponents[1], $this->primes[1]), - 2 => $x->modPow($this->exponents[2], $this->primes[2]) + 2 => $x->modPow($this->exponents[2], $this->primes[2]), ]; $h = $m_i[1]->subtract($m_i[2]); $h = $h->multiply($this->coefficients[2]); @@ -131,7 +131,7 @@ class PrivateKey extends RSA implements Common\PrivateKey $m_i = [ 1 => $this->blind($x, $r, 1), - 2 => $this->blind($x, $r, 2) + 2 => $this->blind($x, $r, 2), ]; $h = $m_i[1]->subtract($m_i[2]); $h = $h->multiply($this->coefficients[2]); @@ -460,7 +460,7 @@ class PrivateKey extends RSA implements Common\PrivateKey $options += [ 'hash' => $this->hash->getHash(), 'MGFHash' => $this->mgfHash->getHash(), - 'saltLength' => $this->getSaltLength() + 'saltLength' => $this->getSaltLength(), ]; } else { throw new UnsupportedFormatException('The PSS format can only be used when the signature method has been explicitly set to PSS'); diff --git a/phpseclib/Crypt/RSA/PublicKey.php b/phpseclib/Crypt/RSA/PublicKey.php index c20f08fd..3c19758d 100644 --- a/phpseclib/Crypt/RSA/PublicKey.php +++ b/phpseclib/Crypt/RSA/PublicKey.php @@ -459,7 +459,7 @@ class PublicKey extends RSA implements Common\PublicKey $options += [ 'hash' => $this->hash->getHash(), 'MGFHash' => $this->mgfHash->getHash(), - 'saltLength' => $this->getSaltLength() + 'saltLength' => $this->getSaltLength(), ]; } else { throw new UnsupportedFormatException('The PSS format can only be used when the signature method has been explicitly set to PSS'); diff --git a/phpseclib/Crypt/Rijndael.php b/phpseclib/Crypt/Rijndael.php index 240e5fdc..28fccd71 100644 --- a/phpseclib/Crypt/Rijndael.php +++ b/phpseclib/Crypt/Rijndael.php @@ -487,7 +487,7 @@ class Rijndael extends BlockCipher 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000, 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000, 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000, - 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000 + 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000, ]; if (isset($this->kl['key']) && $this->key === $this->kl['key'] && $this->key_length === $this->kl['key_length'] && $this->block_size === $this->kl['block_size']) { @@ -651,7 +651,7 @@ class Rijndael extends BlockCipher 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, - 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C + 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C, ]); foreach ($t3 as $t3i) { @@ -683,8 +683,8 @@ class Rijndael extends BlockCipher 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, - 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16 - ] + 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16, + ], ]; } return $tables; @@ -734,7 +734,7 @@ class Rijndael extends BlockCipher 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, - 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0 + 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0, ]); foreach ($dt3 as $dt3i) { @@ -766,8 +766,8 @@ class Rijndael extends BlockCipher 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D - ] + 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D, + ], ]; } return $tables; @@ -909,7 +909,7 @@ class Rijndael extends BlockCipher 'init_encrypt' => $init_encrypt, 'init_decrypt' => $init_decrypt, 'encrypt_block' => $encrypt_block, - 'decrypt_block' => $decrypt_block + 'decrypt_block' => $decrypt_block, ] ); } diff --git a/phpseclib/Crypt/Twofish.php b/phpseclib/Crypt/Twofish.php index 1ec2f0a3..45f908d5 100644 --- a/phpseclib/Crypt/Twofish.php +++ b/phpseclib/Crypt/Twofish.php @@ -85,7 +85,7 @@ class Twofish extends BlockCipher 0x6E, 0x50, 0xDE, 0x68, 0x65, 0xBC, 0xDB, 0xF8, 0xC8, 0xA8, 0x2B, 0x40, 0xDC, 0xFE, 0x32, 0xA4, 0xCA, 0x10, 0x21, 0xF0, 0xD3, 0x5D, 0x0F, 0x00, - 0x6F, 0x9D, 0x36, 0x42, 0x4A, 0x5E, 0xC1, 0xE0 + 0x6F, 0x9D, 0x36, 0x42, 0x4A, 0x5E, 0xC1, 0xE0, ]; /** @@ -125,7 +125,7 @@ class Twofish extends BlockCipher 0x22, 0xC9, 0xC0, 0x9B, 0x89, 0xD4, 0xED, 0xAB, 0x12, 0xA2, 0x0D, 0x52, 0xBB, 0x02, 0x2F, 0xA9, 0xD7, 0x61, 0x1E, 0xB4, 0x50, 0x04, 0xF6, 0xC2, - 0x16, 0x25, 0x86, 0x56, 0x55, 0x09, 0xBE, 0x91 + 0x16, 0x25, 0x86, 0x56, 0x55, 0x09, 0xBE, 0x91, ]; /** @@ -165,7 +165,7 @@ class Twofish extends BlockCipher 0x8F8F9E22, 0x7171A1C9, 0x9090F0C0, 0xAAAA539B, 0x0101F189, 0x8B8BE1D4, 0x4E4E8CED, 0x8E8E6FAB, 0xABABA212, 0x6F6F3EA2, 0xE6E6540D, 0xDBDBF252, 0x92927BBB, 0xB7B7B602, 0x6969CA2F, 0x3939D9A9, 0xD3D30CD7, 0xA7A72361, 0xA2A2AD1E, 0xC3C399B4, 0x6C6C4450, 0x07070504, 0x04047FF6, 0x272746C2, - 0xACACA716, 0xD0D07625, 0x50501386, 0xDCDCF756, 0x84841A55, 0xE1E15109, 0x7A7A25BE, 0x1313EF91 + 0xACACA716, 0xD0D07625, 0x50501386, 0xDCDCF756, 0x84841A55, 0xE1E15109, 0x7A7A25BE, 0x1313EF91, ]; /** @@ -205,7 +205,7 @@ class Twofish extends BlockCipher 0x6EC1F6F6, 0x50446C6C, 0xDE5D3232, 0x68724646, 0x6526A0A0, 0xBC93CDCD, 0xDB03DADA, 0xF8C6BABA, 0xC8FA9E9E, 0xA882D6D6, 0x2BCF6E6E, 0x40507070, 0xDCEB8585, 0xFE750A0A, 0x328A9393, 0xA48DDFDF, 0xCA4C2929, 0x10141C1C, 0x2173D7D7, 0xF0CCB4B4, 0xD309D4D4, 0x5D108A8A, 0x0FE25151, 0x00000000, - 0x6F9A1919, 0x9DE01A1A, 0x368F9494, 0x42E6C7C7, 0x4AECC9C9, 0x5EFDD2D2, 0xC1AB7F7F, 0xE0D8A8A8 + 0x6F9A1919, 0x9DE01A1A, 0x368F9494, 0x42E6C7C7, 0x4AECC9C9, 0x5EFDD2D2, 0xC1AB7F7F, 0xE0D8A8A8, ]; /** @@ -245,7 +245,7 @@ class Twofish extends BlockCipher 0x8F228F9E, 0x71C971A1, 0x90C090F0, 0xAA9BAA53, 0x018901F1, 0x8BD48BE1, 0x4EED4E8C, 0x8EAB8E6F, 0xAB12ABA2, 0x6FA26F3E, 0xE60DE654, 0xDB52DBF2, 0x92BB927B, 0xB702B7B6, 0x692F69CA, 0x39A939D9, 0xD3D7D30C, 0xA761A723, 0xA21EA2AD, 0xC3B4C399, 0x6C506C44, 0x07040705, 0x04F6047F, 0x27C22746, - 0xAC16ACA7, 0xD025D076, 0x50865013, 0xDC56DCF7, 0x8455841A, 0xE109E151, 0x7ABE7A25, 0x139113EF + 0xAC16ACA7, 0xD025D076, 0x50865013, 0xDC56DCF7, 0x8455841A, 0xE109E151, 0x7ABE7A25, 0x139113EF, ]; /** @@ -285,7 +285,7 @@ class Twofish extends BlockCipher 0xC1F66EC1, 0x446C5044, 0x5D32DE5D, 0x72466872, 0x26A06526, 0x93CDBC93, 0x03DADB03, 0xC6BAF8C6, 0xFA9EC8FA, 0x82D6A882, 0xCF6E2BCF, 0x50704050, 0xEB85DCEB, 0x750AFE75, 0x8A93328A, 0x8DDFA48D, 0x4C29CA4C, 0x141C1014, 0x73D72173, 0xCCB4F0CC, 0x09D4D309, 0x108A5D10, 0xE2510FE2, 0x00000000, - 0x9A196F9A, 0xE01A9DE0, 0x8F94368F, 0xE6C742E6, 0xECC94AEC, 0xFDD25EFD, 0xAB7FC1AB, 0xD8A8E0D8 + 0x9A196F9A, 0xE01A9DE0, 0x8F94368F, 0xE6C742E6, 0xECC94AEC, 0xFDD25EFD, 0xAB7FC1AB, 0xD8A8E0D8, ]; /** @@ -545,7 +545,7 @@ class Twofish extends BlockCipher 0xff & $B >> 24, 0xff & $B >> 16, 0xff & $B >> 8, - 0xff & $B]; + 0xff & $B, ]; } /** @@ -593,10 +593,13 @@ class Twofish extends BlockCipher } // @codingStandardsIgnoreStart - return pack("V4", $K[4] ^ $R2, - $K[5] ^ $R3, - $K[6] ^ $R0, - $K[7] ^ $R1); + return pack( + "V4", + $K[4] ^ $R2, + $K[5] ^ $R3, + $K[6] ^ $R0, + $K[7] ^ $R1 + ); // @codingStandardsIgnoreEnd } @@ -645,10 +648,13 @@ class Twofish extends BlockCipher } // @codingStandardsIgnoreStart - return pack("V4", $K[0] ^ $R2, - $K[1] ^ $R3, - $K[2] ^ $R0, - $K[3] ^ $R1); + return pack( + "V4", + $K[0] ^ $R2, + $K[1] ^ $R3, + $K[2] ^ $R0, + $K[3] ^ $R1 + ); // @codingStandardsIgnoreEnd } @@ -762,7 +768,7 @@ class Twofish extends BlockCipher 'init_encrypt' => '', 'init_decrypt' => '', 'encrypt_block' => $encrypt_block, - 'decrypt_block' => $decrypt_block + 'decrypt_block' => $decrypt_block, ] ); } diff --git a/phpseclib/File/ANSI.php b/phpseclib/File/ANSI.php index 9ca32810..78327fac 100644 --- a/phpseclib/File/ANSI.php +++ b/phpseclib/File/ANSI.php @@ -76,6 +76,13 @@ class ANSI */ private $y; + /** + * Old Column + * + * @var int + */ + private $old_x; + /** * Old Row * @@ -214,6 +221,7 @@ class ANSI // http://ascii-table.com/ansi-escape-sequences-vt-100.php switch ($this->ansi) { case "\x1B[H": // Move cursor to upper left corner + $this->old_x = $this->x; $this->old_y = $this->y; $this->x = $this->y = 0; break; @@ -253,14 +261,17 @@ class ANSI $this->y += (int) $match[1]; break; case preg_match('#\x1B\[(\d+);(\d+)H#', $this->ansi, $match): // Move cursor to screen location v,h + $this->old_x = $this->x; $this->old_y = $this->y; $this->x = $match[2] - 1; $this->y = (int) $match[1] - 1; break; case preg_match('#\x1B\[(\d+)C#', $this->ansi, $match): // Move cursor right n lines + $this->old_x = $this->x; $this->x += $match[1]; break; case preg_match('#\x1B\[(\d+)D#', $this->ansi, $match): // Move cursor left n lines + $this->old_x = $this->x; $this->x -= $match[1]; if ($this->x < 0) { $this->x = 0; diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index f6180627..7b83e8d8 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -166,7 +166,7 @@ abstract class ASN1 self::TYPE_GENERAL_STRING => 'generalString', self::TYPE_UNIVERSAL_STRING => 'universalString', //self::TYPE_CHARACTER_STRING => 'characterString', - self::TYPE_BMP_STRING => 'bmpString' + self::TYPE_BMP_STRING => 'bmpString', ]; /** @@ -307,7 +307,7 @@ abstract class ASN1 'type' => $class, 'constant' => $tag, 'content' => $content, - 'length' => $length + $start - $current['start'] + 'length' => $length + $start - $current['start'], ] + $current; } @@ -340,7 +340,7 @@ abstract class ASN1 // the only time when $content['headerlength'] isn't defined is when the length is indefinite. // the absence of $content['headerlength'] is how we know if something is indefinite or not. // technically, it could be defined to be 2 and then another indicator could be used but whatever. - 'length' => $start - $current['start'] + 'length' => $start - $current['start'], ] + $current; } diff --git a/phpseclib/File/ASN1/Maps/AccessDescription.php b/phpseclib/File/ASN1/Maps/AccessDescription.php index 8ee077c2..1c996c94 100644 --- a/phpseclib/File/ASN1/Maps/AccessDescription.php +++ b/phpseclib/File/ASN1/Maps/AccessDescription.php @@ -28,7 +28,7 @@ abstract class AccessDescription 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'accessMethod' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER], - 'accessLocation' => GeneralName::MAP - ] + 'accessLocation' => GeneralName::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/AdministrationDomainName.php b/phpseclib/File/ASN1/Maps/AdministrationDomainName.php index 1f17f504..19b72452 100644 --- a/phpseclib/File/ASN1/Maps/AdministrationDomainName.php +++ b/phpseclib/File/ASN1/Maps/AdministrationDomainName.php @@ -32,7 +32,7 @@ abstract class AdministrationDomainName 'cast' => 2, 'children' => [ 'numeric' => ['type' => ASN1::TYPE_NUMERIC_STRING], - 'printable' => ['type' => ASN1::TYPE_PRINTABLE_STRING] - ] + 'printable' => ['type' => ASN1::TYPE_PRINTABLE_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/AlgorithmIdentifier.php b/phpseclib/File/ASN1/Maps/AlgorithmIdentifier.php index 6603a7a8..db7e5935 100644 --- a/phpseclib/File/ASN1/Maps/AlgorithmIdentifier.php +++ b/phpseclib/File/ASN1/Maps/AlgorithmIdentifier.php @@ -30,8 +30,8 @@ abstract class AlgorithmIdentifier 'algorithm' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER], 'parameters' => [ 'type' => ASN1::TYPE_ANY, - 'optional' => true - ] - ] + 'optional' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/AnotherName.php b/phpseclib/File/ASN1/Maps/AnotherName.php index eee3e3ce..987da45c 100644 --- a/phpseclib/File/ASN1/Maps/AnotherName.php +++ b/phpseclib/File/ASN1/Maps/AnotherName.php @@ -32,8 +32,8 @@ abstract class AnotherName 'type' => ASN1::TYPE_ANY, 'constant' => 0, 'optional' => true, - 'explicit' => true - ] - ] + 'explicit' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/Attribute.php b/phpseclib/File/ASN1/Maps/Attribute.php index adf39e26..9ddde342 100644 --- a/phpseclib/File/ASN1/Maps/Attribute.php +++ b/phpseclib/File/ASN1/Maps/Attribute.php @@ -32,8 +32,8 @@ abstract class Attribute 'type' => ASN1::TYPE_SET, 'min' => 1, 'max' => -1, - 'children' => AttributeValue::MAP - ] - ] + 'children' => AttributeValue::MAP, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/AttributeTypeAndValue.php b/phpseclib/File/ASN1/Maps/AttributeTypeAndValue.php index f86b01ba..a4ee9696 100644 --- a/phpseclib/File/ASN1/Maps/AttributeTypeAndValue.php +++ b/phpseclib/File/ASN1/Maps/AttributeTypeAndValue.php @@ -28,7 +28,7 @@ abstract class AttributeTypeAndValue 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'type' => AttributeType::MAP, - 'value' => AttributeValue::MAP - ] + 'value' => AttributeValue::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/Attributes.php b/phpseclib/File/ASN1/Maps/Attributes.php index a20919e4..a3417dbb 100644 --- a/phpseclib/File/ASN1/Maps/Attributes.php +++ b/phpseclib/File/ASN1/Maps/Attributes.php @@ -28,6 +28,6 @@ abstract class Attributes 'type' => ASN1::TYPE_SET, 'min' => 1, 'max' => -1, - 'children' => Attribute::MAP + 'children' => Attribute::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/AuthorityInfoAccessSyntax.php b/phpseclib/File/ASN1/Maps/AuthorityInfoAccessSyntax.php index c08818b9..39198d88 100644 --- a/phpseclib/File/ASN1/Maps/AuthorityInfoAccessSyntax.php +++ b/phpseclib/File/ASN1/Maps/AuthorityInfoAccessSyntax.php @@ -28,6 +28,6 @@ abstract class AuthorityInfoAccessSyntax 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => -1, - 'children' => AccessDescription::MAP + 'children' => AccessDescription::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/AuthorityKeyIdentifier.php b/phpseclib/File/ASN1/Maps/AuthorityKeyIdentifier.php index 6fdf13e3..8654105c 100644 --- a/phpseclib/File/ASN1/Maps/AuthorityKeyIdentifier.php +++ b/phpseclib/File/ASN1/Maps/AuthorityKeyIdentifier.php @@ -30,18 +30,18 @@ abstract class AuthorityKeyIdentifier 'keyIdentifier' => [ 'constant' => 0, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + KeyIdentifier::MAP, 'authorityCertIssuer' => [ 'constant' => 1, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + GeneralNames::MAP, 'authorityCertSerialNumber' => [ 'constant' => 2, 'optional' => true, - 'implicit' => true - ] + CertificateSerialNumber::MAP - ] + 'implicit' => true, + ] + CertificateSerialNumber::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/BasicConstraints.php b/phpseclib/File/ASN1/Maps/BasicConstraints.php index c42d7569..850b136d 100644 --- a/phpseclib/File/ASN1/Maps/BasicConstraints.php +++ b/phpseclib/File/ASN1/Maps/BasicConstraints.php @@ -30,12 +30,12 @@ abstract class BasicConstraints 'cA' => [ 'type' => ASN1::TYPE_BOOLEAN, 'optional' => true, - 'default' => false + 'default' => false, ], 'pathLenConstraint' => [ 'type' => ASN1::TYPE_INTEGER, - 'optional' => true - ] - ] + 'optional' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttribute.php b/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttribute.php index 0336d4b4..ef32fd86 100644 --- a/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttribute.php +++ b/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttribute.php @@ -28,7 +28,7 @@ abstract class BuiltInDomainDefinedAttribute 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'type' => ['type' => ASN1::TYPE_PRINTABLE_STRING], - 'value' => ['type' => ASN1::TYPE_PRINTABLE_STRING] - ] + 'value' => ['type' => ASN1::TYPE_PRINTABLE_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttributes.php b/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttributes.php index 8e54fead..009981d4 100644 --- a/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttributes.php +++ b/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttributes.php @@ -28,6 +28,6 @@ abstract class BuiltInDomainDefinedAttributes 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => 4, // ub-domain-defined-attributes - 'children' => BuiltInDomainDefinedAttribute::MAP + 'children' => BuiltInDomainDefinedAttribute::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/BuiltInStandardAttributes.php b/phpseclib/File/ASN1/Maps/BuiltInStandardAttributes.php index 542329ab..01a04092 100644 --- a/phpseclib/File/ASN1/Maps/BuiltInStandardAttributes.php +++ b/phpseclib/File/ASN1/Maps/BuiltInStandardAttributes.php @@ -32,38 +32,38 @@ abstract class BuiltInStandardAttributes 'network-address' => [ 'constant' => 0, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + NetworkAddress::MAP, 'terminal-identifier' => [ 'constant' => 1, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + TerminalIdentifier::MAP, 'private-domain-name' => [ 'constant' => 2, 'optional' => true, - 'explicit' => true + 'explicit' => true, ] + PrivateDomainName::MAP, 'organization-name' => [ 'constant' => 3, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + OrganizationName::MAP, 'numeric-user-identifier' => [ 'constant' => 4, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + NumericUserIdentifier::MAP, 'personal-name' => [ 'constant' => 5, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + PersonalName::MAP, 'organizational-unit-names' => [ 'constant' => 6, 'optional' => true, - 'implicit' => true - ] + OrganizationalUnitNames::MAP - ] + 'implicit' => true, + ] + OrganizationalUnitNames::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/CRLDistributionPoints.php b/phpseclib/File/ASN1/Maps/CRLDistributionPoints.php index 46f8d803..c0621b32 100644 --- a/phpseclib/File/ASN1/Maps/CRLDistributionPoints.php +++ b/phpseclib/File/ASN1/Maps/CRLDistributionPoints.php @@ -28,6 +28,6 @@ abstract class CRLDistributionPoints 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => -1, - 'children' => DistributionPoint::MAP + 'children' => DistributionPoint::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/CRLReason.php b/phpseclib/File/ASN1/Maps/CRLReason.php index 6ad5f7ab..02f32ace 100644 --- a/phpseclib/File/ASN1/Maps/CRLReason.php +++ b/phpseclib/File/ASN1/Maps/CRLReason.php @@ -37,7 +37,7 @@ abstract class CRLReason // Value 7 is not used. 8 => 'removeFromCRL', 'privilegeWithdrawn', - 'aACompromise' - ] + 'aACompromise', + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/Certificate.php b/phpseclib/File/ASN1/Maps/Certificate.php index 042cd471..2f72c867 100644 --- a/phpseclib/File/ASN1/Maps/Certificate.php +++ b/phpseclib/File/ASN1/Maps/Certificate.php @@ -29,7 +29,7 @@ abstract class Certificate 'children' => [ 'tbsCertificate' => TBSCertificate::MAP, 'signatureAlgorithm' => AlgorithmIdentifier::MAP, - 'signature' => ['type' => ASN1::TYPE_BIT_STRING] - ] + 'signature' => ['type' => ASN1::TYPE_BIT_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/CertificateList.php b/phpseclib/File/ASN1/Maps/CertificateList.php index 7386178b..e8c9208d 100644 --- a/phpseclib/File/ASN1/Maps/CertificateList.php +++ b/phpseclib/File/ASN1/Maps/CertificateList.php @@ -29,7 +29,7 @@ abstract class CertificateList 'children' => [ 'tbsCertList' => TBSCertList::MAP, 'signatureAlgorithm' => AlgorithmIdentifier::MAP, - 'signature' => ['type' => ASN1::TYPE_BIT_STRING] - ] + 'signature' => ['type' => ASN1::TYPE_BIT_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/CertificatePolicies.php b/phpseclib/File/ASN1/Maps/CertificatePolicies.php index 5f312206..989f3636 100644 --- a/phpseclib/File/ASN1/Maps/CertificatePolicies.php +++ b/phpseclib/File/ASN1/Maps/CertificatePolicies.php @@ -28,6 +28,6 @@ abstract class CertificatePolicies 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => -1, - 'children' => PolicyInformation::MAP + 'children' => PolicyInformation::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/CertificationRequest.php b/phpseclib/File/ASN1/Maps/CertificationRequest.php index 87cc9506..2c1b91b6 100644 --- a/phpseclib/File/ASN1/Maps/CertificationRequest.php +++ b/phpseclib/File/ASN1/Maps/CertificationRequest.php @@ -29,7 +29,7 @@ abstract class CertificationRequest 'children' => [ 'certificationRequestInfo' => CertificationRequestInfo::MAP, 'signatureAlgorithm' => AlgorithmIdentifier::MAP, - 'signature' => ['type' => ASN1::TYPE_BIT_STRING] - ] + 'signature' => ['type' => ASN1::TYPE_BIT_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/CertificationRequestInfo.php b/phpseclib/File/ASN1/Maps/CertificationRequestInfo.php index 8c98b248..0baf1288 100644 --- a/phpseclib/File/ASN1/Maps/CertificationRequestInfo.php +++ b/phpseclib/File/ASN1/Maps/CertificationRequestInfo.php @@ -29,15 +29,15 @@ abstract class CertificationRequestInfo 'children' => [ 'version' => [ 'type' => ASN1::TYPE_INTEGER, - 'mapping' => ['v1'] + 'mapping' => ['v1'], ], 'subject' => Name::MAP, 'subjectPKInfo' => SubjectPublicKeyInfo::MAP, 'attributes' => [ 'constant' => 0, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + Attributes::MAP, - ] + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/Characteristic_two.php b/phpseclib/File/ASN1/Maps/Characteristic_two.php index a95c6804..5cf10e1b 100644 --- a/phpseclib/File/ASN1/Maps/Characteristic_two.php +++ b/phpseclib/File/ASN1/Maps/Characteristic_two.php @@ -31,8 +31,8 @@ abstract class Characteristic_two 'basis' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER], 'parameters' => [ 'type' => ASN1::TYPE_ANY, - 'optional' => true - ] - ] + 'optional' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/CountryName.php b/phpseclib/File/ASN1/Maps/CountryName.php index f4f18659..d4ce9cdf 100644 --- a/phpseclib/File/ASN1/Maps/CountryName.php +++ b/phpseclib/File/ASN1/Maps/CountryName.php @@ -32,7 +32,7 @@ abstract class CountryName 'cast' => 1, 'children' => [ 'x121-dcc-code' => ['type' => ASN1::TYPE_NUMERIC_STRING], - 'iso-3166-alpha2-code' => ['type' => ASN1::TYPE_PRINTABLE_STRING] - ] + 'iso-3166-alpha2-code' => ['type' => ASN1::TYPE_PRINTABLE_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/Curve.php b/phpseclib/File/ASN1/Maps/Curve.php index fe921357..961d47d8 100644 --- a/phpseclib/File/ASN1/Maps/Curve.php +++ b/phpseclib/File/ASN1/Maps/Curve.php @@ -31,8 +31,8 @@ abstract class Curve 'b' => FieldElement::MAP, 'seed' => [ 'type' => ASN1::TYPE_BIT_STRING, - 'optional' => true - ] - ] + 'optional' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/DHParameter.php b/phpseclib/File/ASN1/Maps/DHParameter.php index e9cd1ffb..5381e31b 100644 --- a/phpseclib/File/ASN1/Maps/DHParameter.php +++ b/phpseclib/File/ASN1/Maps/DHParameter.php @@ -33,8 +33,8 @@ abstract class DHParameter 'base' => ['type' => ASN1::TYPE_INTEGER], 'privateValueLength' => [ 'type' => ASN1::TYPE_INTEGER, - 'optional' => true - ] - ] + 'optional' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/DSAParams.php b/phpseclib/File/ASN1/Maps/DSAParams.php index eb9f125f..c9bb4ff9 100644 --- a/phpseclib/File/ASN1/Maps/DSAParams.php +++ b/phpseclib/File/ASN1/Maps/DSAParams.php @@ -29,7 +29,7 @@ abstract class DSAParams 'children' => [ 'p' => ['type' => ASN1::TYPE_INTEGER], 'q' => ['type' => ASN1::TYPE_INTEGER], - 'g' => ['type' => ASN1::TYPE_INTEGER] - ] + 'g' => ['type' => ASN1::TYPE_INTEGER], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/DSAPrivateKey.php b/phpseclib/File/ASN1/Maps/DSAPrivateKey.php index cb277c6b..423029c4 100644 --- a/phpseclib/File/ASN1/Maps/DSAPrivateKey.php +++ b/phpseclib/File/ASN1/Maps/DSAPrivateKey.php @@ -32,7 +32,7 @@ abstract class DSAPrivateKey 'q' => ['type' => ASN1::TYPE_INTEGER], 'g' => ['type' => ASN1::TYPE_INTEGER], 'y' => ['type' => ASN1::TYPE_INTEGER], - 'x' => ['type' => ASN1::TYPE_INTEGER] - ] + 'x' => ['type' => ASN1::TYPE_INTEGER], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/DigestInfo.php b/phpseclib/File/ASN1/Maps/DigestInfo.php index a25d8b0f..6a6a448b 100644 --- a/phpseclib/File/ASN1/Maps/DigestInfo.php +++ b/phpseclib/File/ASN1/Maps/DigestInfo.php @@ -30,7 +30,7 @@ abstract class DigestInfo 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'digestAlgorithm' => AlgorithmIdentifier::MAP, - 'digest' => ['type' => ASN1::TYPE_OCTET_STRING] - ] + 'digest' => ['type' => ASN1::TYPE_OCTET_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/DirectoryString.php b/phpseclib/File/ASN1/Maps/DirectoryString.php index c9e3cf51..b92f04fe 100644 --- a/phpseclib/File/ASN1/Maps/DirectoryString.php +++ b/phpseclib/File/ASN1/Maps/DirectoryString.php @@ -31,7 +31,7 @@ abstract class DirectoryString 'printableString' => ['type' => ASN1::TYPE_PRINTABLE_STRING], 'universalString' => ['type' => ASN1::TYPE_UNIVERSAL_STRING], 'utf8String' => ['type' => ASN1::TYPE_UTF8_STRING], - 'bmpString' => ['type' => ASN1::TYPE_BMP_STRING] - ] + 'bmpString' => ['type' => ASN1::TYPE_BMP_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/DisplayText.php b/phpseclib/File/ASN1/Maps/DisplayText.php index 7f0fa88f..99fbd8f1 100644 --- a/phpseclib/File/ASN1/Maps/DisplayText.php +++ b/phpseclib/File/ASN1/Maps/DisplayText.php @@ -30,7 +30,7 @@ abstract class DisplayText 'ia5String' => ['type' => ASN1::TYPE_IA5_STRING], 'visibleString' => ['type' => ASN1::TYPE_VISIBLE_STRING], 'bmpString' => ['type' => ASN1::TYPE_BMP_STRING], - 'utf8String' => ['type' => ASN1::TYPE_UTF8_STRING] - ] + 'utf8String' => ['type' => ASN1::TYPE_UTF8_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/DistributionPoint.php b/phpseclib/File/ASN1/Maps/DistributionPoint.php index 76a5d249..d9cc611a 100644 --- a/phpseclib/File/ASN1/Maps/DistributionPoint.php +++ b/phpseclib/File/ASN1/Maps/DistributionPoint.php @@ -30,18 +30,18 @@ abstract class DistributionPoint 'distributionPoint' => [ 'constant' => 0, 'optional' => true, - 'explicit' => true + 'explicit' => true, ] + DistributionPointName::MAP, 'reasons' => [ 'constant' => 1, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + ReasonFlags::MAP, 'cRLIssuer' => [ 'constant' => 2, 'optional' => true, - 'implicit' => true - ] + GeneralNames::MAP - ] + 'implicit' => true, + ] + GeneralNames::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/DistributionPointName.php b/phpseclib/File/ASN1/Maps/DistributionPointName.php index a3ab8b26..e65eaf23 100644 --- a/phpseclib/File/ASN1/Maps/DistributionPointName.php +++ b/phpseclib/File/ASN1/Maps/DistributionPointName.php @@ -30,13 +30,13 @@ abstract class DistributionPointName 'fullName' => [ 'constant' => 0, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + GeneralNames::MAP, 'nameRelativeToCRLIssuer' => [ 'constant' => 1, 'optional' => true, - 'implicit' => true - ] + RelativeDistinguishedName::MAP - ] + 'implicit' => true, + ] + RelativeDistinguishedName::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/DssSigValue.php b/phpseclib/File/ASN1/Maps/DssSigValue.php index cb5e3eef..60bc9faf 100644 --- a/phpseclib/File/ASN1/Maps/DssSigValue.php +++ b/phpseclib/File/ASN1/Maps/DssSigValue.php @@ -28,7 +28,7 @@ abstract class DssSigValue 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'r' => ['type' => ASN1::TYPE_INTEGER], - 's' => ['type' => ASN1::TYPE_INTEGER] - ] + 's' => ['type' => ASN1::TYPE_INTEGER], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/ECParameters.php b/phpseclib/File/ASN1/Maps/ECParameters.php index a527aa53..63a86502 100644 --- a/phpseclib/File/ASN1/Maps/ECParameters.php +++ b/phpseclib/File/ASN1/Maps/ECParameters.php @@ -41,7 +41,7 @@ abstract class ECParameters 'children' => [ 'namedCurve' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER], 'implicitCurve' => ['type' => ASN1::TYPE_NULL], - 'specifiedCurve' => SpecifiedECDomain::MAP - ] + 'specifiedCurve' => SpecifiedECDomain::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/ECPrivateKey.php b/phpseclib/File/ASN1/Maps/ECPrivateKey.php index 90f9f540..e4466296 100644 --- a/phpseclib/File/ASN1/Maps/ECPrivateKey.php +++ b/phpseclib/File/ASN1/Maps/ECPrivateKey.php @@ -31,20 +31,20 @@ abstract class ECPrivateKey 'children' => [ 'version' => [ 'type' => ASN1::TYPE_INTEGER, - 'mapping' => [1 => 'ecPrivkeyVer1'] + 'mapping' => [1 => 'ecPrivkeyVer1'], ], 'privateKey' => ['type' => ASN1::TYPE_OCTET_STRING], 'parameters' => [ 'constant' => 0, 'optional' => true, - 'explicit' => true + 'explicit' => true, ] + ECParameters::MAP, 'publicKey' => [ 'type' => ASN1::TYPE_BIT_STRING, 'constant' => 1, 'optional' => true, - 'explicit' => true - ] - ] + 'explicit' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/EDIPartyName.php b/phpseclib/File/ASN1/Maps/EDIPartyName.php index 08961444..90140976 100644 --- a/phpseclib/File/ASN1/Maps/EDIPartyName.php +++ b/phpseclib/File/ASN1/Maps/EDIPartyName.php @@ -30,15 +30,15 @@ abstract class EDIPartyName 'nameAssigner' => [ 'constant' => 0, 'optional' => true, - 'implicit' => 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 - ] + 'implicit' => true, + ] + DirectoryString::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/EcdsaSigValue.php b/phpseclib/File/ASN1/Maps/EcdsaSigValue.php index c1423078..0bd080cf 100644 --- a/phpseclib/File/ASN1/Maps/EcdsaSigValue.php +++ b/phpseclib/File/ASN1/Maps/EcdsaSigValue.php @@ -28,7 +28,7 @@ abstract class EcdsaSigValue 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'r' => ['type' => ASN1::TYPE_INTEGER], - 's' => ['type' => ASN1::TYPE_INTEGER] - ] + 's' => ['type' => ASN1::TYPE_INTEGER], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/EncryptedPrivateKeyInfo.php b/phpseclib/File/ASN1/Maps/EncryptedPrivateKeyInfo.php index 375774b5..484ab240 100644 --- a/phpseclib/File/ASN1/Maps/EncryptedPrivateKeyInfo.php +++ b/phpseclib/File/ASN1/Maps/EncryptedPrivateKeyInfo.php @@ -28,7 +28,7 @@ abstract class EncryptedPrivateKeyInfo 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'encryptionAlgorithm' => AlgorithmIdentifier::MAP, - 'encryptedData' => EncryptedData::MAP - ] + 'encryptedData' => EncryptedData::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/ExtKeyUsageSyntax.php b/phpseclib/File/ASN1/Maps/ExtKeyUsageSyntax.php index a0c01945..2488345b 100644 --- a/phpseclib/File/ASN1/Maps/ExtKeyUsageSyntax.php +++ b/phpseclib/File/ASN1/Maps/ExtKeyUsageSyntax.php @@ -28,6 +28,6 @@ abstract class ExtKeyUsageSyntax 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => -1, - 'children' => KeyPurposeId::MAP + 'children' => KeyPurposeId::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/Extension.php b/phpseclib/File/ASN1/Maps/Extension.php index d129ce87..a0f3141b 100644 --- a/phpseclib/File/ASN1/Maps/Extension.php +++ b/phpseclib/File/ASN1/Maps/Extension.php @@ -37,9 +37,9 @@ abstract class Extension 'critical' => [ 'type' => ASN1::TYPE_BOOLEAN, 'optional' => true, - 'default' => false + 'default' => false, ], - 'extnValue' => ['type' => ASN1::TYPE_OCTET_STRING] - ] + 'extnValue' => ['type' => ASN1::TYPE_OCTET_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/ExtensionAttribute.php b/phpseclib/File/ASN1/Maps/ExtensionAttribute.php index 48712e6d..8afb7078 100644 --- a/phpseclib/File/ASN1/Maps/ExtensionAttribute.php +++ b/phpseclib/File/ASN1/Maps/ExtensionAttribute.php @@ -31,14 +31,14 @@ abstract class ExtensionAttribute 'type' => ASN1::TYPE_PRINTABLE_STRING, 'constant' => 0, 'optional' => true, - 'implicit' => true + 'implicit' => true, ], 'extension-attribute-value' => [ 'type' => ASN1::TYPE_ANY, 'constant' => 1, 'optional' => true, - 'explicit' => true - ] - ] + 'explicit' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/ExtensionAttributes.php b/phpseclib/File/ASN1/Maps/ExtensionAttributes.php index 1ac15fe6..e69f48bf 100644 --- a/phpseclib/File/ASN1/Maps/ExtensionAttributes.php +++ b/phpseclib/File/ASN1/Maps/ExtensionAttributes.php @@ -28,6 +28,6 @@ abstract class ExtensionAttributes 'type' => ASN1::TYPE_SET, 'min' => 1, 'max' => 256, // ub-extension-attributes - 'children' => ExtensionAttribute::MAP + 'children' => ExtensionAttribute::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/Extensions.php b/phpseclib/File/ASN1/Maps/Extensions.php index 0b6ff731..6e9e98c0 100644 --- a/phpseclib/File/ASN1/Maps/Extensions.php +++ b/phpseclib/File/ASN1/Maps/Extensions.php @@ -30,6 +30,6 @@ abstract class Extensions // technically, it's MAX, but we'll assume anything < 0 is MAX 'max' => -1, // if 'children' isn't an array then 'min' and 'max' must be defined - 'children' => Extension::MAP + 'children' => Extension::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/FieldID.php b/phpseclib/File/ASN1/Maps/FieldID.php index f7191190..bfd557c6 100644 --- a/phpseclib/File/ASN1/Maps/FieldID.php +++ b/phpseclib/File/ASN1/Maps/FieldID.php @@ -30,8 +30,8 @@ abstract class FieldID 'fieldType' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER], 'parameters' => [ 'type' => ASN1::TYPE_ANY, - 'optional' => true - ] - ] + 'optional' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/GeneralName.php b/phpseclib/File/ASN1/Maps/GeneralName.php index de4a133e..aaa5625b 100644 --- a/phpseclib/File/ASN1/Maps/GeneralName.php +++ b/phpseclib/File/ASN1/Maps/GeneralName.php @@ -30,53 +30,53 @@ abstract class GeneralName 'otherName' => [ 'constant' => 0, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + AnotherName::MAP, 'rfc822Name' => [ 'type' => ASN1::TYPE_IA5_STRING, 'constant' => 1, 'optional' => true, - 'implicit' => true + 'implicit' => true, ], 'dNSName' => [ 'type' => ASN1::TYPE_IA5_STRING, 'constant' => 2, 'optional' => true, - 'implicit' => true + 'implicit' => true, ], 'x400Address' => [ 'constant' => 3, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + ORAddress::MAP, 'directoryName' => [ 'constant' => 4, 'optional' => true, - 'explicit' => true + 'explicit' => true, ] + Name::MAP, 'ediPartyName' => [ 'constant' => 5, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + EDIPartyName::MAP, 'uniformResourceIdentifier' => [ 'type' => ASN1::TYPE_IA5_STRING, 'constant' => 6, 'optional' => true, - 'implicit' => true + 'implicit' => true, ], 'iPAddress' => [ 'type' => ASN1::TYPE_OCTET_STRING, 'constant' => 7, 'optional' => true, - 'implicit' => true + 'implicit' => true, ], 'registeredID' => [ 'type' => ASN1::TYPE_OBJECT_IDENTIFIER, 'constant' => 8, 'optional' => true, - 'implicit' => true - ] - ] + 'implicit' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/GeneralNames.php b/phpseclib/File/ASN1/Maps/GeneralNames.php index a3d980d4..6f0ddbe4 100644 --- a/phpseclib/File/ASN1/Maps/GeneralNames.php +++ b/phpseclib/File/ASN1/Maps/GeneralNames.php @@ -28,6 +28,6 @@ abstract class GeneralNames 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => -1, - 'children' => GeneralName::MAP + 'children' => GeneralName::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/GeneralSubtree.php b/phpseclib/File/ASN1/Maps/GeneralSubtree.php index da9dfd4e..4b4e9290 100644 --- a/phpseclib/File/ASN1/Maps/GeneralSubtree.php +++ b/phpseclib/File/ASN1/Maps/GeneralSubtree.php @@ -32,13 +32,13 @@ abstract class GeneralSubtree 'constant' => 0, 'optional' => true, 'implicit' => true, - 'default' => '0' + 'default' => '0', ] + BaseDistance::MAP, 'maximum' => [ 'constant' => 1, 'optional' => true, 'implicit' => true, - ] + BaseDistance::MAP - ] + ] + BaseDistance::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/GeneralSubtrees.php b/phpseclib/File/ASN1/Maps/GeneralSubtrees.php index 3c8e92eb..620fa3ef 100644 --- a/phpseclib/File/ASN1/Maps/GeneralSubtrees.php +++ b/phpseclib/File/ASN1/Maps/GeneralSubtrees.php @@ -28,6 +28,6 @@ abstract class GeneralSubtrees 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => -1, - 'children' => GeneralSubtree::MAP + 'children' => GeneralSubtree::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/IssuingDistributionPoint.php b/phpseclib/File/ASN1/Maps/IssuingDistributionPoint.php index ec7e4eac..47f60c8b 100644 --- a/phpseclib/File/ASN1/Maps/IssuingDistributionPoint.php +++ b/phpseclib/File/ASN1/Maps/IssuingDistributionPoint.php @@ -30,41 +30,41 @@ abstract class IssuingDistributionPoint 'distributionPoint' => [ 'constant' => 0, 'optional' => true, - 'explicit' => true + 'explicit' => true, ] + DistributionPointName::MAP, 'onlyContainsUserCerts' => [ 'type' => ASN1::TYPE_BOOLEAN, 'constant' => 1, 'optional' => true, 'default' => false, - 'implicit' => true + 'implicit' => true, ], 'onlyContainsCACerts' => [ 'type' => ASN1::TYPE_BOOLEAN, 'constant' => 2, 'optional' => true, 'default' => false, - 'implicit' => true + 'implicit' => true, ], 'onlySomeReasons' => [ 'constant' => 3, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + ReasonFlags::MAP, 'indirectCRL' => [ 'type' => ASN1::TYPE_BOOLEAN, 'constant' => 4, 'optional' => true, 'default' => false, - 'implicit' => true + 'implicit' => true, ], 'onlyContainsAttributeCerts' => [ 'type' => ASN1::TYPE_BOOLEAN, 'constant' => 5, 'optional' => true, 'default' => false, - 'implicit' => true - ] - ] + 'implicit' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/KeyUsage.php b/phpseclib/File/ASN1/Maps/KeyUsage.php index cbd70f7b..3b028aa8 100644 --- a/phpseclib/File/ASN1/Maps/KeyUsage.php +++ b/phpseclib/File/ASN1/Maps/KeyUsage.php @@ -35,7 +35,7 @@ abstract class KeyUsage 'keyCertSign', 'cRLSign', 'encipherOnly', - 'decipherOnly' - ] + 'decipherOnly', + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/Name.php b/phpseclib/File/ASN1/Maps/Name.php index 3b190ea2..0b7740a4 100644 --- a/phpseclib/File/ASN1/Maps/Name.php +++ b/phpseclib/File/ASN1/Maps/Name.php @@ -27,7 +27,7 @@ abstract class Name public const MAP = [ 'type' => ASN1::TYPE_CHOICE, 'children' => [ - 'rdnSequence' => RDNSequence::MAP - ] + 'rdnSequence' => RDNSequence::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/NameConstraints.php b/phpseclib/File/ASN1/Maps/NameConstraints.php index c52188a7..bf8e199c 100644 --- a/phpseclib/File/ASN1/Maps/NameConstraints.php +++ b/phpseclib/File/ASN1/Maps/NameConstraints.php @@ -30,13 +30,13 @@ abstract class NameConstraints 'permittedSubtrees' => [ 'constant' => 0, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + GeneralSubtrees::MAP, 'excludedSubtrees' => [ 'constant' => 1, 'optional' => true, - 'implicit' => true - ] + GeneralSubtrees::MAP - ] + 'implicit' => true, + ] + GeneralSubtrees::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/NoticeReference.php b/phpseclib/File/ASN1/Maps/NoticeReference.php index e29473d6..58778dd4 100644 --- a/phpseclib/File/ASN1/Maps/NoticeReference.php +++ b/phpseclib/File/ASN1/Maps/NoticeReference.php @@ -32,8 +32,8 @@ abstract class NoticeReference 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => 200, - 'children' => ['type' => ASN1::TYPE_INTEGER] - ] - ] + 'children' => ['type' => ASN1::TYPE_INTEGER], + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/ORAddress.php b/phpseclib/File/ASN1/Maps/ORAddress.php index 47f781bc..a3ccde97 100644 --- a/phpseclib/File/ASN1/Maps/ORAddress.php +++ b/phpseclib/File/ASN1/Maps/ORAddress.php @@ -29,7 +29,7 @@ abstract class ORAddress 'children' => [ 'built-in-standard-attributes' => BuiltInStandardAttributes::MAP, 'built-in-domain-defined-attributes' => ['optional' => true] + BuiltInDomainDefinedAttributes::MAP, - 'extension-attributes' => ['optional' => true] + ExtensionAttributes::MAP - ] + 'extension-attributes' => ['optional' => true] + ExtensionAttributes::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/OneAsymmetricKey.php b/phpseclib/File/ASN1/Maps/OneAsymmetricKey.php index 6cfb62e6..366b403e 100644 --- a/phpseclib/File/ASN1/Maps/OneAsymmetricKey.php +++ b/phpseclib/File/ASN1/Maps/OneAsymmetricKey.php @@ -31,20 +31,20 @@ abstract class OneAsymmetricKey 'children' => [ 'version' => [ 'type' => ASN1::TYPE_INTEGER, - 'mapping' => ['v1', 'v2'] + 'mapping' => ['v1', 'v2'], ], 'privateKeyAlgorithm' => AlgorithmIdentifier::MAP, 'privateKey' => PrivateKey::MAP, 'attributes' => [ 'constant' => 0, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + Attributes::MAP, 'publicKey' => [ 'constant' => 1, 'optional' => true, - 'implicit' => true - ] + PublicKey::MAP - ] + 'implicit' => true, + ] + PublicKey::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/OrganizationalUnitNames.php b/phpseclib/File/ASN1/Maps/OrganizationalUnitNames.php index 1e62ba0e..247a3c3f 100644 --- a/phpseclib/File/ASN1/Maps/OrganizationalUnitNames.php +++ b/phpseclib/File/ASN1/Maps/OrganizationalUnitNames.php @@ -28,6 +28,6 @@ abstract class OrganizationalUnitNames 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => 4, // ub-organizational-units - 'children' => ['type' => ASN1::TYPE_PRINTABLE_STRING] + 'children' => ['type' => ASN1::TYPE_PRINTABLE_STRING], ]; } diff --git a/phpseclib/File/ASN1/Maps/OtherPrimeInfo.php b/phpseclib/File/ASN1/Maps/OtherPrimeInfo.php index b8136f13..2edf22fd 100644 --- a/phpseclib/File/ASN1/Maps/OtherPrimeInfo.php +++ b/phpseclib/File/ASN1/Maps/OtherPrimeInfo.php @@ -30,7 +30,7 @@ abstract class OtherPrimeInfo 'children' => [ 'prime' => ['type' => ASN1::TYPE_INTEGER], // ri 'exponent' => ['type' => ASN1::TYPE_INTEGER], // di - 'coefficient' => ['type' => ASN1::TYPE_INTEGER] // ti - ] + 'coefficient' => ['type' => ASN1::TYPE_INTEGER], // ti + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/OtherPrimeInfos.php b/phpseclib/File/ASN1/Maps/OtherPrimeInfos.php index 49d5bf4f..4953dd8c 100644 --- a/phpseclib/File/ASN1/Maps/OtherPrimeInfos.php +++ b/phpseclib/File/ASN1/Maps/OtherPrimeInfos.php @@ -29,6 +29,6 @@ abstract class OtherPrimeInfos 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => -1, - 'children' => OtherPrimeInfo::MAP + 'children' => OtherPrimeInfo::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/PBEParameter.php b/phpseclib/File/ASN1/Maps/PBEParameter.php index 35bb7fb8..cd1c88aa 100644 --- a/phpseclib/File/ASN1/Maps/PBEParameter.php +++ b/phpseclib/File/ASN1/Maps/PBEParameter.php @@ -30,7 +30,7 @@ abstract class PBEParameter 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'salt' => ['type' => ASN1::TYPE_OCTET_STRING], - 'iterationCount' => ['type' => ASN1::TYPE_INTEGER] - ] + 'iterationCount' => ['type' => ASN1::TYPE_INTEGER], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PBES2params.php b/phpseclib/File/ASN1/Maps/PBES2params.php index 7f2e5c43..415b6f7e 100644 --- a/phpseclib/File/ASN1/Maps/PBES2params.php +++ b/phpseclib/File/ASN1/Maps/PBES2params.php @@ -30,7 +30,7 @@ abstract class PBES2params 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'keyDerivationFunc' => AlgorithmIdentifier::MAP, - 'encryptionScheme' => AlgorithmIdentifier::MAP - ] + 'encryptionScheme' => AlgorithmIdentifier::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PBKDF2params.php b/phpseclib/File/ASN1/Maps/PBKDF2params.php index 3a1acc7e..d3d089ad 100644 --- a/phpseclib/File/ASN1/Maps/PBKDF2params.php +++ b/phpseclib/File/ASN1/Maps/PBKDF2params.php @@ -35,9 +35,9 @@ abstract class PBKDF2params 'iterationCount' => ['type' => ASN1::TYPE_INTEGER], 'keyLength' => [ 'type' => ASN1::TYPE_INTEGER, - 'optional' => true + 'optional' => true, ], - 'prf' => AlgorithmIdentifier::MAP + ['optional' => true] - ] + 'prf' => AlgorithmIdentifier::MAP + ['optional' => true], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PBMAC1params.php b/phpseclib/File/ASN1/Maps/PBMAC1params.php index 3bd927e8..ee114b61 100644 --- a/phpseclib/File/ASN1/Maps/PBMAC1params.php +++ b/phpseclib/File/ASN1/Maps/PBMAC1params.php @@ -30,7 +30,7 @@ abstract class PBMAC1params 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'keyDerivationFunc' => AlgorithmIdentifier::MAP, - 'messageAuthScheme' => AlgorithmIdentifier::MAP - ] + 'messageAuthScheme' => AlgorithmIdentifier::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PKCS9String.php b/phpseclib/File/ASN1/Maps/PKCS9String.php index dfd9f6bf..e5b38066 100644 --- a/phpseclib/File/ASN1/Maps/PKCS9String.php +++ b/phpseclib/File/ASN1/Maps/PKCS9String.php @@ -28,7 +28,7 @@ abstract class PKCS9String 'type' => ASN1::TYPE_CHOICE, 'children' => [ 'ia5String' => ['type' => ASN1::TYPE_IA5_STRING], - 'directoryString' => DirectoryString::MAP - ] + 'directoryString' => DirectoryString::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/Pentanomial.php b/phpseclib/File/ASN1/Maps/Pentanomial.php index 8fb3698c..48a4b77a 100644 --- a/phpseclib/File/ASN1/Maps/Pentanomial.php +++ b/phpseclib/File/ASN1/Maps/Pentanomial.php @@ -30,6 +30,6 @@ abstract class Pentanomial 'k1' => ['type' => ASN1::TYPE_INTEGER], // k1 > 0 'k2' => ['type' => ASN1::TYPE_INTEGER], // k2 > k1 'k3' => ['type' => ASN1::TYPE_INTEGER], // k3 > h2 - ] + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PersonalName.php b/phpseclib/File/ASN1/Maps/PersonalName.php index 89dc73ba..d84c8588 100644 --- a/phpseclib/File/ASN1/Maps/PersonalName.php +++ b/phpseclib/File/ASN1/Maps/PersonalName.php @@ -31,26 +31,26 @@ abstract class PersonalName 'type' => ASN1::TYPE_PRINTABLE_STRING, 'constant' => 0, 'optional' => true, - 'implicit' => true + 'implicit' => true, ], 'given-name' => [ 'type' => ASN1::TYPE_PRINTABLE_STRING, 'constant' => 1, 'optional' => true, - 'implicit' => true + 'implicit' => true, ], 'initials' => [ 'type' => ASN1::TYPE_PRINTABLE_STRING, 'constant' => 2, 'optional' => true, - 'implicit' => true + 'implicit' => true, ], 'generation-qualifier' => [ 'type' => ASN1::TYPE_PRINTABLE_STRING, 'constant' => 3, 'optional' => true, - 'implicit' => true - ] - ] + 'implicit' => true, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PolicyInformation.php b/phpseclib/File/ASN1/Maps/PolicyInformation.php index dd0d5a64..d735eb61 100644 --- a/phpseclib/File/ASN1/Maps/PolicyInformation.php +++ b/phpseclib/File/ASN1/Maps/PolicyInformation.php @@ -33,8 +33,8 @@ abstract class PolicyInformation 'min' => 0, 'max' => -1, 'optional' => true, - 'children' => PolicyQualifierInfo::MAP - ] - ] + 'children' => PolicyQualifierInfo::MAP, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PolicyMappings.php b/phpseclib/File/ASN1/Maps/PolicyMappings.php index c8cd4e5c..ab29466a 100644 --- a/phpseclib/File/ASN1/Maps/PolicyMappings.php +++ b/phpseclib/File/ASN1/Maps/PolicyMappings.php @@ -32,8 +32,8 @@ abstract class PolicyMappings 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'issuerDomainPolicy' => CertPolicyId::MAP, - 'subjectDomainPolicy' => CertPolicyId::MAP - ] - ] + 'subjectDomainPolicy' => CertPolicyId::MAP, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PolicyQualifierInfo.php b/phpseclib/File/ASN1/Maps/PolicyQualifierInfo.php index 5d24c758..3f9de69a 100644 --- a/phpseclib/File/ASN1/Maps/PolicyQualifierInfo.php +++ b/phpseclib/File/ASN1/Maps/PolicyQualifierInfo.php @@ -28,7 +28,7 @@ abstract class PolicyQualifierInfo 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'policyQualifierId' => PolicyQualifierId::MAP, - 'qualifier' => ['type' => ASN1::TYPE_ANY] - ] + 'qualifier' => ['type' => ASN1::TYPE_ANY], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PostalAddress.php b/phpseclib/File/ASN1/Maps/PostalAddress.php index 66a9f774..77c95b6b 100644 --- a/phpseclib/File/ASN1/Maps/PostalAddress.php +++ b/phpseclib/File/ASN1/Maps/PostalAddress.php @@ -29,6 +29,6 @@ abstract class PostalAddress 'optional' => true, 'min' => 1, 'max' => -1, - 'children' => DirectoryString::MAP + 'children' => DirectoryString::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/PrivateDomainName.php b/phpseclib/File/ASN1/Maps/PrivateDomainName.php index 53a8770c..efb21a31 100644 --- a/phpseclib/File/ASN1/Maps/PrivateDomainName.php +++ b/phpseclib/File/ASN1/Maps/PrivateDomainName.php @@ -28,7 +28,7 @@ abstract class PrivateDomainName 'type' => ASN1::TYPE_CHOICE, 'children' => [ 'numeric' => ['type' => ASN1::TYPE_NUMERIC_STRING], - 'printable' => ['type' => ASN1::TYPE_PRINTABLE_STRING] - ] + 'printable' => ['type' => ASN1::TYPE_PRINTABLE_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PrivateKeyInfo.php b/phpseclib/File/ASN1/Maps/PrivateKeyInfo.php index eaccade8..84146b8c 100644 --- a/phpseclib/File/ASN1/Maps/PrivateKeyInfo.php +++ b/phpseclib/File/ASN1/Maps/PrivateKeyInfo.php @@ -29,15 +29,15 @@ abstract class PrivateKeyInfo 'children' => [ 'version' => [ 'type' => ASN1::TYPE_INTEGER, - 'mapping' => ['v1'] + 'mapping' => ['v1'], ], 'privateKeyAlgorithm' => AlgorithmIdentifier::MAP, 'privateKey' => PrivateKey::MAP, 'attributes' => [ 'constant' => 0, 'optional' => true, - 'implicit' => true - ] + Attributes::MAP - ] + 'implicit' => true, + ] + Attributes::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PrivateKeyUsagePeriod.php b/phpseclib/File/ASN1/Maps/PrivateKeyUsagePeriod.php index 530e1e00..2c78812c 100644 --- a/phpseclib/File/ASN1/Maps/PrivateKeyUsagePeriod.php +++ b/phpseclib/File/ASN1/Maps/PrivateKeyUsagePeriod.php @@ -31,12 +31,12 @@ abstract class PrivateKeyUsagePeriod 'constant' => 0, 'optional' => true, 'implicit' => true, - 'type' => ASN1::TYPE_GENERALIZED_TIME], + 'type' => ASN1::TYPE_GENERALIZED_TIME, ], 'notAfter' => [ 'constant' => 1, 'optional' => true, 'implicit' => true, - 'type' => ASN1::TYPE_GENERALIZED_TIME] - ] + 'type' => ASN1::TYPE_GENERALIZED_TIME, ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PublicKeyAndChallenge.php b/phpseclib/File/ASN1/Maps/PublicKeyAndChallenge.php index a47761e7..d725c58d 100644 --- a/phpseclib/File/ASN1/Maps/PublicKeyAndChallenge.php +++ b/phpseclib/File/ASN1/Maps/PublicKeyAndChallenge.php @@ -28,7 +28,7 @@ abstract class PublicKeyAndChallenge 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'spki' => SubjectPublicKeyInfo::MAP, - 'challenge' => ['type' => ASN1::TYPE_IA5_STRING] - ] + 'challenge' => ['type' => ASN1::TYPE_IA5_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/PublicKeyInfo.php b/phpseclib/File/ASN1/Maps/PublicKeyInfo.php index d36b2e3c..0bf91cc6 100644 --- a/phpseclib/File/ASN1/Maps/PublicKeyInfo.php +++ b/phpseclib/File/ASN1/Maps/PublicKeyInfo.php @@ -31,7 +31,7 @@ abstract class PublicKeyInfo 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'publicKeyAlgorithm' => AlgorithmIdentifier::MAP, - 'publicKey' => ['type' => ASN1::TYPE_BIT_STRING] - ] + 'publicKey' => ['type' => ASN1::TYPE_BIT_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/RC2CBCParameter.php b/phpseclib/File/ASN1/Maps/RC2CBCParameter.php index 158f70b5..22b8096f 100644 --- a/phpseclib/File/ASN1/Maps/RC2CBCParameter.php +++ b/phpseclib/File/ASN1/Maps/RC2CBCParameter.php @@ -31,9 +31,9 @@ abstract class RC2CBCParameter 'children' => [ 'rc2ParametersVersion' => [ 'type' => ASN1::TYPE_INTEGER, - 'optional' => true + 'optional' => true, ], - 'iv' => ['type' => ASN1::TYPE_OCTET_STRING] - ] + 'iv' => ['type' => ASN1::TYPE_OCTET_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/RDNSequence.php b/phpseclib/File/ASN1/Maps/RDNSequence.php index e62a1d17..9c3a3981 100644 --- a/phpseclib/File/ASN1/Maps/RDNSequence.php +++ b/phpseclib/File/ASN1/Maps/RDNSequence.php @@ -35,6 +35,6 @@ abstract class RDNSequence // RDNSequence does not define a min or a max, which means it doesn't have one 'min' => 0, 'max' => -1, - 'children' => RelativeDistinguishedName::MAP + 'children' => RelativeDistinguishedName::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/RSAPrivateKey.php b/phpseclib/File/ASN1/Maps/RSAPrivateKey.php index 75916879..3084a5e2 100644 --- a/phpseclib/File/ASN1/Maps/RSAPrivateKey.php +++ b/phpseclib/File/ASN1/Maps/RSAPrivateKey.php @@ -30,7 +30,7 @@ abstract class RSAPrivateKey 'children' => [ 'version' => [ 'type' => ASN1::TYPE_INTEGER, - 'mapping' => ['two-prime', 'multi'] + 'mapping' => ['two-prime', 'multi'], ], 'modulus' => ['type' => ASN1::TYPE_INTEGER], // n 'publicExponent' => ['type' => ASN1::TYPE_INTEGER], // e @@ -40,7 +40,7 @@ abstract class RSAPrivateKey 'exponent1' => ['type' => ASN1::TYPE_INTEGER], // d mod (p-1) 'exponent2' => ['type' => ASN1::TYPE_INTEGER], // d mod (q-1) 'coefficient' => ['type' => ASN1::TYPE_INTEGER], // (inverse of q) mod p - 'otherPrimeInfos' => OtherPrimeInfos::MAP + ['optional' => true] - ] + 'otherPrimeInfos' => OtherPrimeInfos::MAP + ['optional' => true], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/RSAPublicKey.php b/phpseclib/File/ASN1/Maps/RSAPublicKey.php index 19e964fe..5ac03f57 100644 --- a/phpseclib/File/ASN1/Maps/RSAPublicKey.php +++ b/phpseclib/File/ASN1/Maps/RSAPublicKey.php @@ -28,7 +28,7 @@ abstract class RSAPublicKey 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'modulus' => ['type' => ASN1::TYPE_INTEGER], - 'publicExponent' => ['type' => ASN1::TYPE_INTEGER] - ] + 'publicExponent' => ['type' => ASN1::TYPE_INTEGER], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/RSASSA_PSS_params.php b/phpseclib/File/ASN1/Maps/RSASSA_PSS_params.php index 51e7d504..b640d3bc 100644 --- a/phpseclib/File/ASN1/Maps/RSASSA_PSS_params.php +++ b/phpseclib/File/ASN1/Maps/RSASSA_PSS_params.php @@ -46,15 +46,15 @@ abstract class RSASSA_PSS_params 'constant' => 2, 'optional' => true, 'explicit' => true, - 'default' => 20 + 'default' => 20, ], 'trailerField' => [ 'type' => ASN1::TYPE_INTEGER, 'constant' => 3, 'optional' => true, 'explicit' => true, - 'default' => 1 - ] - ] + 'default' => 1, + ], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/ReasonFlags.php b/phpseclib/File/ASN1/Maps/ReasonFlags.php index 9d6e7c43..6b9600cc 100644 --- a/phpseclib/File/ASN1/Maps/ReasonFlags.php +++ b/phpseclib/File/ASN1/Maps/ReasonFlags.php @@ -35,7 +35,7 @@ abstract class ReasonFlags 'cessationOfOperation', 'certificateHold', 'privilegeWithdrawn', - 'aACompromise' - ] + 'aACompromise', + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/RelativeDistinguishedName.php b/phpseclib/File/ASN1/Maps/RelativeDistinguishedName.php index 254f5618..3e14f2e3 100644 --- a/phpseclib/File/ASN1/Maps/RelativeDistinguishedName.php +++ b/phpseclib/File/ASN1/Maps/RelativeDistinguishedName.php @@ -34,6 +34,6 @@ abstract class RelativeDistinguishedName 'type' => ASN1::TYPE_SET, 'min' => 1, 'max' => -1, - 'children' => AttributeTypeAndValue::MAP + 'children' => AttributeTypeAndValue::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/RevokedCertificate.php b/phpseclib/File/ASN1/Maps/RevokedCertificate.php index dc535b15..f96c6328 100644 --- a/phpseclib/File/ASN1/Maps/RevokedCertificate.php +++ b/phpseclib/File/ASN1/Maps/RevokedCertificate.php @@ -30,8 +30,8 @@ abstract class RevokedCertificate 'userCertificate' => CertificateSerialNumber::MAP, 'revocationDate' => Time::MAP, 'crlEntryExtensions' => [ - 'optional' => true - ] + Extensions::MAP - ] + 'optional' => true, + ] + Extensions::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/SignedPublicKeyAndChallenge.php b/phpseclib/File/ASN1/Maps/SignedPublicKeyAndChallenge.php index 68ff3be2..efb33a95 100644 --- a/phpseclib/File/ASN1/Maps/SignedPublicKeyAndChallenge.php +++ b/phpseclib/File/ASN1/Maps/SignedPublicKeyAndChallenge.php @@ -29,7 +29,7 @@ abstract class SignedPublicKeyAndChallenge 'children' => [ 'publicKeyAndChallenge' => PublicKeyAndChallenge::MAP, 'signatureAlgorithm' => AlgorithmIdentifier::MAP, - 'signature' => ['type' => ASN1::TYPE_BIT_STRING] - ] + 'signature' => ['type' => ASN1::TYPE_BIT_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/SpecifiedECDomain.php b/phpseclib/File/ASN1/Maps/SpecifiedECDomain.php index 5244c4d9..e958a9ba 100644 --- a/phpseclib/File/ASN1/Maps/SpecifiedECDomain.php +++ b/phpseclib/File/ASN1/Maps/SpecifiedECDomain.php @@ -31,7 +31,7 @@ abstract class SpecifiedECDomain 'children' => [ 'version' => [ 'type' => ASN1::TYPE_INTEGER, - 'mapping' => [1 => 'ecdpVer1', 'ecdpVer2', 'ecdpVer3'] + 'mapping' => [1 => 'ecdpVer1', 'ecdpVer2', 'ecdpVer3'], ], 'fieldID' => FieldID::MAP, 'curve' => Curve::MAP, @@ -39,9 +39,9 @@ abstract class SpecifiedECDomain 'order' => ['type' => ASN1::TYPE_INTEGER], 'cofactor' => [ 'type' => ASN1::TYPE_INTEGER, - 'optional' => true + 'optional' => true, ], - 'hash' => ['optional' => true] + HashAlgorithm::MAP - ] + 'hash' => ['optional' => true] + HashAlgorithm::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/SubjectDirectoryAttributes.php b/phpseclib/File/ASN1/Maps/SubjectDirectoryAttributes.php index 91a3319f..7cd72ec1 100644 --- a/phpseclib/File/ASN1/Maps/SubjectDirectoryAttributes.php +++ b/phpseclib/File/ASN1/Maps/SubjectDirectoryAttributes.php @@ -28,6 +28,6 @@ abstract class SubjectDirectoryAttributes 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => -1, - 'children' => Attribute::MAP + 'children' => Attribute::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/SubjectInfoAccessSyntax.php b/phpseclib/File/ASN1/Maps/SubjectInfoAccessSyntax.php index 5d11ea12..967d58b7 100644 --- a/phpseclib/File/ASN1/Maps/SubjectInfoAccessSyntax.php +++ b/phpseclib/File/ASN1/Maps/SubjectInfoAccessSyntax.php @@ -28,6 +28,6 @@ abstract class SubjectInfoAccessSyntax 'type' => ASN1::TYPE_SEQUENCE, 'min' => 1, 'max' => -1, - 'children' => AccessDescription::MAP + 'children' => AccessDescription::MAP, ]; } diff --git a/phpseclib/File/ASN1/Maps/SubjectPublicKeyInfo.php b/phpseclib/File/ASN1/Maps/SubjectPublicKeyInfo.php index 53006daf..aeedc740 100644 --- a/phpseclib/File/ASN1/Maps/SubjectPublicKeyInfo.php +++ b/phpseclib/File/ASN1/Maps/SubjectPublicKeyInfo.php @@ -28,7 +28,7 @@ abstract class SubjectPublicKeyInfo 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'algorithm' => AlgorithmIdentifier::MAP, - 'subjectPublicKey' => ['type' => ASN1::TYPE_BIT_STRING] - ] + 'subjectPublicKey' => ['type' => ASN1::TYPE_BIT_STRING], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/TBSCertList.php b/phpseclib/File/ASN1/Maps/TBSCertList.php index 5e7f1658..dbfc01f6 100644 --- a/phpseclib/File/ASN1/Maps/TBSCertList.php +++ b/phpseclib/File/ASN1/Maps/TBSCertList.php @@ -31,26 +31,26 @@ abstract class TBSCertList 'type' => ASN1::TYPE_INTEGER, 'mapping' => ['v1', 'v2', 'v3'], 'optional' => true, - 'default' => 'v2' + 'default' => 'v2', ], 'signature' => AlgorithmIdentifier::MAP, 'issuer' => Name::MAP, 'thisUpdate' => Time::MAP, 'nextUpdate' => [ - 'optional' => true + 'optional' => true, ] + Time::MAP, 'revokedCertificates' => [ 'type' => ASN1::TYPE_SEQUENCE, 'optional' => true, 'min' => 0, 'max' => -1, - 'children' => RevokedCertificate::MAP + 'children' => RevokedCertificate::MAP, ], 'crlExtensions' => [ 'constant' => 0, 'optional' => true, - 'explicit' => true - ] + Extensions::MAP - ] + 'explicit' => true, + ] + Extensions::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/TBSCertificate.php b/phpseclib/File/ASN1/Maps/TBSCertificate.php index 907026ad..08a62588 100644 --- a/phpseclib/File/ASN1/Maps/TBSCertificate.php +++ b/phpseclib/File/ASN1/Maps/TBSCertificate.php @@ -36,7 +36,7 @@ abstract class TBSCertificate 'optional' => true, 'explicit' => true, 'mapping' => ['v1', 'v2', 'v3'], - 'default' => 'v1' + 'default' => 'v1', ], 'serialNumber' => CertificateSerialNumber::MAP, 'signature' => AlgorithmIdentifier::MAP, @@ -48,20 +48,20 @@ abstract class TBSCertificate 'issuerUniqueID' => [ 'constant' => 1, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + UniqueIdentifier::MAP, 'subjectUniqueID' => [ 'constant' => 2, 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + UniqueIdentifier::MAP, // doesn't use the EXPLICIT keyword but if // it's not IMPLICIT, it's EXPLICIT 'extensions' => [ 'constant' => 3, 'optional' => true, - 'explicit' => true - ] + Extensions::MAP - ] + 'explicit' => true, + ] + Extensions::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/Time.php b/phpseclib/File/ASN1/Maps/Time.php index 28f102a5..431d1e18 100644 --- a/phpseclib/File/ASN1/Maps/Time.php +++ b/phpseclib/File/ASN1/Maps/Time.php @@ -28,7 +28,7 @@ abstract class Time 'type' => ASN1::TYPE_CHOICE, 'children' => [ 'utcTime' => ['type' => ASN1::TYPE_UTC_TIME], - 'generalTime' => ['type' => ASN1::TYPE_GENERALIZED_TIME] - ] + 'generalTime' => ['type' => ASN1::TYPE_GENERALIZED_TIME], + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/UserNotice.php b/phpseclib/File/ASN1/Maps/UserNotice.php index ffbab9cd..1f172b98 100644 --- a/phpseclib/File/ASN1/Maps/UserNotice.php +++ b/phpseclib/File/ASN1/Maps/UserNotice.php @@ -29,12 +29,12 @@ abstract class UserNotice 'children' => [ 'noticeRef' => [ 'optional' => true, - 'implicit' => true + 'implicit' => true, ] + NoticeReference::MAP, 'explicitText' => [ 'optional' => true, - 'implicit' => true - ] + DisplayText::MAP - ] + 'implicit' => true, + ] + DisplayText::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/Validity.php b/phpseclib/File/ASN1/Maps/Validity.php index 3f10ab9d..095796fe 100644 --- a/phpseclib/File/ASN1/Maps/Validity.php +++ b/phpseclib/File/ASN1/Maps/Validity.php @@ -28,7 +28,7 @@ abstract class Validity 'type' => ASN1::TYPE_SEQUENCE, 'children' => [ 'notBefore' => Time::MAP, - 'notAfter' => Time::MAP - ] + 'notAfter' => Time::MAP, + ], ]; } diff --git a/phpseclib/File/ASN1/Maps/netscape_cert_type.php b/phpseclib/File/ASN1/Maps/netscape_cert_type.php index c2f062ee..bfaa6389 100644 --- a/phpseclib/File/ASN1/Maps/netscape_cert_type.php +++ b/phpseclib/File/ASN1/Maps/netscape_cert_type.php @@ -36,7 +36,7 @@ abstract class netscape_cert_type 'Reserved', 'SSLCA', 'EmailCA', - 'ObjectSigningCA' - ] + 'ObjectSigningCA', + ], ]; } diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 7059e5a4..8f432caa 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -408,7 +408,7 @@ class X509 // see http://tools.ietf.org/html/rfc2985 'pkcs-9-at-unstructuredName' => '1.2.840.113549.1.9.2', // PKCS #9 unstructured name 'pkcs-9-at-challengePassword' => '1.2.840.113549.1.9.7', // Challenge password for certificate revocations - 'pkcs-9-at-extensionRequest' => '1.2.840.113549.1.9.14' // Certificate extension request + 'pkcs-9-at-extensionRequest' => '1.2.840.113549.1.9.14', // Certificate extension request ]); } } @@ -618,7 +618,7 @@ class X509 $newext = [ 'extnId' => $id, 'extnValue' => $value, - 'critical' => $critical + 'critical' => $critical, ]; if ($replace) { foreach ($extensions as $key => $value) { @@ -1577,8 +1577,8 @@ class X509 $this->dn['rdnSequence'][] = [ [ 'type' => $propName, - 'value' => $v - ] + 'value' => $v, + ], ]; } @@ -2032,7 +2032,7 @@ class X509 $paths = [ 'tbsCertificate/subjectPublicKeyInfo', 'certificationRequestInfo/subjectPKInfo', - 'publicKeyAndChallenge/spki' + 'publicKeyAndChallenge/spki', ]; foreach ($paths as $path) { $keyinfo = $this->subArray($this->currentCert, $path); @@ -2438,7 +2438,7 @@ class X509 $r = PSS::load($issuer->privateKey->withPassword()->toString('PSS')); $signatureAlgorithm = [ 'algorithm' => 'id-RSASSA-PSS', - 'parameters' => PSS::savePSSParams($r) + 'parameters' => PSS::savePSSParams($r), ]; } @@ -2500,13 +2500,13 @@ class X509 'issuer' => false, // this is going to be overwritten later 'validity' => [ 'notBefore' => $this->timeField($startDate), // $this->setStartDate() - 'notAfter' => $this->timeField($endDate) // $this->setEndDate() + 'notAfter' => $this->timeField($endDate), // $this->setEndDate() ], 'subject' => $subject->dn, - 'subjectPublicKeyInfo' => $subjectPublicKey + 'subjectPublicKeyInfo' => $subjectPublicKey, ], 'signatureAlgorithm' => $signatureAlgorithm, - 'signature' => false // this is going to be overwritten later + 'signature' => false, // this is going to be overwritten later ]; // Copy extensions from CSR. @@ -2526,7 +2526,7 @@ class X509 // 'directoryName' => $issuer->dn // ) //), - 'keyIdentifier' => $issuer->currentKeyIdentifier + 'keyIdentifier' => $issuer->currentKeyIdentifier, ]); //$extensions = &$this->currentCert['tbsCertificate']['extensions']; //if (isset($issuer->serialNumber)) { @@ -2636,10 +2636,10 @@ class X509 [ 'version' => 'v1', 'subject' => $this->dn, - 'subjectPKInfo' => $publicKey + 'subjectPKInfo' => $publicKey, ], 'signatureAlgorithm' => ['algorithm' => $signatureAlgorithm], - 'signature' => false // this is going to be overwritten later + 'signature' => false, // this is going to be overwritten later ]; } @@ -2694,10 +2694,10 @@ class X509 // both Firefox and OpenSSL ("openssl spkac -key private.key") behave this way // we could alternatively do this instead if we ignored the specs: // Random::string(8) & str_repeat("\x7F", 8) - 'challenge' => !empty($this->challenge) ? $this->challenge : '' + 'challenge' => !empty($this->challenge) ? $this->challenge : '', ], 'signatureAlgorithm' => ['algorithm' => $signatureAlgorithm], - 'signature' => false // this is going to be overwritten later + 'signature' => false, // this is going to be overwritten later ]; } @@ -2745,10 +2745,10 @@ class X509 'version' => 'v2', 'signature' => ['algorithm' => $signatureAlgorithm], 'issuer' => false, // this is going to be overwritten later - 'thisUpdate' => $this->timeField($thisUpdate) // $this->setStartDate() + 'thisUpdate' => $this->timeField($thisUpdate), // $this->setStartDate() ], 'signatureAlgorithm' => ['algorithm' => $signatureAlgorithm], - 'signature' => false // this is going to be overwritten later + 'signature' => false, // this is going to be overwritten later ]; } @@ -2808,7 +2808,7 @@ class X509 // 'directoryName' => $issuer->dn // ] //), - 'keyIdentifier' => $issuer->currentKeyIdentifier + 'keyIdentifier' => $issuer->currentKeyIdentifier, ]); //$extensions = &$tbsCertList['crlExtensions']; //if (isset($issuer->serialNumber)) { @@ -3604,7 +3604,7 @@ class X509 $i = count($rclist); $revocationDate = new \DateTimeImmutable('now', new \DateTimeZone(@date_default_timezone_get())); $rclist[] = ['userCertificate' => $serial, - 'revocationDate' => $this->timeField($revocationDate->format('D, d M Y H:i:s O'))]; + 'revocationDate' => $this->timeField($revocationDate->format('D, d M Y H:i:s O')), ]; return $i; } diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index 88860838..06966255 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -143,7 +143,7 @@ class BigInteger implements \JsonSerializable ['GMP'], ['PHP64', ['OpenSSL']], ['BCMath', ['OpenSSL']], - ['PHP32', ['OpenSSL']] + ['PHP32', ['OpenSSL']], ]; foreach ($engines as $engine) { try { @@ -283,7 +283,7 @@ class BigInteger implements \JsonSerializable [$q, $r] = $this->value->divide($y->value); return [ new static($q), - new static($r) + new static($r), ]; } @@ -315,7 +315,7 @@ class BigInteger implements \JsonSerializable return [ 'gcd' => new static($gcd), 'x' => new static($x), - 'y' => new static($y) + 'y' => new static($y), ]; } @@ -551,7 +551,7 @@ class BigInteger implements \JsonSerializable */ return [ 'min' => new static($min), - 'max' => new static($max) + 'max' => new static($max), ]; } diff --git a/phpseclib/Math/BigInteger/Engines/BCMath.php b/phpseclib/Math/BigInteger/Engines/BCMath.php index dc0b99d8..def5a8f4 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath.php @@ -263,7 +263,7 @@ class BCMath extends Engine return [ 'gcd' => $this->normalize(new static($u)), 'x' => $this->normalize(new static($a)), - 'y' => $this->normalize(new static($b)) + 'y' => $this->normalize(new static($b)), ]; } diff --git a/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php b/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php index 511a613e..f8cfd7b7 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php @@ -57,7 +57,7 @@ abstract class Barrett extends Base { static $cache = [ self::VARIABLE => [], - self::DATA => [] + self::DATA => [], ]; $m_length = strlen($m); @@ -82,7 +82,7 @@ abstract class Barrett extends Base $cache[self::DATA][] = [ 'u' => $u, // m.length >> 1 (technically (m.length >> 1) + 1) - 'm1' => $m1 // m.length + 'm1' => $m1, // m.length ]; } else { extract($cache[self::DATA][$key]); @@ -140,7 +140,7 @@ abstract class Barrett extends Base { static $cache = [ self::VARIABLE => [], - self::DATA => [] + self::DATA => [], ]; $n_length = strlen($n); diff --git a/phpseclib/Math/BigInteger/Engines/Engine.php b/phpseclib/Math/BigInteger/Engines/Engine.php index 0a798de2..7b8bf6f6 100644 --- a/phpseclib/Math/BigInteger/Engines/Engine.php +++ b/phpseclib/Math/BigInteger/Engines/Engine.php @@ -394,7 +394,7 @@ abstract class Engine implements \JsonSerializable { $result = [ 'value' => '0x' . $this->toHex(true), - 'engine' => basename(static::class) + 'engine' => basename(static::class), ]; return $this->precision > 0 ? $result + ['precision' => $this->precision] : $result; } @@ -573,7 +573,7 @@ abstract class Engine implements \JsonSerializable } return [ 'min' => new static($min, 256), - 'max' => new static($max, 256) + 'max' => new static($max, 256), ]; } @@ -1117,7 +1117,7 @@ abstract class Engine implements \JsonSerializable return [ 'gcd' => $u, 'x' => $a, - 'y' => $b + 'y' => $b, ]; } diff --git a/phpseclib/Math/BigInteger/Engines/GMP.php b/phpseclib/Math/BigInteger/Engines/GMP.php index c6bb0b88..5471f00b 100644 --- a/phpseclib/Math/BigInteger/Engines/GMP.php +++ b/phpseclib/Math/BigInteger/Engines/GMP.php @@ -276,7 +276,7 @@ class GMP extends Engine return [ 'gcd' => $this->normalize(new self($g)), 'x' => $this->normalize(new self($s)), - 'y' => $this->normalize(new self($t)) + 'y' => $this->normalize(new self($t)), ]; } diff --git a/phpseclib/Math/BigInteger/Engines/PHP.php b/phpseclib/Math/BigInteger/Engines/PHP.php index 7016b799..6fcf472e 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP.php +++ b/phpseclib/Math/BigInteger/Engines/PHP.php @@ -212,12 +212,12 @@ abstract class PHP extends Engine if ($x_size == 0) { return [ self::VALUE => $y_value, - self::SIGN => $y_negative + self::SIGN => $y_negative, ]; } elseif ($y_size == 0) { return [ self::VALUE => $x_value, - self::SIGN => $x_negative + self::SIGN => $x_negative, ]; } @@ -226,7 +226,7 @@ abstract class PHP extends Engine if ($x_value == $y_value) { return [ self::VALUE => [], - self::SIGN => false + self::SIGN => false, ]; } @@ -276,7 +276,7 @@ abstract class PHP extends Engine return [ self::VALUE => self::trim($value), - self::SIGN => $x_negative + self::SIGN => $x_negative, ]; } @@ -291,12 +291,12 @@ abstract class PHP extends Engine if ($x_size == 0) { return [ self::VALUE => $y_value, - self::SIGN => !$y_negative + self::SIGN => !$y_negative, ]; } elseif ($y_size == 0) { return [ self::VALUE => $x_value, - self::SIGN => $x_negative + self::SIGN => $x_negative, ]; } @@ -313,7 +313,7 @@ abstract class PHP extends Engine if (!$diff) { return [ self::VALUE => [], - self::SIGN => false + self::SIGN => false, ]; } @@ -360,7 +360,7 @@ abstract class PHP extends Engine return [ self::VALUE => self::trim($x_value), - self::SIGN => $x_negative + self::SIGN => $x_negative, ]; } @@ -382,7 +382,7 @@ abstract class PHP extends Engine if (!$x_length || !$y_length) { // a 0 is being multiplied return [ self::VALUE => [], - self::SIGN => false + self::SIGN => false, ]; } @@ -390,7 +390,7 @@ abstract class PHP extends Engine self::VALUE => min($x_length, $y_length) < 2 * self::KARATSUBA_CUTOFF ? self::trim(self::regularMultiply($x_value, $y_value)) : self::trim(self::karatsuba($x_value, $y_value)), - self::SIGN => $x_negative != $y_negative + self::SIGN => $x_negative != $y_negative, ]; } @@ -573,11 +573,11 @@ abstract class PHP extends Engine $x_window = [ $x_value[$i] ?? 0, $x_value[$i - 1] ?? 0, - $x_value[$i - 2] ?? 0 + $x_value[$i - 2] ?? 0, ]; $y_window = [ $y_value[$y_max], - ($y_max > 0) ? $y_value[$y_max - 1] : 0 + ($y_max > 0) ? $y_value[$y_max - 1] : 0, ]; $q_index = $i - $y_max - 1; diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php index dd44f89e..7019d3ff 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php @@ -49,7 +49,7 @@ abstract class Barrett extends Base { static $cache = [ self::VARIABLE => [], - self::DATA => [] + self::DATA => [], ]; $m_length = count($m); @@ -87,7 +87,7 @@ abstract class Barrett extends Base $cache[self::DATA][] = [ 'u' => $u, // m.length >> 1 (technically (m.length >> 1) + 1) - 'm1' => $m1 // m.length + 'm1' => $m1, // m.length ]; } else { extract($cache[self::DATA][$key]); @@ -139,7 +139,7 @@ abstract class Barrett extends Base { static $cache = [ self::VARIABLE => [], - self::DATA => [] + self::DATA => [], ]; $n_length = count($n); @@ -210,7 +210,7 @@ abstract class Barrett extends Base if (!$x_length || !$y_length) { // a 0 is being multiplied return [ self::VALUE => [], - self::SIGN => false + self::SIGN => false, ]; } @@ -262,7 +262,7 @@ abstract class Barrett extends Base return [ self::VALUE => self::trim($product_value), - self::SIGN => $x_negative != $y_negative + self::SIGN => $x_negative != $y_negative, ]; } } diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Montgomery.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Montgomery.php index bb935557..d7a38b63 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Montgomery.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Montgomery.php @@ -48,7 +48,7 @@ abstract class Montgomery extends Progenitor { static $cache = [ self::VARIABLE => [], - self::DATA => [] + self::DATA => [], ]; if (($key = array_search($n, $cache[self::VARIABLE])) === false) { diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php index f92fe0c1..03877c08 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php @@ -43,7 +43,7 @@ abstract class MontgomeryMult extends Montgomery static $cache = [ self::VARIABLE => [], - self::DATA => [] + self::DATA => [], ]; if (($key = array_search($m, $cache[self::VARIABLE])) === false) { diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 6af936db..8e9b2f31 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -3024,7 +3024,7 @@ class SFTP extends SSH2 if (isset($request_id) && $this->use_request_id && $packet_id != $request_id) { $this->requestBuffer[$packet_id] = [ 'packet_type' => $this->packet_type, - 'packet' => $packet + 'packet' => $packet, ]; return $this->get_sftp_packet($request_id); } diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 4f5e2c93..21bb4b81 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1456,7 +1456,7 @@ class SSH2 $compression_map = [ 'none' => self::NET_SSH2_COMPRESSION_NONE, 'zlib' => self::NET_SSH2_COMPRESSION_ZLIB, - 'zlib@openssh.com' => self::NET_SSH2_COMPRESSION_ZLIB_AT_OPENSSH + 'zlib@openssh.com' => self::NET_SSH2_COMPRESSION_ZLIB_AT_OPENSSH, ]; $compression_algorithm_in = self::array_intersect_first($s2c_compression_algorithms, $this->compression_algorithms_server_to_client); @@ -4258,14 +4258,14 @@ class SSH2 'crypt' => $this->encryption_algorithms_client_to_server, 'mac' => $this->mac_algorithms_client_to_server, 'comp' => $this->compression_algorithms_client_to_server, - 'lang' => $this->languages_client_to_server + 'lang' => $this->languages_client_to_server, ], 'server_to_client' => [ 'crypt' => $this->encryption_algorithms_server_to_client, 'mac' => $this->mac_algorithms_server_to_client, 'comp' => $this->compression_algorithms_server_to_client, - 'lang' => $this->languages_server_to_client - ] + 'lang' => $this->languages_server_to_client, + ], ]; } @@ -4316,7 +4316,7 @@ class SSH2 'rsa-sha2-256', // RFC 8332 'rsa-sha2-512', // RFC 8332 'ssh-rsa', // RECOMMENDED sign Raw RSA Key - 'ssh-dss' // REQUIRED sign Raw DSS Key + 'ssh-dss', // REQUIRED sign Raw DSS Key ]; } @@ -4384,7 +4384,7 @@ class SSH2 'OpenSSL (GCM)', 'OpenSSL', 'Eval', - 'PHP' + 'PHP', ]; } @@ -4474,7 +4474,7 @@ class SSH2 $compression_map = [ self::NET_SSH2_COMPRESSION_NONE => 'none', self::NET_SSH2_COMPRESSION_ZLIB => 'zlib', - self::NET_SSH2_COMPRESSION_ZLIB_AT_OPENSSH => 'zlib@openssh.com' + self::NET_SSH2_COMPRESSION_ZLIB_AT_OPENSSH => 'zlib@openssh.com', ]; return [ @@ -4489,7 +4489,7 @@ class SSH2 'crypt' => $this->decryptName, 'mac' => $this->hmac_check_name, 'comp' => $compression_map[$this->decompress], - ] + ], ]; } diff --git a/phpseclib/System/SSH/Agent/Identity.php b/phpseclib/System/SSH/Agent/Identity.php index 48981ee4..c3920196 100644 --- a/phpseclib/System/SSH/Agent/Identity.php +++ b/phpseclib/System/SSH/Agent/Identity.php @@ -90,7 +90,7 @@ class Identity implements PrivateKey 'secp256r1' => 'nistp256', 'secp384r1' => 'nistp384', 'secp521r1' => 'nistp521', - 'Ed25519' => 'Ed25519' + 'Ed25519' => 'Ed25519', ]; /** diff --git a/tests/Unit/Crypt/AES/TestCase.php b/tests/Unit/Crypt/AES/TestCase.php index 5d9e30fa..98013461 100644 --- a/tests/Unit/Crypt/AES/TestCase.php +++ b/tests/Unit/Crypt/AES/TestCase.php @@ -157,7 +157,7 @@ abstract class TestCase extends PhpseclibTestCase [32,32], [31,31], [17,17], - [99, 99] + [99, 99], ]; $result = []; diff --git a/tests/Unit/Crypt/BlowfishTest.php b/tests/Unit/Crypt/BlowfishTest.php index 903cc99e..5b0d89e7 100644 --- a/tests/Unit/Crypt/BlowfishTest.php +++ b/tests/Unit/Crypt/BlowfishTest.php @@ -60,7 +60,7 @@ class BlowfishTest extends PhpseclibTestCase [pack('H*', '0000000000000000'), pack('H*', 'FFFFFFFFFFFFFFFF'), pack('H*', '014933E0CDAFF6E4')], [pack('H*', 'FFFFFFFFFFFFFFFF'), pack('H*', '0000000000000000'), pack('H*', 'F21E9A77B71C49BC')], [pack('H*', '0123456789ABCDEF'), pack('H*', '0000000000000000'), pack('H*', '245946885754369A')], - [pack('H*', 'FEDCBA9876543210'), pack('H*', 'FFFFFFFFFFFFFFFF'), pack('H*', '6B5C5A9C5D9E0A5A')] + [pack('H*', 'FEDCBA9876543210'), pack('H*', 'FFFFFFFFFFFFFFFF'), pack('H*', '6B5C5A9C5D9E0A5A')], ]; $result = []; diff --git a/tests/Unit/Crypt/GCMTest.php b/tests/Unit/Crypt/GCMTest.php index de2c688f..b0d3bf2b 100644 --- a/tests/Unit/Crypt/GCMTest.php +++ b/tests/Unit/Crypt/GCMTest.php @@ -24,7 +24,7 @@ class GCMTest extends PhpseclibTestCase 'PHP', 'Eval', 'OpenSSL', - 'OpenSSL (GCM)' + 'OpenSSL (GCM)', ]; // test vectors come from the following URL: @@ -85,7 +85,7 @@ class GCMTest extends PhpseclibTestCase // Test Case 5 [$k2, $p3, $n3, $a1, $c4, '3612d2e79e3b0785561be14aaca2fccb'], // Test Case 6 - [$k2, $p3, $n4, $a1, $c5, '619cc5aefffe0bfa462af43c1699d050'] + [$k2, $p3, $n4, $a1, $c5, '619cc5aefffe0bfa462af43c1699d050'], ]; $vectors = []; @@ -135,7 +135,7 @@ class GCMTest extends PhpseclibTestCase 'Eval', 'OpenSSL', 'OpenSSL (GCM)', - 'libsodium' + 'libsodium', ]; $p1 = '00000000000000000000000000000000'; @@ -195,7 +195,7 @@ class GCMTest extends PhpseclibTestCase // Test Case 17 [$k2, $p3, $n3, $a1, $c4, '3a337dbf46a792c45e454913fe2ea8f2'], // Test Case 18 - [$k2, $p3, $n4, $a1, $c5, 'a44a8266ee1c8eb0c8b5d4cf5ae9f19a'] + [$k2, $p3, $n4, $a1, $c5, 'a44a8266ee1c8eb0c8b5d4cf5ae9f19a'], ]; $vectors = []; diff --git a/tests/Unit/Crypt/HashTest.php b/tests/Unit/Crypt/HashTest.php index 92090232..e4a5fb45 100644 --- a/tests/Unit/Crypt/HashTest.php +++ b/tests/Unit/Crypt/HashTest.php @@ -55,7 +55,7 @@ class HashTest extends PhpseclibTestCase [ 'sha256', '', - 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' + 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', ], [ 'sha256', @@ -70,7 +70,7 @@ class HashTest extends PhpseclibTestCase [ 'sha384', '', - '38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b' + '38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b', ], [ 'sha384', @@ -80,7 +80,7 @@ class HashTest extends PhpseclibTestCase [ 'sha512', '', - 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e' + 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e', ], [ 'sha512', @@ -96,76 +96,76 @@ class HashTest extends PhpseclibTestCase [ 'sha512/224', 'abc', - '4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa' + '4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa', ], [ 'sha512/224', 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu', - '23fec5bb94d60b23308192640b0c453335d664734fe40e7268674af9' + '23fec5bb94d60b23308192640b0c453335d664734fe40e7268674af9', ], // from http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA512_256.pdf [ 'sha512/256', 'abc', - '53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23' + '53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23', ], [ 'sha512/256', 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu', - '3928e184fb8690f840da3988121d31be65cb9d3ef83ee6146feac861e19b563a' + '3928e184fb8690f840da3988121d31be65cb9d3ef83ee6146feac861e19b563a', ], // from http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA224.pdf [ 'sha224', 'abc', - '23097D223405D8228642A477BDA255B32AADBCE4BDA0B3F7E36C9DA7' + '23097D223405D8228642A477BDA255B32AADBCE4BDA0B3F7E36C9DA7', ], [ 'sha224', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', - '75388B16512776CC5DBA5DA1FD890150B0C6455CB4F58B1952522525' + '75388B16512776CC5DBA5DA1FD890150B0C6455CB4F58B1952522525', ], // from https://www.di-mgt.com.au/sha_testvectors.html#KECCAK-KAT [ 'sha3-224', 'abc', - 'e642824c3f8cf24ad09234ee7d3c766fc9a3a5168d0c94ad73b46fdf' + 'e642824c3f8cf24ad09234ee7d3c766fc9a3a5168d0c94ad73b46fdf', ], [ 'sha3-256', 'abc', - '3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532' + '3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532', ], [ 'sha3-384', 'abc', - 'ec01498288516fc926459f58e2c6ad8df9b473cb0fc08c2596da7cf0e49be4b298d88cea927ac7f539f1edf228376d25' + 'ec01498288516fc926459f58e2c6ad8df9b473cb0fc08c2596da7cf0e49be4b298d88cea927ac7f539f1edf228376d25', ], [ 'sha3-512', 'abc', - 'b751850b1a57168a5693cd924b6b096e08f621827444f70d884f5d0240d2712e10e116e9192af3c91a7ec57647e3934057340b4cf408d5a56592f8274eec53f0' + 'b751850b1a57168a5693cd924b6b096e08f621827444f70d884f5d0240d2712e10e116e9192af3c91a7ec57647e3934057340b4cf408d5a56592f8274eec53f0', ], [ 'shake256-912', // this is what Ed448 uses str_repeat('a', 135), // one character shy of the block size (136) - '55b991ece1e567b6e7c2c714444dd201cd51f4f3832d08e1d26bebc63e07a3d7ddeed4a5aa6df7a15f89f2050566f75d9cf1a4dea4ed1f578df0985d5706d49e877d9a913dcdbc26a4c4e807ec72dc10438df95873e24660e39cd49aa4e5df286cb5ba60eaad91ff134754c21cd736681a8f' + '55b991ece1e567b6e7c2c714444dd201cd51f4f3832d08e1d26bebc63e07a3d7ddeed4a5aa6df7a15f89f2050566f75d9cf1a4dea4ed1f578df0985d5706d49e877d9a913dcdbc26a4c4e807ec72dc10438df95873e24660e39cd49aa4e5df286cb5ba60eaad91ff134754c21cd736681a8f', ], // from https://docs.ethers.io/v5/api/utils/hashing/ [ 'keccak256', // used by Ethereum "\x12\x34", - '56570de287d73cd1cb6092bb8fdee6173974955fdef345ae579ee9f475ea7432' + '56570de287d73cd1cb6092bb8fdee6173974955fdef345ae579ee9f475ea7432', ], [ 'keccak256', '', - 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470' + 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470', ], [ 'keccak256', 'hello world', - '47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad' + '47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad', ], ]; } @@ -234,7 +234,7 @@ class HashTest extends PhpseclibTestCase 'sha224', pack('H*', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), 'This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.', - '3a854166ac5d9f023f54d517d0b39dbd946770db9c2b95c9f6f565d1' + '3a854166ac5d9f023f54d517d0b39dbd946770db9c2b95c9f6f565d1', ], // test case 1 @@ -278,7 +278,7 @@ class HashTest extends PhpseclibTestCase 'sha256', pack('H*', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), 'This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.', - '9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2' + '9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2', ], // test case 1 @@ -322,7 +322,7 @@ class HashTest extends PhpseclibTestCase 'sha384', pack('H*', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), 'This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.', - '6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82461e99c5a678cc31e799176d3860e6110c46523e' + '6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82461e99c5a678cc31e799176d3860e6110c46523e', ], // test case 1 @@ -366,7 +366,7 @@ class HashTest extends PhpseclibTestCase 'sha512', pack('H*', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), 'This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.', - 'e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58' + 'e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58', ], ]; } diff --git a/tests/Unit/Crypt/RC2Test.php b/tests/Unit/Crypt/RC2Test.php index 18adabaa..3be19476 100644 --- a/tests/Unit/Crypt/RC2Test.php +++ b/tests/Unit/Crypt/RC2Test.php @@ -33,7 +33,7 @@ class RC2Test extends PhpseclibTestCase ['88bca90e90875a', 64, '0000000000000000', '6ccf4308974c267f'], ['88bca90e90875a7f0f79c384627bafb2', 64, '0000000000000000', '1a807d272bbe5db1'], ['88bca90e90875a7f0f79c384627bafb2', 128, '0000000000000000', '2269552ab0f85ca6'], - ['88bca90e90875a7f0f79c384627bafb216f80a6f85920584c42fceb0be255daf1e', 129, '0000000000000000', '5b78d3a43dfff1f1'] + ['88bca90e90875a7f0f79c384627bafb216f80a6f85920584c42fceb0be255daf1e', 129, '0000000000000000', '5b78d3a43dfff1f1'], ]; $result = []; diff --git a/tests/Unit/Crypt/RC4Test.php b/tests/Unit/Crypt/RC4Test.php index 9a52a19f..72909da3 100644 --- a/tests/Unit/Crypt/RC4Test.php +++ b/tests/Unit/Crypt/RC4Test.php @@ -45,8 +45,8 @@ class RC4Test extends PhpseclibTestCase ['offset' => 3056, 'result' => 'f2e30f9bd102ecbf75aaade9bc35c43c'], ['offset' => 3072, 'result' => 'ec0e11c479dc329dc8da7968fe965681'], ['offset' => 4080, 'result' => '068326a2118416d21f9d04b2cd1ca050'], - ['offset' => 4096, 'result' => 'ff25b58995996707e51fbdf08b34d875'] - ] + ['offset' => 4096, 'result' => 'ff25b58995996707e51fbdf08b34d875'], + ], ], [ 'key' => pack('H*', '01020304050607'), // 56-bit key @@ -68,8 +68,8 @@ class RC4Test extends PhpseclibTestCase ['offset' => 3056, 'result' => 'adfd3868b8e51485d5e610017e3dd609'], ['offset' => 3072, 'result' => 'ad26581c0c5be45f4cea01db2f3805d5'], ['offset' => 4080, 'result' => 'f3172ceffc3b3d997c85ccd5af1a950c'], - ['offset' => 4096, 'result' => 'e74b0b9731227fd37c0ec08a47ddd8b8'] - ] + ['offset' => 4096, 'result' => 'e74b0b9731227fd37c0ec08a47ddd8b8'], + ], ], [ 'key' => pack('H*', '0102030405060708'), // 64-bit key @@ -91,8 +91,8 @@ class RC4Test extends PhpseclibTestCase ['offset' => 3056, 'result' => '26b51ea37df8e1d6f76fc3b66a7429b3'], ['offset' => 3072, 'result' => 'bc7683205d4f443dc1f29dda3315c87b'], ['offset' => 4080, 'result' => 'd5fa5a3469d29aaaf83d23589db8c85b'], - ['offset' => 4096, 'result' => '3fb46e2c8f0f068edce8cdcd7dfc5862'] - ] + ['offset' => 4096, 'result' => '3fb46e2c8f0f068edce8cdcd7dfc5862'], + ], ], [ 'key' => pack('H*', '0102030405060708090a'), // 80-bit key @@ -114,8 +114,8 @@ class RC4Test extends PhpseclibTestCase ['offset' => 3056, 'result' => '552225ed1177f44584ac8cfa6c4eb5fc'], ['offset' => 3072, 'result' => '7e82cbabfc95381b080998442129c2f8'], ['offset' => 4080, 'result' => '1f135ed14ce60a91369d2322bef25e3c'], - ['offset' => 4096, 'result' => '08b6be45124a43e2eb77953f84dc8553'] - ] + ['offset' => 4096, 'result' => '08b6be45124a43e2eb77953f84dc8553'], + ], ], [ 'key' => pack('H*', '0102030405060708090a0b0c0d0e0f10'), // 128-bit key @@ -137,8 +137,8 @@ class RC4Test extends PhpseclibTestCase ['offset' => 3056, 'result' => 'fabeb76028ade2d0e48722e46c4615a3'], ['offset' => 3072, 'result' => 'c05d88abd50357f935a63c59ee537623'], ['offset' => 4080, 'result' => 'ff38265c1642c1abe8d3c2fe5e572bf8'], - ['offset' => 4096, 'result' => 'a36a4c301ae8ac13610ccbc12256cacc'] - ] + ['offset' => 4096, 'result' => 'a36a4c301ae8ac13610ccbc12256cacc'], + ], ], [ 'key' => pack('H*', '0102030405060708090a0b0c0d0e0f101112131415161718'), // 192-bit key @@ -160,8 +160,8 @@ class RC4Test extends PhpseclibTestCase ['offset' => 3056, 'result' => '6866397e95c140534f94263421006e40'], ['offset' => 3072, 'result' => '32cb0a1e9542c6b3b8b398abc3b0f1d5'], ['offset' => 4080, 'result' => '29a0b8aed54a132324c62e423f54b4c8'], - ['offset' => 4096, 'result' => '3cb0f3b5020a98b82af9fe154484a168'] - ] + ['offset' => 4096, 'result' => '3cb0f3b5020a98b82af9fe154484a168'], + ], ], [ 'key' => pack('H*', '0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20'), // 256-bit key @@ -183,9 +183,9 @@ class RC4Test extends PhpseclibTestCase ['offset' => 3056, 'result' => '8aed95ee5b0dcbfbef4eb21d3a3f52f9'], ['offset' => 3072, 'result' => '625a1ab00ee39a5327346bddb01a9c18'], ['offset' => 4080, 'result' => 'a13a7c79c7e119b5ab0296ab28c300b9'], - ['offset' => 4096, 'result' => 'f3e4c0a2e02d1d01f7f0a74618af2b48'] - ] - ] + ['offset' => 4096, 'result' => 'f3e4c0a2e02d1d01f7f0a74618af2b48'], + ], + ], ]; $result = []; diff --git a/tests/Unit/Crypt/RSA/LoadKeyTest.php b/tests/Unit/Crypt/RSA/LoadKeyTest.php index d8273877..740b7491 100644 --- a/tests/Unit/Crypt/RSA/LoadKeyTest.php +++ b/tests/Unit/Crypt/RSA/LoadKeyTest.php @@ -44,7 +44,7 @@ class LoadKeyTest extends PhpseclibTestCase { $rsa = PublicKeyLoader::load([ 'e' => new BigInteger('123', 16), - 'n' => new BigInteger('123', 16) + 'n' => new BigInteger('123', 16), ]); $this->assertInstanceOf(PublicKey::class, $rsa); @@ -1149,7 +1149,7 @@ n9dyFZYXxil/cgFG/PDMnuXy1Wcl8hb8iwQag4Y7ohiLXVTJa/0BAgMBAAE= 'n' => $key['n'], 'd' => $key['d'], 'p' => $key['primes'][1], - 'q' => $key['primes'][2] + 'q' => $key['primes'][2], ]; $key = PublicKeyLoader::loadPrivateKey($key); $str2 = "$key"; diff --git a/tests/Unit/Crypt/RSA/ModeTest.php b/tests/Unit/Crypt/RSA/ModeTest.php index fdb447b2..880d22be 100644 --- a/tests/Unit/Crypt/RSA/ModeTest.php +++ b/tests/Unit/Crypt/RSA/ModeTest.php @@ -144,11 +144,11 @@ U9VQQSQzY1oZMVX8i1m5WUTLPz2yLJIBQVdXqhMCQBGoiuSoSjafUhV7i1cEGpb88h5NBYZzWXGZ public function testPSSSigsWithNonPowerOf2Key(): void { $pub = <<withHash('sha256') @@ -164,11 +164,11 @@ HERE; public function testHash(): void { $pub = <<withHash('sha1') @@ -202,7 +202,7 @@ HERE; 'E252896950917476ECE5E8FC27D5F053D6018D91B502C4787558A002B9283DA7', 16 ), - 'e' => new BigInteger('3') + 'e' => new BigInteger('3'), ]); $message = 'hello world!'; diff --git a/tests/Unit/Crypt/RandomTest.php b/tests/Unit/Crypt/RandomTest.php index 1bc1d9f1..4cbd9d28 100644 --- a/tests/Unit/Crypt/RandomTest.php +++ b/tests/Unit/Crypt/RandomTest.php @@ -20,7 +20,7 @@ class RandomTest extends PhpseclibTestCase return array_map([$this, 'wrap'], [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 19, 20, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 111, 128, 1000, - 1024, 10000, 12345, 100000, 123456 + 1024, 10000, 12345, 100000, 123456, ]); } diff --git a/tests/Unit/Crypt/Salsa20Test.php b/tests/Unit/Crypt/Salsa20Test.php index 6082bfef..469c2cdb 100644 --- a/tests/Unit/Crypt/Salsa20Test.php +++ b/tests/Unit/Crypt/Salsa20Test.php @@ -31,7 +31,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => '4DFA5E481DA23EA09A31022050859936' . 'DA52FCEE218005164F267CB65F5CFD7F' . '2B4F97E0FF16924A52DF269515110A07' . - 'F9E460BC65EF95DA58F740B7D1DBB0AA' + 'F9E460BC65EF95DA58F740B7D1DBB0AA', ], // set 2 [ @@ -40,7 +40,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => '6513ADAECFEB124C1CBE6BDAEF690B4F' . 'FB00B0FCACE33CE806792BB414801998' . '34BFB1CFDD095802C6E95E251002989A' . - 'C22AE588D32AE79320D9BD7732E00338' + 'C22AE588D32AE79320D9BD7732E00338', ], // set 3 [ @@ -49,7 +49,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => '2DD5C3F7BA2B20F76802410C68868889' . '5AD8C1BD4EA6C9B140FB9B90E21049BF' . '583F527970EBC1A4C4C5AF117A5940D9' . - '2B98895B1902F02BF6E9BEF8D6B4CCBE' + '2B98895B1902F02BF6E9BEF8D6B4CCBE', ], // set 4 [ @@ -58,7 +58,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => 'BE4EF3D2FAC6C4C3D822CE67436A407C' . 'C237981D31A65190B51053D13A19C89F' . 'C90ACB45C8684058733EDD259869C58E' . - 'EF760862BEFBBCA0F6E675FD1FA25C27' + 'EF760862BEFBBCA0F6E675FD1FA25C27', ], // set 5 [ @@ -67,7 +67,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => 'B66C1E4446DD9557E578E223B0B76801' . '7B23B267BB0234AE4626BF443F219776' . '436FB19FD0E8866FCD0DE9A9538F4A09' . - 'CA9AC0732E30BCF98E4F13E4B9E201D9' + 'CA9AC0732E30BCF98E4F13E4B9E201D9', ], // set 6 [ @@ -76,7 +76,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => '05E1E7BEB697D999656BF37C1B978806' . '735D0B903A6007BD329927EFBE1B0E2A' . '8137C1AE291493AA83A821755BEE0B06' . - 'CD14855A67E46703EBF8F3114B584CBA' + 'CD14855A67E46703EBF8F3114B584CBA', ], // key size: 256 bits // set 1 @@ -86,7 +86,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => 'E3BE8FDD8BECA2E3EA8EF9475B29A6E7' . '003951E1097A5C38D23B7A5FAD9F6844' . 'B22C97559E2723C7CBBD3FE4FC8D9A07' . - '44652A83E72A9C461876AF4D7EF1A117' + '44652A83E72A9C461876AF4D7EF1A117', ], // set 2 [ @@ -95,7 +95,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => '9A97F65B9B4C721B960A672145FCA8D4' . 'E32E67F9111EA979CE9C4826806AEEE6' . '3DE9C0DA2BD7F91EBCB2639BF989C625' . - '1B29BF38D39A9BDCE7C55F4B2AC12A39' + '1B29BF38D39A9BDCE7C55F4B2AC12A39', ], // set 3 [ @@ -104,7 +104,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => 'B580F7671C76E5F7441AF87C146D6B51' . '3910DC8B4146EF1B3211CF12AF4A4B49' . 'E5C874B3EF4F85E7D7ED539FFEBA73EB' . - '73E0CCA74FBD306D8AA716C7783E89AF' + '73E0CCA74FBD306D8AA716C7783E89AF', ], // set 4 [ @@ -113,7 +113,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => 'F9D2DC274BB55AEFC2A0D9F8A982830F' . '6916122BC0A6870F991C6ED8D00D2F85' . '94E3151DE4C5A19A9A06FBC191C87BF0' . - '39ADF971314BAF6D02337080F2DAE5CE' + '39ADF971314BAF6D02337080F2DAE5CE', ], // set 5 [ @@ -122,7 +122,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => '2ABA3DC45B4947007B14C851CD694456' . 'B303AD59A465662803006705673D6C3E' . '29F1D3510DFC0405463C03414E0E07E3' . - '59F1F1816C68B2434A19D3EEE0464873' + '59F1F1816C68B2434A19D3EEE0464873', ], // set 6 [ @@ -131,7 +131,7 @@ class Salsa20Test extends PhpseclibTestCase 'result' => 'F5FAD53F79F9DF58C4AEA0D0ED9A9601' . 'F278112CA7180D565B420A48019670EA' . 'F24CE493A86263F677B46ACE1924773D' . - '2BB25571E1AA8593758FC382B1280B71' + '2BB25571E1AA8593758FC382B1280B71', ], ]; diff --git a/tests/Unit/Crypt/TripleDESTest.php b/tests/Unit/Crypt/TripleDESTest.php index ed4ccf1d..9aad0095 100644 --- a/tests/Unit/Crypt/TripleDESTest.php +++ b/tests/Unit/Crypt/TripleDESTest.php @@ -90,7 +90,7 @@ class TripleDESTest extends PhpseclibTestCase [str_repeat("\x01", 24), pack('H*', '0000000000000008'), pack('H*', 'CC083F1E6D9E85F6')], [str_repeat("\x01", 24), pack('H*', '0000000000000004'), pack('H*', 'D2FD8867D50D2DFE')], [str_repeat("\x01", 24), pack('H*', '0000000000000002'), pack('H*', '06E7EA22CE92708F')], - [str_repeat("\x01", 24), pack('H*', '0000000000000001'), pack('H*', '166B40B44ABA4BD6')] + [str_repeat("\x01", 24), pack('H*', '0000000000000001'), pack('H*', '166B40B44ABA4BD6')], ]; $result = []; @@ -137,12 +137,12 @@ class TripleDESTest extends PhpseclibTestCase pack('H*', '627f460e08104a10' . '43cd265d5840eaf1' . '313edf97df2a8a8c'), pack('H*', '8e29f75ea77e5475'), pack('H*', '326a494cd33fe756'), - pack('H*', 'b22b8d66de970692')], + pack('H*', 'b22b8d66de970692'), ], [ pack('H*', '37ae5ebf46dff2dc' . '0754b94f31cbb385' . '5e7fd36dc870bfae'), pack('H*', '3d1de3cc132e3b65'), pack('H*', '84401f78fe6c10876d8ea23094ea5309'), - pack('H*', '7b1f7c7e3b1c948ebd04a75ffba7d2f5')] + pack('H*', '7b1f7c7e3b1c948ebd04a75ffba7d2f5'), ], ]; $result = []; diff --git a/tests/Unit/File/ASN1Test.php b/tests/Unit/File/ASN1Test.php index 53dc504d..9c7e3f4a 100644 --- a/tests/Unit/File/ASN1Test.php +++ b/tests/Unit/File/ASN1Test.php @@ -28,45 +28,45 @@ class ASN1Test extends PhpseclibTestCase 'constant' => 0, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY], + 'type' => ASN1::TYPE_ANY, ], 'msg-type' => [ 'constant' => 1, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY], + 'type' => ASN1::TYPE_ANY, ], 'padata' => [ 'constant' => 2, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY], + 'type' => ASN1::TYPE_ANY, ], 'crealm' => [ 'constant' => 3, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY], + 'type' => ASN1::TYPE_ANY, ], 'cname' => [ 'constant' => 4, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY], + 'type' => ASN1::TYPE_ANY, ], 'ticket' => [ 'constant' => 5, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY], + 'type' => ASN1::TYPE_ANY, ], 'enc-part' => [ 'constant' => 6, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY] - ] + 'type' => ASN1::TYPE_ANY, ], + ], ]; $AS_REP = [ 'class' => ASN1::CLASS_APPLICATION, 'cast' => 11, 'optional' => true, - 'explicit' => true + 'explicit' => true, ] + $KDC_REP; $str = 'a4IC3jCCAtqgAwIBBaEDAgELoi8wLTAroQMCAROiJAQiMCAwHqADAgEXoRcbFUNSRUFUVUlUWS5ORVR0ZXN0dXNlcqMPGw' . @@ -100,15 +100,15 @@ class ASN1Test extends PhpseclibTestCase 'constant' => 1, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_INTEGER + 'type' => ASN1::TYPE_INTEGER, ], 'padata-value' => [ 'constant' => 2, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_OCTET_STRING - ] - ] + 'type' => ASN1::TYPE_OCTET_STRING, + ], + ], ]; $PrincipalName = [ @@ -118,7 +118,7 @@ class ASN1Test extends PhpseclibTestCase 'constant' => 0, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_INTEGER + 'type' => ASN1::TYPE_INTEGER, ], 'name-string' => [ 'constant' => 1, @@ -127,9 +127,9 @@ class ASN1Test extends PhpseclibTestCase 'min' => 0, 'max' => -1, 'type' => ASN1::TYPE_SEQUENCE, - 'children' => ['type' => ASN1::TYPE_IA5_STRING] // should be \phpseclib3\File\ASN1::TYPE_GENERAL_STRING - ] - ] + 'children' => ['type' => ASN1::TYPE_IA5_STRING], // should be \phpseclib3\File\ASN1::TYPE_GENERAL_STRING + ], + ], ]; $Ticket = [ @@ -143,27 +143,27 @@ class ASN1Test extends PhpseclibTestCase 'constant' => 0, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_INTEGER + 'type' => ASN1::TYPE_INTEGER, ], 'realm' => [ 'constant' => 1, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY + 'type' => ASN1::TYPE_ANY, ], 'sname' => [ 'constant' => 2, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY + 'type' => ASN1::TYPE_ANY, ], 'enc-part' => [ 'constant' => 3, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY - ] - ] + 'type' => ASN1::TYPE_ANY, + ], + ], ]; $KDC_REP = [ @@ -173,12 +173,12 @@ class ASN1Test extends PhpseclibTestCase 'constant' => 0, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_INTEGER], + 'type' => ASN1::TYPE_INTEGER, ], 'msg-type' => [ 'constant' => 1, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_INTEGER], + 'type' => ASN1::TYPE_INTEGER, ], 'padata' => [ 'constant' => 2, 'optional' => true, @@ -186,16 +186,16 @@ class ASN1Test extends PhpseclibTestCase 'min' => 0, 'max' => -1, 'type' => ASN1::TYPE_SEQUENCE, - 'children' => $PA_DATA], + 'children' => $PA_DATA, ], 'crealm' => [ 'constant' => 3, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_OCTET_STRING], + 'type' => ASN1::TYPE_OCTET_STRING, ], 'cname' => [ 'constant' => 4, 'optional' => true, - 'explicit' => true] + $PrincipalName, + 'explicit' => true, ] + $PrincipalName, //'type' => ASN1::TYPE_ANY), 'ticket' => [ 'constant' => 5, @@ -204,20 +204,20 @@ class ASN1Test extends PhpseclibTestCase 'min' => 0, 'max' => 1, 'type' => ASN1::TYPE_SEQUENCE, - 'children' => $Ticket], + 'children' => $Ticket, ], 'enc-part' => [ 'constant' => 6, 'optional' => true, 'explicit' => true, - 'type' => ASN1::TYPE_ANY] - ] + 'type' => ASN1::TYPE_ANY, ], + ], ]; $AS_REP = [ 'class' => ASN1::CLASS_APPLICATION, 'cast' => 11, 'optional' => true, - 'explicit' => true + 'explicit' => true, ] + $KDC_REP; $str = 'a4IC3jCCAtqgAwIBBaEDAgELoi8wLTAroQMCAROiJAQiMCAwHqADAgEXoRcbFUNSRUFUVUlUWS5ORVR0ZXN0dXNlcqMPGw' . @@ -330,9 +330,9 @@ class ASN1Test extends PhpseclibTestCase 'explicit' => true, 'default' => 'v1', 'type' => ASN1::TYPE_INTEGER, - 'mapping' => ['v1', 'v2', 'v3'] - ] - ] + 'mapping' => ['v1', 'v2', 'v3'], + ], + ], ]; $data = ['version' => 'v3']; @@ -389,13 +389,13 @@ class ASN1Test extends PhpseclibTestCase 'constant' => 0, 'optional' => true, 'implicit' => true, - 'type' => ASN1::TYPE_GENERALIZED_TIME], + 'type' => ASN1::TYPE_GENERALIZED_TIME, ], 'notAfter' => [ 'constant' => 1, 'optional' => true, 'implicit' => true, - 'type' => ASN1::TYPE_GENERALIZED_TIME] - ] + 'type' => ASN1::TYPE_GENERALIZED_TIME, ], + ], ]; $a = pack('H*', '3026a011180f32303137303432313039303535305aa111180f32303138303432313230353935395a'); diff --git a/tests/Unit/File/X509/X509Test.php b/tests/Unit/File/X509/X509Test.php index 5b38fedc..3cbd7fcb 100644 --- a/tests/Unit/File/X509/X509Test.php +++ b/tests/Unit/File/X509/X509Test.php @@ -286,8 +286,8 @@ Mj93S ['utf8String' => "Al. Marsza\xC5\x82ka Pi\xC5\x82sudskiego 52/54"], ['utf8String' => '81-382 Gdynia'], ['utf8String' => 'Polska'], - ['utf8String' => 'pomorskie'] - ] + ['utf8String' => 'pomorskie'], + ], ]; $this->assertEquals($x509->getDNProp('id-at-postalAddress'), $expected); diff --git a/tests/Unit/Math/BigInteger/TestCase.php b/tests/Unit/Math/BigInteger/TestCase.php index 8ae79d1b..75d63e41 100644 --- a/tests/Unit/Math/BigInteger/TestCase.php +++ b/tests/Unit/Math/BigInteger/TestCase.php @@ -494,7 +494,7 @@ abstract class TestCase extends PhpseclibTestCase { $vals = [ '-9223372036854775808', // eg. 8000 0000 0000 0000 - '-1' + '-1', ]; foreach ($vals as $val) { $x = $this->getInstance($val); diff --git a/tests/Unit/Math/BigIntegerTest.php b/tests/Unit/Math/BigIntegerTest.php index 42d2deaa..983a6d42 100644 --- a/tests/Unit/Math/BigIntegerTest.php +++ b/tests/Unit/Math/BigIntegerTest.php @@ -18,16 +18,16 @@ class BigIntegerTest extends PhpseclibTestCase private static function mockEngine(string $className, bool $isValid): void { eval(<<