php-cs-fixer ci

php-cs-fixer ci
This commit is contained in:
Jack Worman 2022-01-30 09:34:42 -06:00 committed by terrafrost
parent ea3bee985c
commit ef66d9f7dd
107 changed files with 296 additions and 296 deletions

9
.gitignore vendored
View File

@ -1,5 +1,8 @@
/vendor
/composer.phar
/.idea/
/build/vendor/
/build/php-cs-fixer.cache
/build/composer.lock
/composer.lock
/composer.phar
/vendor/
.gitignore
composer.lock

View File

@ -34,4 +34,5 @@ install:
script:
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' ]; then vendor/bin/phing -f build/build.xml sniff; fi"
- sh -c "if [ -d build/vendor ]; then build/vendor/bin/php-cs-fixer fix --config=build/php-cs-fixer.php --diff --dry-run; fi"
- travis/run-phpunit.sh

14
build/composer.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "phpseclib/tools",
"description": "",
"minimum-stability": "stable",
"license": "proprietary",
"authors": [{"name": "Jack Worman", "email": "jworman@healthcall.com"}],
"require": {
"php": "^8.1.0",
"friendsofphp/php-cs-fixer": "^3.5"
},
"config": {
"sort-packages": true
}
}

23
build/php-cs-fixer.php Normal file
View File

@ -0,0 +1,23 @@
<?php
return (new PhpCsFixer\Config())
->setFinder(PhpCsFixer\Finder::create()->in(__DIR__ . '/..'))
->setCacheFile(__DIR__ . '/php-cs-fixer.cache')
->setRiskyAllowed(true)
// https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/rules/index.rst
->setRules(
[
// Array
'array_syntax' => ['syntax' => 'short'],
// Function Notation
'native_function_invocation' => ['exclude' => [], 'include' => [], 'scope' => 'all', 'strict' => true],
// Import
'fully_qualified_strict_types' => true,
'global_namespace_import' => ['import_constants' => false, 'import_functions' => false, 'import_classes' => false],
'no_leading_import_slash' => true,
'no_unused_imports' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'const', 'function']],
'single_import_per_statement' => true,
'single_line_after_imports' => true,
]
);

View File

@ -15,8 +15,8 @@
namespace phpseclib3\Crypt;
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Exception\BadDecryptionException;
use phpseclib3\Exception\InsufficientSetupException;
/**
* Pure-PHP implementation of ChaCha20.

View File

@ -15,13 +15,12 @@
namespace phpseclib3\Crypt\Common;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Exception\NoKeyLoadedException;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\Hash;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\ECDSA;
use phpseclib3\Exception\NoKeyLoadedException;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Math\BigInteger;
/**
* Base Class for all asymmetric cipher classes

View File

@ -17,13 +17,13 @@ namespace phpseclib3\Crypt\Common\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Crypt\Random;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\DES;
use phpseclib3\Crypt\Random;
use phpseclib3\Crypt\TripleDES;
use phpseclib3\File\ASN1;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\File\ASN1;
/**
* PKCS1 Formatted Key Handler

View File

@ -28,17 +28,16 @@
namespace phpseclib3\Crypt\Common\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\DES;
use phpseclib3\Crypt\Random;
use phpseclib3\Crypt\RC2;
use phpseclib3\Crypt\RC4;
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\TripleDES;
use phpseclib3\Crypt\Random;
use phpseclib3\Math\BigInteger;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\UnsupportedAlgorithmException;
/**
* PKCS#8 Formatted Key Handler

View File

@ -17,10 +17,10 @@ namespace phpseclib3\Crypt\Common\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\Hash;
use phpseclib3\Crypt\Random;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\UnsupportedAlgorithmException;
/**

View File

@ -36,16 +36,16 @@
namespace phpseclib3\Crypt\Common;
use phpseclib3\Crypt\Hash;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\BinaryField;
use phpseclib3\Math\PrimeField;
use phpseclib3\Crypt\Hash;
use phpseclib3\Exception\BadDecryptionException;
use phpseclib3\Exception\BadModeException;
use phpseclib3\Exception\InconsistentSetupException;
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\BinaryField;
use phpseclib3\Math\PrimeField;
/**
* Base Class for all \phpseclib3\Crypt\* cipher classes

View File

@ -26,12 +26,12 @@
namespace phpseclib3\Crypt;
use phpseclib3\Exception\NoKeyLoadedException;
use phpseclib3\Exception\UnsupportedOperationException;
use phpseclib3\Crypt\Common\AsymmetricKey;
use phpseclib3\Crypt\DH\Parameters;
use phpseclib3\Crypt\DH\PrivateKey;
use phpseclib3\Crypt\DH\PublicKey;
use phpseclib3\Crypt\DH\Parameters;
use phpseclib3\Exception\NoKeyLoadedException;
use phpseclib3\Exception\UnsupportedOperationException;
use phpseclib3\Math\BigInteger;
/**

View File

@ -23,10 +23,10 @@
namespace phpseclib3\Crypt\DH\Formats\Keys;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS1 as Progenitor;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Math\BigInteger;
/**
* "PKCS1" Formatted DH Key Handler

View File

@ -21,11 +21,11 @@
namespace phpseclib3\Crypt\DH\Formats\Keys;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS8 as Progenitor;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
/**
* PKCS#8 Formatted DH Key Handler

View File

@ -13,8 +13,8 @@
namespace phpseclib3\Crypt\DH;
use phpseclib3\Crypt\DH;
use phpseclib3\Crypt\Common;
use phpseclib3\Crypt\DH;
/**
* DH Private Key

View File

@ -13,8 +13,8 @@
namespace phpseclib3\Crypt\DH;
use phpseclib3\Crypt\DH;
use phpseclib3\Crypt\Common;
use phpseclib3\Crypt\DH;
/**
* DH Public Key

View File

@ -32,11 +32,11 @@
namespace phpseclib3\Crypt;
use phpseclib3\Crypt\Common\AsymmetricKey;
use phpseclib3\Crypt\DSA\Parameters;
use phpseclib3\Crypt\DSA\PrivateKey;
use phpseclib3\Crypt\DSA\PublicKey;
use phpseclib3\Crypt\DSA\Parameters;
use phpseclib3\Math\BigInteger;
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Math\BigInteger;
/**
* Pure-PHP FIPS 186-4 compliant implementation of DSA.

View File

@ -17,10 +17,9 @@
namespace phpseclib3\Crypt\DSA\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\OpenSSH as Progenitor;
use phpseclib3\Math\BigInteger;
/**
* OpenSSH Formatted DSA Key Handler

View File

@ -29,11 +29,11 @@
namespace phpseclib3\Crypt\DSA\Formats\Keys;
use phpseclib3\Math\BigInteger;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS1 as Progenitor;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Math\BigInteger;
/**
* PKCS#1 Formatted DSA Key Handler

View File

@ -25,11 +25,11 @@
namespace phpseclib3\Crypt\DSA\Formats\Keys;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS8 as Progenitor;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
/**
* PKCS#8 Formatted DSA Key Handler

View File

@ -20,9 +20,9 @@
namespace phpseclib3\Crypt\DSA\Formats\Keys;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PuTTY as Progenitor;
use phpseclib3\Math\BigInteger;
/**
* PuTTY Formatted DSA Key Handler

View File

@ -22,8 +22,8 @@
namespace phpseclib3\Crypt\DSA\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
/**
* XML Formatted DSA Key Handler

View File

@ -18,9 +18,9 @@
namespace phpseclib3\Crypt\DSA\Formats\Signature;
use phpseclib3\Math\BigInteger;
use phpseclib3\File\ASN1 as Encoder;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Math\BigInteger;
/**
* ASN1 Signature Handler

View File

@ -17,8 +17,8 @@
namespace phpseclib3\Crypt\DSA\Formats\Signature;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
/**
* SSH2 Signature Handler

View File

@ -13,10 +13,10 @@
namespace phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\Common;
use phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\DSA\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\Common;
/**
* DSA Private Key

View File

@ -13,9 +13,9 @@
namespace phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\Common;
use phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\DSA\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib3\Crypt\Common;
/**
* DSA Public Key

View File

@ -32,21 +32,21 @@
namespace phpseclib3\Crypt;
use phpseclib3\Crypt\Common\AsymmetricKey;
use phpseclib3\Crypt\EC\PrivateKey;
use phpseclib3\Crypt\EC\PublicKey;
use phpseclib3\Crypt\EC\Parameters;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\Curves\Curve25519;
use phpseclib3\Crypt\EC\Curves\Ed25519;
use phpseclib3\Crypt\EC\Curves\Ed448;
use phpseclib3\Crypt\EC\Formats\Keys\PKCS1;
use phpseclib3\File\ASN1\Maps\ECParameters;
use phpseclib3\File\ASN1;
use phpseclib3\Math\BigInteger;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\Crypt\EC\Parameters;
use phpseclib3\Crypt\EC\PrivateKey;
use phpseclib3\Crypt\EC\PublicKey;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\Exception\UnsupportedOperationException;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps\ECParameters;
use phpseclib3\Math\BigInteger;
/**
* Pure-PHP implementation of EC.

View File

@ -23,9 +23,8 @@
namespace phpseclib3\Crypt\EC\BaseCurves;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BinaryField;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\BinaryField;
use phpseclib3\Math\BinaryField\Integer as BinaryInteger;
/**

View File

@ -30,10 +30,8 @@
namespace phpseclib3\Crypt\EC\BaseCurves;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\PrimeField;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\PrimeField\Integer as PrimeInteger;
use phpseclib3\Math\PrimeField;
/**
* Curves over y^2 = x^3 + b

View File

@ -26,10 +26,9 @@
namespace phpseclib3\Crypt\EC\BaseCurves;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\PrimeField;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\EC\Curves\Curve25519;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\PrimeField;
use phpseclib3\Math\PrimeField\Integer as PrimeInteger;
/**

View File

@ -23,10 +23,10 @@
namespace phpseclib3\Crypt\EC\BaseCurves;
use phpseclib3\Math\Common\FiniteField\Integer;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\PrimeField;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\Common\FiniteField\Integer;
use phpseclib3\Math\PrimeField;
use phpseclib3\Math\PrimeField\Integer as PrimeInteger;
/**

View File

@ -28,8 +28,8 @@
namespace phpseclib3\Crypt\EC\BaseCurves;
use phpseclib3\Math\PrimeField;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\PrimeField;
use phpseclib3\Math\PrimeField\Integer as PrimeInteger;
/**

View File

@ -15,9 +15,9 @@
namespace phpseclib3\Crypt\EC\Curves;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\Hash;
use phpseclib3\Crypt\Random;
use phpseclib3\Math\BigInteger;
class Ed25519 extends TwistedEdwards
{

View File

@ -15,9 +15,9 @@
namespace phpseclib3\Crypt\EC\Curves;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\Hash;
use phpseclib3\Crypt\Random;
use phpseclib3\Math\BigInteger;
class Ed448 extends TwistedEdwards
{

View File

@ -16,16 +16,15 @@
namespace phpseclib3\Crypt\EC\Formats\Keys;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Crypt\EC\BaseCurves\Prime as PrimeCurve;
use phpseclib3\Crypt\EC\BaseCurves\Binary as BinaryCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\PrimeField;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Crypt\EC\BaseCurves\Binary as BinaryCurve;
use phpseclib3\Crypt\EC\BaseCurves\Prime as PrimeCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\Math\BigInteger;
/**
* Generic EC Key Parsing Helper functions

View File

@ -22,11 +22,11 @@
namespace phpseclib3\Crypt\EC\Formats\Keys;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Crypt\EC\Curves\Curve25519;
use phpseclib3\Crypt\EC\Curves\Curve448;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Math\BigInteger;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Math\BigInteger;
/**
* Montgomery Curve Private Key Handler

View File

@ -15,10 +15,9 @@
namespace phpseclib3\Crypt\EC\Formats\Keys;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Crypt\EC\Curves\Curve25519;
use phpseclib3\Crypt\EC\Curves\Curve448;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Math\Common\FiniteField\Integer;
use phpseclib3\Math\BigInteger;
/**

View File

@ -17,13 +17,12 @@
namespace phpseclib3\Crypt\EC\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\OpenSSH as Progenitor;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\Crypt\EC\Curves\Ed25519;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\Math\BigInteger;
/**
* OpenSSH Formatted EC Key Handler

View File

@ -27,16 +27,16 @@
namespace phpseclib3\Crypt\EC\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS1 as Progenitor;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Math\BigInteger;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\Common\Functions\Strings;
/**
* "PKCS1" (RFC5915) Formatted EC Key Handler

View File

@ -25,17 +25,17 @@
namespace phpseclib3\Crypt\EC\Formats\Keys;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS8 as Progenitor;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\Curves\Ed25519;
use phpseclib3\Crypt\EC\Curves\Ed448;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Math\BigInteger;
/**
* PKCS#8 Formatted EC Key Handler

View File

@ -16,11 +16,11 @@
namespace phpseclib3\Crypt\EC\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PuTTY as Progenitor;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Math\BigInteger;
/**
* PuTTY Formatted EC Key Handler

View File

@ -21,13 +21,13 @@
namespace phpseclib3\Crypt\EC\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Crypt\EC\BaseCurves\Prime as PrimeCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\Math\BigInteger;
/**
* XML Formatted EC Key Handler

View File

@ -20,8 +20,8 @@
namespace phpseclib3\Crypt\EC\Formats\Keys;
use phpseclib3\Crypt\EC\Curves\Ed25519;
use phpseclib3\Math\BigInteger;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Math\BigInteger;
/**
* libsodium Key Handler

View File

@ -18,9 +18,9 @@
namespace phpseclib3\Crypt\EC\Formats\Signature;
use phpseclib3\Math\BigInteger;
use phpseclib3\File\ASN1 as Encoder;
use phpseclib3\File\ASN1\Maps\EcdsaSigValue;
use phpseclib3\Math\BigInteger;
/**
* ASN1 Signature Handler

View File

@ -17,8 +17,8 @@
namespace phpseclib3\Crypt\EC\Formats\Signature;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
/**
* SSH2 Signature Handler

View File

@ -13,18 +13,18 @@
namespace phpseclib3\Crypt\EC;
use phpseclib3\Crypt\EC;
use phpseclib3\Crypt\EC\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Crypt\Hash;
use phpseclib3\Crypt\EC\Curves\Ed25519;
use phpseclib3\Crypt\EC\Curves\Curve25519;
use phpseclib3\Crypt\EC\Formats\Keys\PKCS1;
use phpseclib3\Crypt\Common;
use phpseclib3\Exception\UnsupportedOperationException;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common;
use phpseclib3\Crypt\EC;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\Curves\Curve25519;
use phpseclib3\Crypt\EC\Curves\Ed25519;
use phpseclib3\Crypt\EC\Formats\Keys\PKCS1;
use phpseclib3\Crypt\EC\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib3\Crypt\Hash;
use phpseclib3\Exception\UnsupportedOperationException;
use phpseclib3\Math\BigInteger;
/**
* EC Private Key

View File

@ -13,17 +13,17 @@
namespace phpseclib3\Crypt\EC;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common;
use phpseclib3\Crypt\EC;
use phpseclib3\Crypt\Hash;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\EC\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve;
use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib3\Crypt\EC\Curves\Ed25519;
use phpseclib3\Crypt\EC\Formats\Keys\PKCS1;
use phpseclib3\Crypt\Common;
use phpseclib3\Crypt\EC\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib3\Crypt\Hash;
use phpseclib3\Exception\UnsupportedOperationException;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
/**
* EC Public Key

View File

@ -33,11 +33,10 @@
namespace phpseclib3\Crypt;
use phpseclib3\Math\BigInteger;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\AES;
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\PrimeField;
/**

View File

@ -16,8 +16,8 @@
namespace phpseclib3\Crypt;
use phpseclib3\Crypt\Common\AsymmetricKey;
use phpseclib3\Crypt\Common\PublicKey;
use phpseclib3\Crypt\Common\PrivateKey;
use phpseclib3\Crypt\Common\PublicKey;
use phpseclib3\Exception\NoKeyLoadedException;
use phpseclib3\File\X509;

View File

@ -56,12 +56,12 @@
namespace phpseclib3\Crypt;
use phpseclib3\Crypt\Common\AsymmetricKey;
use phpseclib3\Crypt\RSA\Formats\Keys\PSS;
use phpseclib3\Crypt\RSA\PrivateKey;
use phpseclib3\Crypt\RSA\PublicKey;
use phpseclib3\Math\BigInteger;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\Exception\InconsistentSetupException;
use phpseclib3\Crypt\RSA\Formats\Keys\PSS;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\Math\BigInteger;
/**
* Pure-PHP PKCS#1 compliant implementation of RSA.

View File

@ -20,9 +20,9 @@
namespace phpseclib3\Crypt\RSA\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Math\BigInteger;
/**
* Microsoft BLOB Formatted RSA Key Handler

View File

@ -17,10 +17,9 @@
namespace phpseclib3\Crypt\RSA\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\OpenSSH as Progenitor;
use phpseclib3\Math\BigInteger;
/**
* OpenSSH Formatted RSA Key Handler

View File

@ -24,11 +24,11 @@
namespace phpseclib3\Crypt\RSA\Formats\Keys;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS1 as Progenitor;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
/**
* PKCS#1 Formatted RSA Key Handler

View File

@ -27,10 +27,10 @@
namespace phpseclib3\Crypt\RSA\Formats\Keys;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS8 as Progenitor;
use phpseclib3\File\ASN1;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
/**
* PKCS#8 Formatted RSA Key Handler

View File

@ -25,11 +25,11 @@
namespace phpseclib3\Crypt\RSA\Formats\Keys;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PKCS8 as Progenitor;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
/**
* PKCS#8 Formatted RSA-PSS Key Handler

View File

@ -15,9 +15,9 @@
namespace phpseclib3\Crypt\RSA\Formats\Keys;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\Formats\Keys\PuTTY as Progenitor;
use phpseclib3\Math\BigInteger;
/**
* PuTTY Formatted RSA Key Handler

View File

@ -23,9 +23,9 @@
namespace phpseclib3\Crypt\RSA\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Math\BigInteger;
/**
* XML Formatted RSA Key Handler

View File

@ -13,16 +13,12 @@
namespace phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\RSA;
use phpseclib3\Math\BigInteger;
use phpseclib3\File\ASN1;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Hash;
use phpseclib3\Exceptions\NoKeyLoadedException;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Crypt\Random;
use phpseclib3\Crypt\Common;
use phpseclib3\Crypt\Random;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\RSA\Formats\Keys\PSS;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Math\BigInteger;
/**
* Raw RSA Key Handler

View File

@ -13,18 +13,17 @@
namespace phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\RSA;
use phpseclib3\Math\BigInteger;
use phpseclib3\File\ASN1;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Hash;
use phpseclib3\Exception\NoKeyLoadedException;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\Crypt\Random;
use phpseclib3\Crypt\Common;
use phpseclib3\File\ASN1\Maps\DigestInfo;
use phpseclib3\Crypt\Hash;
use phpseclib3\Crypt\Random;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\RSA\Formats\Keys\PSS;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Maps\DigestInfo;
use phpseclib3\Math\BigInteger;
/**
* Raw RSA Key Handler

View File

@ -54,13 +54,13 @@
namespace phpseclib3\Crypt;
use phpseclib3\Crypt\Common\BlockCipher;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Exception\BadModeException;
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Exception\InconsistentSetupException;
use phpseclib3\Crypt\Common\BlockCipher;
use phpseclib3\Exception\BadDecryptionException;
use phpseclib3\Exception\BadModeException;
use phpseclib3\Exception\InconsistentSetupException;
use phpseclib3\Exception\InsufficientSetupException;
/**
* Pure-PHP implementation of Rijndael.

View File

@ -15,10 +15,10 @@
namespace phpseclib3\Crypt;
use phpseclib3\Crypt\Common\StreamCipher;
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Exception\BadDecryptionException;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\StreamCipher;
use phpseclib3\Exception\BadDecryptionException;
use phpseclib3\Exception\InsufficientSetupException;
/**
* Pure-PHP implementation of Salsa20.

View File

@ -23,12 +23,11 @@
namespace phpseclib3\File;
use DateTime;
use ParagonIE\ConstantTime\Base64;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\File\ASN1\Element;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use DateTime;
use DateTimeZone;
/**
* Pure-PHP ASN.1 Parser
@ -1030,9 +1029,9 @@ abstract class ASN1
$format = $mapping['type'] == self::TYPE_UTC_TIME ? 'y' : 'Y';
$format.= 'mdHis';
// if $source does _not_ include timezone information within it then assume that the timezone is GMT
$date = new DateTime($source, new DateTimeZone('GMT'));
$date = new \DateTime($source, new \DateTimeZone('GMT'));
// if $source _does_ include timezone information within it then convert the time to GMT
$date->setTimezone(new DateTimeZone('GMT'));
$date->setTimezone(new \DateTimeZone('GMT'));
$value = $date->format($format) . 'Z';
break;
case self::TYPE_BIT_STRING:
@ -1308,7 +1307,7 @@ abstract class ASN1
// error supression isn't necessary as of PHP 7.0:
// http://php.net/manual/en/migration70.other-changes.php
return @DateTime::createFromFormat($format, $content);
return @\DateTime::createFromFormat($format, $content);
}
/**

View File

@ -26,9 +26,6 @@
namespace phpseclib3\File;
use DateTimeImmutable;
use DateTimeInterface;
use DateTimeZone;
use ParagonIE\ConstantTime\Base64;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Crypt\Common\PrivateKey;
@ -36,6 +33,7 @@ use phpseclib3\Crypt\Common\PublicKey;
use phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\EC;
use phpseclib3\Crypt\Hash;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\Random;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\RSA\Formats\Keys\PSS;
@ -43,7 +41,6 @@ use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\File\ASN1\Element;
use phpseclib3\File\ASN1\Maps;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\PublicKeyLoader;
/**
* Pure-PHP X.509 Parser
@ -1124,7 +1121,7 @@ class X509
*
* If $date isn't defined it is assumed to be the current date.
*
* @param DateTimeInterface|string $date optional
* @param \DateTimeInterface|string $date optional
* @access public
* @return boolean
*/
@ -1135,7 +1132,7 @@ class X509
}
if (!isset($date)) {
$date = new DateTimeImmutable(null, new DateTimeZone(@date_default_timezone_get()));
$date = new \DateTimeImmutable(null, new \DateTimeZone(@date_default_timezone_get()));
}
$notBefore = $this->currentCert['tbsCertificate']['validity']['notBefore'];
@ -1145,11 +1142,11 @@ class X509
$notAfter = isset($notAfter['generalTime']) ? $notAfter['generalTime'] : $notAfter['utcTime'];
if (is_string($date)) {
$date = new DateTimeImmutable($date, new DateTimeZone(@date_default_timezone_get()));
$date = new \DateTimeImmutable($date, new \DateTimeZone(@date_default_timezone_get()));
}
$notBefore = new DateTimeImmutable($notBefore, new DateTimeZone(@date_default_timezone_get()));
$notAfter = new DateTimeImmutable($notAfter, new DateTimeZone(@date_default_timezone_get()));
$notBefore = new \DateTimeImmutable($notBefore, new \DateTimeZone(@date_default_timezone_get()));
$notAfter = new \DateTimeImmutable($notAfter, new \DateTimeZone(@date_default_timezone_get()));
return $date >= $notBefore && $date<= $notAfter;
}
@ -2580,7 +2577,7 @@ class X509
if ($date instanceof Element) {
return $date;
}
$dateObj = new DateTimeImmutable($date, new DateTimeZone('GMT'));
$dateObj = new \DateTimeImmutable($date, new \DateTimeZone('GMT'));
$year = $dateObj->format('Y'); // the same way ASN1.php parses this
if ($year < 2050) {
return ['utcTime' => $date];
@ -2656,10 +2653,10 @@ class X509
return false;
}
$startDate = new DateTimeImmutable('now', new DateTimeZone(@date_default_timezone_get()));
$startDate = new \DateTimeImmutable('now', new \DateTimeZone(@date_default_timezone_get()));
$startDate = !empty($this->startDate) ? $this->startDate : $startDate->format('D, d M Y H:i:s O');
$endDate = new DateTimeImmutable('+1 year', new DateTimeZone(@date_default_timezone_get()));
$endDate = new \DateTimeImmutable('+1 year', new \DateTimeZone(@date_default_timezone_get()));
$endDate = !empty($this->endDate) ? $this->endDate : $endDate->format('D, d M Y H:i:s O');
/* "The serial number MUST be a positive integer"
@ -2924,7 +2921,7 @@ class X509
$signatureSubject = isset($this->signatureSubject) ? $this->signatureSubject : null;
$signatureAlgorithm = self::identifySignatureAlgorithm($issuer->privateKey);
$thisUpdate = new DateTimeImmutable('now', new DateTimeZone(@date_default_timezone_get()));
$thisUpdate = new \DateTimeImmutable('now', new \DateTimeZone(@date_default_timezone_get()));
$thisUpdate = !empty($this->startDate) ? $this->startDate : $thisUpdate->format('D, d M Y H:i:s O');
if (isset($crl->currentCert) && is_array($crl->currentCert) && isset($crl->currentCert['tbsCertList'])) {
@ -3098,13 +3095,13 @@ class X509
/**
* Set certificate start date
*
* @param DateTimeInterface|string $date
* @param \DateTimeInterface|string $date
* @access public
*/
public function setStartDate($date)
{
if (!is_object($date) || !($date instanceof DateTimeInterface)) {
$date = new DateTimeImmutable($date, new DateTimeZone(@date_default_timezone_get()));
if (!is_object($date) || !($date instanceof \DateTimeInterface)) {
$date = new \DateTimeImmutable($date, new \DateTimeZone(@date_default_timezone_get()));
}
$this->startDate = $date->format('D, d M Y H:i:s O');
@ -3113,7 +3110,7 @@ class X509
/**
* Set certificate end date
*
* @param DateTimeInterface|string $date
* @param \DateTimeInterface|string $date
* @access public
*/
public function setEndDate($date)
@ -3130,8 +3127,8 @@ class X509
$temp = chr(ASN1::TYPE_GENERALIZED_TIME) . ASN1::encodeLength(strlen($temp)) . $temp;
$this->endDate = new Element($temp);
} else {
if (!is_object($date) || !($date instanceof DateTimeInterface)) {
$date = new DateTimeImmutable($date, new DateTimeZone(@date_default_timezone_get()));
if (!is_object($date) || !($date instanceof \DateTimeInterface)) {
$date = new \DateTimeImmutable($date, new \DateTimeZone(@date_default_timezone_get()));
}
$this->endDate = $date->format('D, d M Y H:i:s O');
@ -3867,7 +3864,7 @@ class X509
}
$i = count($rclist);
$revocationDate = new DateTimeImmutable('now', new DateTimeZone(@date_default_timezone_get()));
$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'))];
return $i;

View File

@ -15,8 +15,8 @@
namespace phpseclib3\Math\BigInteger\Engines\BCMath\Reductions;
use phpseclib3\Math\BigInteger\Engines\BCMath\Base;
use phpseclib3\Math\BigInteger\Engines\BCMath;
use phpseclib3\Math\BigInteger\Engines\BCMath\Base;
/**
* PHP Barrett Modular Exponentiation Engine

View File

@ -16,10 +16,10 @@
namespace phpseclib3\Math\BigInteger\Engines;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Exception\BadConfigurationException;
use phpseclib3\Crypt\Random;
use phpseclib3\Math\BigInteger;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Random;
use phpseclib3\Exception\BadConfigurationException;
use phpseclib3\Math\BigInteger;
/**
* Base Engine.

View File

@ -15,7 +15,6 @@
namespace phpseclib3\Math\BigInteger\Engines;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Exception\BadConfigurationException;
/**

View File

@ -15,7 +15,6 @@
namespace phpseclib3\Math\BigInteger\Engines;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\RSA\Formats\Keys\PKCS8;
use phpseclib3\Math\BigInteger;

View File

@ -15,10 +15,9 @@
namespace phpseclib3\Math\BigInteger\Engines\PHP;
use phpseclib3\Math\BigInteger\Engines\PHP\Reductions\PowerOfTwo;
use phpseclib3\Math\BigInteger\Engines\PHP;
use phpseclib3\Math\BigInteger\Engines\PHP\Base;
use phpseclib3\Math\BigInteger\Engines\Engine;
use phpseclib3\Math\BigInteger\Engines\PHP;
use phpseclib3\Math\BigInteger\Engines\PHP\Reductions\PowerOfTwo;
/**
* PHP Montgomery Modular Exponentiation Engine

View File

@ -15,8 +15,8 @@
namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions;
use phpseclib3\Math\BigInteger\Engines\PHP\Base;
use phpseclib3\Math\BigInteger\Engines\PHP;
use phpseclib3\Math\BigInteger\Engines\PHP\Base;
/**
* PHP Dynamic Barrett Modular Exponentiation Engine

View File

@ -15,7 +15,6 @@
namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions;
use phpseclib3\Math\BigInteger\Engines\PHP\Base;
/**
* PHP Montgomery Modular Exponentiation Engine with interleaved multiplication

View File

@ -15,7 +15,6 @@
namespace phpseclib3\Math\BigInteger\Engines;
use ParagonIE\ConstantTime\Hex;
/**
* Pure-PHP 32-bit Engine.

View File

@ -15,7 +15,6 @@
namespace phpseclib3\Math\BigInteger\Engines;
use ParagonIE\ConstantTime\Hex;
/**
* Pure-PHP 64-bit Engine.

View File

@ -16,10 +16,9 @@
namespace phpseclib3\Math;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Math\Common\FiniteField;
use phpseclib3\Math\BinaryField\Integer;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BinaryField\Integer;
use phpseclib3\Math\Common\FiniteField;
/**
* Binary Finite Fields

View File

@ -22,10 +22,10 @@
namespace phpseclib3\Math\BinaryField;
use phpseclib3\Math\Common\FiniteField\Integer as Base;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\BinaryField;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Math\Common\FiniteField\Integer as Base;
/**
* Binary Finite Fields

View File

@ -14,9 +14,9 @@
namespace phpseclib3\Math\PrimeField;
use phpseclib3\Math\Common\FiniteField\Integer as Base;
use phpseclib3\Math\BigInteger;
use ParagonIE\ConstantTime\Hex;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\Common\FiniteField\Integer as Base;
/**
* Prime Finite Fields

View File

@ -35,10 +35,8 @@
namespace phpseclib3\Net;
use phpseclib3\Exception\FileNotFoundException;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\AsymmetricKey;
use phpseclib3\System\SSH\Agent;
use phpseclib3\Exception\FileNotFoundException;
/**
* Pure-PHP implementations of SFTP.

View File

@ -47,32 +47,31 @@
namespace phpseclib3\Net;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Blowfish;
use phpseclib3\Crypt\ChaCha20;
use phpseclib3\Crypt\Common\AsymmetricKey;
use phpseclib3\Crypt\Common\PrivateKey;
use phpseclib3\Crypt\Common\PublicKey;
use phpseclib3\Crypt\Common\SymmetricKey;
use phpseclib3\Crypt\DH;
use phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\EC;
use phpseclib3\Crypt\Hash;
use phpseclib3\Crypt\Random;
use phpseclib3\Crypt\RC4;
use phpseclib3\Crypt\Rijndael;
use phpseclib3\Crypt\Common\PublicKey;
use phpseclib3\Crypt\Common\PrivateKey;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\EC;
use phpseclib3\Crypt\DH;
use phpseclib3\Crypt\TripleDES;
use phpseclib3\Crypt\TripleDES; // Used to do Diffie-Hellman key exchange and DSA/RSA signature verification.
use phpseclib3\Crypt\Twofish;
use phpseclib3\Crypt\ChaCha20;
use phpseclib3\Math\BigInteger; // Used to do Diffie-Hellman key exchange and DSA/RSA signature verification.
use phpseclib3\System\SSH\Agent;
use phpseclib3\System\SSH\Agent\Identity as AgentIdentity;
use phpseclib3\Exception\ConnectionClosedException;
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Exception\NoSupportedAlgorithmsException;
use phpseclib3\Exception\UnableToConnectException;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\Exception\UnsupportedCurveException;
use phpseclib3\Exception\ConnectionClosedException;
use phpseclib3\Exception\UnableToConnectException;
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\AsymmetricKey;
use phpseclib3\Math\BigInteger;
use phpseclib3\System\SSH\Agent;
/**
* Pure-PHP implementation of SSHv2.

View File

@ -34,11 +34,11 @@
namespace phpseclib3\System\SSH;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\RSA;
use phpseclib3\Exception\BadConfigurationException;
use phpseclib3\System\SSH\Agent\Identity;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\PublicKeyLoader;
/**
* Pure-PHP ssh-agent client identity factory

View File

@ -17,13 +17,13 @@
namespace phpseclib3\System\SSH\Agent;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\EC;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\System\SSH\Agent;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\Common\PrivateKey;
use phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\EC;
use phpseclib3\Crypt\RSA;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\System\SSH\Agent;
/**
* Pure-PHP ssh-agent client identity object

View File

@ -6,7 +6,6 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\Base;
use phpseclib3\Net\SFTP;
class Functional_Net_SFTPLargeFileTest extends Functional_Net_SFTPTestCase

View File

@ -1,7 +1,7 @@
<?php
use phpseclib3\Net\SFTP;
use phpseclib3\Exception\UnableToConnectException;
use phpseclib3\Net\SFTP;
use PHPUnit\Framework\TestCase;
class SFTPWrongServerTest extends TestCase

View File

@ -109,7 +109,7 @@ class Functional_Net_SSH2Test extends PhpseclibFunctionalTestCase
public function testExecWithMethodCallback($ssh)
{
$callbackObject = $this->getMockBuilder('stdClass')
->setMethods(array('callbackMethod'))
->setMethods(['callbackMethod'])
->getMock();
$callbackObject
->expects($this->atLeastOnce())

View File

@ -5,8 +5,6 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\Hash;
use phpseclib3\Math\BigInteger;
abstract class PhpseclibFunctionalTestCase extends PhpseclibTestCase
{

View File

@ -5,7 +5,6 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\Common\BlockCipher;
class Unit_Crypt_AES_EvalTest extends Unit_Crypt_AES_TestCase
{

View File

@ -5,7 +5,6 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\Common\BlockCipher;
class Unit_Crypt_AES_McryptTest extends Unit_Crypt_AES_TestCase
{

View File

@ -5,7 +5,6 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\Common\BlockCipher;
class Unit_Crypt_AES_OpenSSLTest extends Unit_Crypt_AES_TestCase
{

View File

@ -5,7 +5,6 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\Common\BlockCipher;
class Unit_Crypt_AES_PurePHPTest extends Unit_Crypt_AES_TestCase
{

View File

@ -6,7 +6,6 @@
*/
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\Common\BlockCipher;
use phpseclib3\Crypt\Rijndael;
use phpseclib3\Exception\InconsistentSetupException;
use phpseclib3\Exception\InsufficientSetupException;

View File

@ -5,13 +5,13 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\DH;
use phpseclib3\Crypt\DH\PublicKey;
use phpseclib3\Crypt\DH\PrivateKey;
use phpseclib3\Crypt\DH\Parameters;
use phpseclib3\Crypt\DH\PrivateKey;
use phpseclib3\Crypt\DH\PublicKey;
use phpseclib3\Crypt\EC;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\AES;
class Unit_Crypt_DHTest extends PhpseclibTestCase
{

View File

@ -8,8 +8,8 @@
use phpseclib3\Crypt\DSA;
use phpseclib3\Crypt\DSA\Parameters;
use phpseclib3\Crypt\DSA\PublicKey;
use phpseclib3\Crypt\DSA\PrivateKey;
use phpseclib3\Crypt\DSA\PublicKey;
/**
* @requires PHP 7.0

View File

@ -5,14 +5,10 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\DSA\Parameters;
use phpseclib3\Crypt\DSA\PrivateKey;
use phpseclib3\Crypt\DSA\PublicKey;
use phpseclib3\Crypt\DSA\Parameters;
use phpseclib3\Crypt\DSA\Formats\Keys\PKCS1;
use phpseclib3\Crypt\DSA\Formats\Keys\PKCS8;
use phpseclib3\Crypt\DSA\Formats\Keys\PuTTY;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Exception\NoKeyLoadedException;
class Unit_Crypt_DSA_LoadDSAKeyTest extends PhpseclibTestCase

View File

@ -6,12 +6,11 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\EC;
use phpseclib3\File\ASN1;
use phpseclib3\Crypt\EC\Curves\Ed448;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\EC;
use phpseclib3\Crypt\EC\Curves\Ed448;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\File\ASN1;
class Ed448PublicKey
{

View File

@ -6,13 +6,13 @@
*/
use phpseclib3\Crypt\EC;
use phpseclib3\Crypt\EC\Formats\Keys\OpenSSH;
use phpseclib3\Crypt\EC\Formats\Keys\PKCS1;
use phpseclib3\Crypt\EC\Formats\Keys\PKCS8;
use phpseclib3\Crypt\EC\Formats\Keys\PuTTY;
use phpseclib3\Crypt\EC\Formats\Keys\OpenSSH;
use phpseclib3\Crypt\EC\Formats\Keys\XML;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\EC\PrivateKey;
use phpseclib3\Crypt\PublicKeyLoader;
class Unit_Crypt_EC_KeyTest extends PhpseclibTestCase
{

View File

@ -5,8 +5,8 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\RC4;
use phpseclib3\Crypt\Random;
use phpseclib3\Crypt\RC4;
class Unit_Crypt_RC4Test extends PhpseclibTestCase
{

View File

@ -5,18 +5,18 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\RSA\PrivateKey;
use phpseclib3\Crypt\RSA\PublicKey;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\RSA\Formats\Keys\OpenSSH;
use phpseclib3\Crypt\RSA\Formats\Keys\PKCS1;
use phpseclib3\Crypt\RSA\Formats\Keys\PKCS8;
use phpseclib3\Crypt\RSA\Formats\Keys\PuTTY;
use phpseclib3\Crypt\RSA\Formats\Keys\OpenSSH;
use phpseclib3\Crypt\RSA\Formats\Keys\PSS;
use phpseclib3\Math\BigInteger;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Crypt\RSA\Formats\Keys\PuTTY;
use phpseclib3\Crypt\RSA\PrivateKey;
use phpseclib3\Crypt\RSA\PublicKey;
use phpseclib3\Exception\NoKeyLoadedException;
use phpseclib3\Exception\UnsupportedFormatException;
use phpseclib3\Math\BigInteger;
class Unit_Crypt_RSA_LoadKeyTest extends PhpseclibTestCase
{

View File

@ -5,10 +5,10 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\RSA;
use phpseclib3\Math\BigInteger;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\RSA\Formats\Keys\PKCS8;
use phpseclib3\Math\BigInteger;
class Unit_Crypt_RSA_ModeTest extends PhpseclibTestCase
{

View File

@ -310,12 +310,12 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
public function testApplicationTag()
{
$map = array(
$map = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => array(
'children' => [
// technically, default implies optional, but we'll define it as being optional, none-the-less, just to
// reenforce that fact
'version' => array(
'version' => [
// if class isn't present it's assumed to be ASN1::CLASS_UNIVERSAL or
// (if constant is present) ASN1::CLASS_CONTEXT_SPECIFIC
'class' => ASN1::CLASS_APPLICATION,
@ -324,12 +324,12 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
'explicit' => true,
'default' => 'v1',
'type' => ASN1::TYPE_INTEGER,
'mapping' => array('v1', 'v2', 'v3')
)
)
);
'mapping' => ['v1', 'v2', 'v3']
]
]
];
$data = array('version' => 'v3');
$data = ['version' => 'v3'];
$str = ASN1::encodeDER($data, $map);
@ -376,21 +376,21 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
*/
public function testExplicitImplicitDate()
{
$map = array(
$map = [
'type' => ASN1::TYPE_SEQUENCE,
'children' => array(
'notBefore' => array(
'children' => [
'notBefore' => [
'constant' => 0,
'optional' => true,
'implicit' => true,
'type' => ASN1::TYPE_GENERALIZED_TIME),
'notAfter' => array(
'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');
$a = ASN1::decodeBER($a);

View File

@ -5,9 +5,9 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\File\X509;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\RSA;
use phpseclib3\File\X509;
class Unit_File_X509_CSRTest extends PhpseclibTestCase
{

View File

@ -5,8 +5,8 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\File\X509;
use phpseclib3\Crypt\RSA;
use phpseclib3\File\X509;
class Unit_File_X509_SPKACTest extends PhpseclibTestCase
{

View File

@ -5,11 +5,11 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\RSA;
use phpseclib3\File\ASN1;
use phpseclib3\File\ASN1\Element;
use phpseclib3\File\X509;
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\PublicKeyLoader;
class Unit_File_X509_X509Test extends PhpseclibTestCase
{
@ -1046,7 +1046,7 @@ ut3+b2Xvzq8yzmHMFtLIJ6Afu1jJpqD82BUAFcvi5vhnP8M7b974R18WCOpgNQvXDI+2/8ZINeU=
-----END CERTIFICATE-----');
$r = $x509->saveX509($r);
$r = $x509->loadX509($r);
$this->assertSame($r['tbsCertificate']['extensions'][5]['extnValue']['excludedSubtrees'][1]['base']['iPAddress'], array('0.0.0.0', '0.0.0.0'));
$this->assertSame($r['tbsCertificate']['extensions'][5]['extnValue']['excludedSubtrees'][1]['base']['iPAddress'], ['0.0.0.0', '0.0.0.0']);
}
/**

View File

@ -5,7 +5,7 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use \phpseclib3\Math\BigInteger\Engines\BCMath;
use phpseclib3\Math\BigInteger\Engines\BCMath;
class Unit_Math_BigInteger_BCMathTest extends Unit_Math_BigInteger_TestCase
{

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