diff --git a/composer.json b/composer.json index 6a1cf57e4..bb7adcc41 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,6 @@ "ext-iconv": "*", "ext-mbstring": "*", "ext-phar": "*", - "ext-sodium": "*", "composer-plugin-api": "^2.2", "amphp/parallel-functions": "^1.1", "composer/semver": "^3.3.2", @@ -33,7 +32,6 @@ "laravel/serializable-closure": "^1.2.2", "nikic/iter": "^2.2", "nikic/php-parser": "^4.15.2", - "paragonie/constant_time_encoding": "^2.6", "phpdocumentor/reflection-docblock": "^5.3", "phpdocumentor/type-resolver": "^1.7", "psr/log": "^3.0", @@ -61,7 +59,6 @@ "webmozarts/strict-phpunit": "^7.6" }, "replace": { - "paragonie/sodium_compat": "*", "symfony/polyfill-php80": "*", "symfony/polyfill-php81": "*" }, diff --git a/composer.lock b/composer.lock index 3481c4ecd..51444e388 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e176960d081e81e8d9426176dfe8ce49", + "content-hash": "50f25cdeee25a0f13d7e0d131c673111", "packages": [ { "name": "amphp/amp", @@ -977,16 +977,16 @@ }, { "name": "humbug/php-scoper", - "version": "0.18.6", + "version": "0.18.7", "source": { "type": "git", "url": "https://github.com/humbug/php-scoper.git", - "reference": "e5a152c0f40c6cf7994fb27f14e50e47d7c4c4ff" + "reference": "9386a0af946f175d7a1ebfb68851bc2bb8ad7858" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/humbug/php-scoper/zipball/e5a152c0f40c6cf7994fb27f14e50e47d7c4c4ff", - "reference": "e5a152c0f40c6cf7994fb27f14e50e47d7c4c4ff", + "url": "https://api.github.com/repos/humbug/php-scoper/zipball/9386a0af946f175d7a1ebfb68851bc2bb8ad7858", + "reference": "9386a0af946f175d7a1ebfb68851bc2bb8ad7858", "shasum": "" }, "require": { @@ -1004,7 +1004,7 @@ "bamarni/composer-bin-plugin": "^1.1", "ergebnis/composer-normalize": "^2.28", "fidry/makefile": "^1.0", - "humbug/box": "^4.0", + "humbug/box": "^4.5.1", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.0", "symfony/yaml": "^6.1" @@ -1054,9 +1054,9 @@ "description": "Prefixes all PHP namespaces in a file or directory.", "support": { "issues": "https://github.com/humbug/php-scoper/issues", - "source": "https://github.com/humbug/php-scoper/tree/0.18.6" + "source": "https://github.com/humbug/php-scoper/tree/0.18.7" }, - "time": "2023-11-04T16:43:20+00:00" + "time": "2023-11-04T18:01:12+00:00" }, { "name": "jetbrains/phpstorm-stubs", @@ -1344,73 +1344,6 @@ }, "time": "2023-08-13T19:53:39+00:00" }, - { - "name": "paragonie/constant_time_encoding", - "version": "v2.6.3", - "source": { - "type": "git", - "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "58c3f47f650c94ec05a151692652a868995d2938" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938", - "reference": "58c3f47f650c94ec05a151692652a868995d2938", - "shasum": "" - }, - "require": { - "php": "^7|^8" - }, - "require-dev": { - "phpunit/phpunit": "^6|^7|^8|^9", - "vimeo/psalm": "^1|^2|^3|^4" - }, - "type": "library", - "autoload": { - "psr-4": { - "ParagonIE\\ConstantTime\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com", - "role": "Maintainer" - }, - { - "name": "Steve 'Sc00bz' Thomas", - "email": "steve@tobtu.com", - "homepage": "https://www.tobtu.com", - "role": "Original Developer" - } - ], - "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", - "keywords": [ - "base16", - "base32", - "base32_decode", - "base32_encode", - "base64", - "base64_decode", - "base64_encode", - "bin2hex", - "encoding", - "hex", - "hex2bin", - "rfc4648" - ], - "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/constant_time_encoding/issues", - "source": "https://github.com/paragonie/constant_time_encoding" - }, - "time": "2022-06-14T06:56:20+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -5778,7 +5711,6 @@ "ext-iconv": "*", "ext-mbstring": "*", "ext-phar": "*", - "ext-sodium": "*", "composer-plugin-api": "^2.2" }, "platform-dev": [], diff --git a/src/Console/Command/Extract.php b/src/Console/Command/Extract.php index bf37e1f6d..bae280a42 100644 --- a/src/Console/Command/Extract.php +++ b/src/Console/Command/Extract.php @@ -22,11 +22,11 @@ use KevinGH\Box\Phar\InvalidPhar; use KevinGH\Box\Phar\PharFactory; use KevinGH\Box\Phar\PharMeta; -use ParagonIE\ConstantTime\Hex; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Question\ConfirmationQuestion; use Throwable; +use function bin2hex; use function file_exists; use function KevinGH\Box\check_php_settings; use function realpath; @@ -188,7 +188,7 @@ private static function generateAlias(string $file): string { $extension = self::getExtension($file); - return Hex::encode(random_bytes(16)).$extension; + return bin2hex(random_bytes(16)).$extension; } private static function getExtension(string $file): string diff --git a/src/Phar/PharInfo.php b/src/Phar/PharInfo.php index b0d5baa2e..ed10a7e0a 100644 --- a/src/Phar/PharInfo.php +++ b/src/Phar/PharInfo.php @@ -46,7 +46,6 @@ use Fidry\FileSystem\FS; use KevinGH\Box\Console\Command\Extract; use OutOfBoundsException; -use ParagonIE\ConstantTime\Hex; use Phar; use RuntimeException; use Symfony\Component\Filesystem\Path; @@ -55,6 +54,7 @@ use Symfony\Component\Process\Exception\ProcessFailedException; use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; +use function bin2hex; use function file_exists; use function getenv; use function is_readable; @@ -280,7 +280,7 @@ private static function initAlgorithms(): void private static function initStubFileName(): void { if (!isset(self::$stubfile)) { - self::$stubfile = Hex::encode(random_bytes(12)).'.pharstub'; + self::$stubfile = bin2hex(random_bytes(12)).'.pharstub'; } }