From 05cdd09f52d8f1e3d095221e4afdaa38b3cab2bc Mon Sep 17 00:00:00 2001 From: Jonny Fonsato Date: Tue, 2 Aug 2022 11:06:37 +0200 Subject: [PATCH] add --ignore-platform-req=php for fix test error --- .github/workflows/ci.yml | 4 +- phpseclib/Crypt/Common/SymmetricKey.php | 79 ------------------- phpseclib/Crypt/DH.php | 5 ++ phpseclib/Crypt/DH/PublicKey.php | 7 -- .../Crypt/EC/BaseCurves/KoblitzPrime.php | 2 +- 5 files changed, 8 insertions(+), 89 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19dd4559..03683f97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: with: php-version: ${{ matrix.php-version }} - name: Composer Install - run: composer install --classmap-authoritative --no-interaction --no-cache + run: composer install --classmap-authoritative --no-interaction --no-cache --ignore-platform-req=php - name: Setup Secure Shell Functional Tests if: matrix.os == 'ubuntu-latest' run: | @@ -80,4 +80,4 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - php-version: ['8.2'] + php-version: ['8.1', '8.2'] diff --git a/phpseclib/Crypt/Common/SymmetricKey.php b/phpseclib/Crypt/Common/SymmetricKey.php index a7724762..cae9e15d 100644 --- a/phpseclib/Crypt/Common/SymmetricKey.php +++ b/phpseclib/Crypt/Common/SymmetricKey.php @@ -268,85 +268,6 @@ abstract class SymmetricKey */ protected $debuffer; - /** - * mcrypt resource for encryption - * - * The mcrypt resource can be recreated every time something needs to be created or it can be created just once. - * Since mcrypt operates in continuous mode, by default, it'll need to be recreated when in non-continuous mode. - * - * @see self::encrypt() - * @var resource - */ - private $enmcrypt; - - /** - * mcrypt resource for decryption - * - * The mcrypt resource can be recreated every time something needs to be created or it can be created just once. - * Since mcrypt operates in continuous mode, by default, it'll need to be recreated when in non-continuous mode. - * - * @see self::decrypt() - * @var resource - */ - private $demcrypt; - - /** - * Does the enmcrypt resource need to be (re)initialized? - * - * @see \phpseclib3\Crypt\Twofish::setKey() - * @see \phpseclib3\Crypt\Twofish::setIV() - * @var bool - */ - private $enchanged = true; - - /** - * Does the demcrypt resource need to be (re)initialized? - * - * @see \phpseclib3\Crypt\Twofish::setKey() - * @see \phpseclib3\Crypt\Twofish::setIV() - * @var bool - */ - private $dechanged = true; - - /** - * mcrypt resource for CFB mode - * - * mcrypt's CFB mode, in (and only in) buffered context, - * is broken, so phpseclib implements the CFB mode by it self, - * even when the mcrypt php extension is available. - * - * In order to do the CFB-mode work (fast) phpseclib - * use a separate ECB-mode mcrypt resource. - * - * @link http://phpseclib.sourceforge.net/cfb-demo.phps - * @see self::encrypt() - * @see self::decrypt() - * @see self::setupMcrypt() - * @var resource - */ - private $ecb; - - /** - * Optimizing value while CFB-encrypting - * - * Only relevant if $continuousBuffer enabled - * and $engine == self::ENGINE_MCRYPT - * - * It's faster to re-init $enmcrypt if - * $buffer bytes > $cfb_init_len than - * using the $ecb resource furthermore. - * - * This value depends of the chosen cipher - * and the time it would be needed for it's - * initialization [by mcrypt_generic_init()] - * which, typically, depends on the complexity - * on its internaly Key-expanding algorithm. - * - * @see self::encrypt() - * @var int - */ - protected $cfb_init_len = 600; - /** * Does internal cipher state need to be (re)initialized? * diff --git a/phpseclib/Crypt/DH.php b/phpseclib/Crypt/DH.php index 90897591..a7565ff5 100644 --- a/phpseclib/Crypt/DH.php +++ b/phpseclib/Crypt/DH.php @@ -64,6 +64,11 @@ abstract class DH extends AsymmetricKey */ protected $base; + /** + * @var BigInteger + */ + protected $publicKey; + /** * Create DH parameters * diff --git a/phpseclib/Crypt/DH/PublicKey.php b/phpseclib/Crypt/DH/PublicKey.php index 583b3b2e..7ffd6fab 100644 --- a/phpseclib/Crypt/DH/PublicKey.php +++ b/phpseclib/Crypt/DH/PublicKey.php @@ -26,13 +26,6 @@ class PublicKey extends DH { use Common\Traits\Fingerprint; - /** - * Public Key - * - * @var BigInteger - */ - protected $publicKey; - /** * Returns the public key * diff --git a/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php b/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php index 4454dcc6..b22ba469 100644 --- a/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php +++ b/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php @@ -41,7 +41,7 @@ use phpseclib3\Math\PrimeField; class KoblitzPrime extends Prime { /** - * @var array> + * @var list */ public $basis = [];