From 72f39e53c914a7a6744c929a3efa4c1027883a4a Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Tue, 2 Jul 2024 18:05:54 +0200 Subject: [PATCH 1/3] Add Base64UrlSafe utility and refactor code references This commit adds the utility `Base64UrlSafe` to provide methods for encoding and decoding in Base64UrlSafe format. Simultaneously, the commit also updates multiple files across the library to use this utility instead of the previously used `ParagonIE\ConstantTime\Base64UrlSafe`. This change will ensure consistent use of this utility throughout the project, promoting maintainability and ease of updating in the future, if required. --- src/Experimental/KeyEncryption/AESCTR.php | 2 +- .../KeyEncryption/Chacha20Poly1305.php | 2 +- src/Experimental/Signature/Blake2b.php | 2 +- src/Library/Console/GeneratorCommand.php | 2 +- src/Library/Core/JWK.php | 2 +- src/Library/Core/Util/Base64UrlSafe.php | 215 ++++++++++++++++++ src/Library/Core/Util/ECKey.php | 1 - src/Library/Core/Util/RSAKey.php | 1 - .../Algorithm/ContentEncryption/AESCBCHS.php | 2 +- .../Algorithm/ContentEncryption/AESGCM.php | 2 +- .../Algorithm/KeyEncryption/AESGCMKW.php | 2 +- .../Algorithm/KeyEncryption/AESKW.php | 2 +- .../Algorithm/KeyEncryption/AbstractECDH.php | 2 +- .../Algorithm/KeyEncryption/Dir.php | 2 +- .../Algorithm/KeyEncryption/PBES2AESKW.php | 2 +- .../KeyEncryption/Util/ConcatKDF.php | 2 +- src/Library/Encryption/JWEBuilder.php | 2 +- .../Serializer/CompactSerializer.php | 2 +- .../Serializer/JSONFlattenedSerializer.php | 2 +- .../Serializer/JSONGeneralSerializer.php | 2 +- .../KeyManagement/Analyzer/ESKeyAnalyzer.php | 2 +- .../KeyManagement/Analyzer/HSKeyAnalyzer.php | 2 +- .../KeyManagement/Analyzer/OctAnalyzer.php | 2 +- .../KeyManagement/Analyzer/RsaAnalyzer.php | 2 +- .../Analyzer/ZxcvbnKeyAnalyzer.php | 2 +- src/Library/KeyManagement/JWKFactory.php | 2 +- .../KeyManagement/KeyConverter/ECKey.php | 2 +- .../KeyConverter/KeyConverter.php | 2 +- .../KeyManagement/KeyConverter/RSAKey.php | 2 +- src/Library/Signature/Algorithm/EdDSA.php | 2 +- src/Library/Signature/Algorithm/HMAC.php | 2 +- src/Library/Signature/JWSBuilder.php | 2 +- src/Library/Signature/JWSVerifier.php | 2 +- .../Serializer/CompactSerializer.php | 2 +- .../Serializer/JSONFlattenedSerializer.php | 2 +- .../Serializer/JSONGeneralSerializer.php | 2 +- .../KeyManagement/JWKLoaderTest.php | 2 +- .../Console/KeyCreationCommandTest.php | 2 +- tests/Component/Encryption/EncrypterTest.php | 2 +- .../Component/Encryption/JWEFlattenedTest.php | 2 +- ...8GCMEncryptionProtectedContentOnlyTest.php | 2 +- .../A128KWAndA128GCMEncryptionTest.php | 2 +- ...ionWithAdditionalAuthenticatedDataTest.php | 2 +- ...ndA128GCMEncryptionWithCompressionTest.php | 2 +- ...nWithSpecificProtectedHeaderValuesTest.php | 2 +- ...256GCMKWAndA128CBC_HS256EncryptionTest.php | 2 +- .../RFC7520/DirAndA128GCMEncryptionTest.php | 2 +- ...ECDH_ES_A128KWAndA128GCMEncryptionTest.php | 2 +- ...ECDH_ES_AndA128CBC_HS256EncryptionTest.php | 2 +- .../MultipleRecipientEncryptionTest.php | 2 +- ...2_A256KWAndA128CBC_HS256EncryptionTest.php | 2 +- .../RSA1_5AndA128CBC_HS256EncryptionTest.php | 2 +- .../RSA_OAEPAndA256GCMEncryptionTest.php | 2 +- .../Encryption/RSAKeyEncryptionTest.php | 2 +- .../KeyManagement/JWKFactoryTest.php | 2 +- tests/Component/KeyManagement/JWKTest.php | 2 +- tests/Component/Signature/JWSTest.php | 2 +- tests/Component/Signature/SignerTest.php | 2 +- .../AESCBC/AESCBC_HSContentEncryptionTest.php | 2 +- .../AESGCM/AESGCMContentEncryptionTest.php | 2 +- .../AESGCMKW/AESGCMKWKeyEncryptionTest.php | 2 +- .../AESKW/AESKWKeyEncryptionTest.php | 2 +- .../KeyEncryption/Direct/DirAlgorithmTest.php | 2 +- .../ECDHES/ECDHESKeyAgreementTest.php | 2 +- .../PBES2/PBES2_HS_AESKWKeyEncryptionTest.php | 2 +- .../ECDSA/ECDSAFromRFC6979Test.php | 2 +- .../ECDSA/ECDSASignatureTest.php | 2 +- .../EdDSA/EdDSASignatureTest.php | 2 +- .../Experimental/Blake2bTest.php | 2 +- .../Experimental/P256KSignatureTest.php | 2 +- .../HMAC/HMACSignatureTest.php | 2 +- .../RSA/RSASignatureTest.php | 2 +- 72 files changed, 284 insertions(+), 71 deletions(-) create mode 100644 src/Library/Core/Util/Base64UrlSafe.php diff --git a/src/Experimental/KeyEncryption/AESCTR.php b/src/Experimental/KeyEncryption/AESCTR.php index 76fd00f0..50b3cde7 100644 --- a/src/Experimental/KeyEncryption/AESCTR.php +++ b/src/Experimental/KeyEncryption/AESCTR.php @@ -6,8 +6,8 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\KeyEncryption\KeyEncryption; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use function in_array; use function is_string; diff --git a/src/Experimental/KeyEncryption/Chacha20Poly1305.php b/src/Experimental/KeyEncryption/Chacha20Poly1305.php index 947a7c83..3dc61064 100644 --- a/src/Experimental/KeyEncryption/Chacha20Poly1305.php +++ b/src/Experimental/KeyEncryption/Chacha20Poly1305.php @@ -6,9 +6,9 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\KeyEncryption\KeyEncryption; use LogicException; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use function in_array; use function is_string; diff --git a/src/Experimental/Signature/Blake2b.php b/src/Experimental/Signature/Blake2b.php index 73cd7579..d268a02c 100644 --- a/src/Experimental/Signature/Blake2b.php +++ b/src/Experimental/Signature/Blake2b.php @@ -6,8 +6,8 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Signature\Algorithm\MacAlgorithm; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use function extension_loaded; use function in_array; diff --git a/src/Library/Console/GeneratorCommand.php b/src/Library/Console/GeneratorCommand.php index 8f4f58cb..daf7230b 100644 --- a/src/Library/Console/GeneratorCommand.php +++ b/src/Library/Console/GeneratorCommand.php @@ -5,8 +5,8 @@ namespace Jose\Component\Console; use InvalidArgumentException; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\KeyManagement\JWKFactory; -use ParagonIE\ConstantTime\Base64UrlSafe; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use function is_bool; diff --git a/src/Library/Core/JWK.php b/src/Library/Core/JWK.php index 9685becf..27b4bf30 100644 --- a/src/Library/Core/JWK.php +++ b/src/Library/Core/JWK.php @@ -5,8 +5,8 @@ namespace Jose\Component\Core; use InvalidArgumentException; +use Jose\Component\Core\Util\Base64UrlSafe; use JsonSerializable; -use ParagonIE\ConstantTime\Base64UrlSafe; use function array_key_exists; use function in_array; use function is_array; diff --git a/src/Library/Core/Util/Base64UrlSafe.php b/src/Library/Core/Util/Base64UrlSafe.php new file mode 100644 index 00000000..c3f44d65 --- /dev/null +++ b/src/Library/Core/Util/Base64UrlSafe.php @@ -0,0 +1,215 @@ + $chunk */ + $chunk = unpack('C*', self::safeSubstr($encodedString, $i, 4)); + $c0 = static::decode6Bits($chunk[1]); + $c1 = static::decode6Bits($chunk[2]); + $c2 = static::decode6Bits($chunk[3]); + $c3 = static::decode6Bits($chunk[4]); + + $dest .= pack( + 'CCC', + ((($c0 << 2) | ($c1 >> 4)) & 0xff), + ((($c1 << 4) | ($c2 >> 2)) & 0xff), + ((($c2 << 6) | $c3) & 0xff) + ); + $err |= ($c0 | $c1 | $c2 | $c3) >> 8; + } + + if ($i < $srcLen) { + /** @var array $chunk */ + $chunk = unpack('C*', self::safeSubstr($encodedString, $i, $srcLen - $i)); + $c0 = static::decode6Bits($chunk[1]); + + if ($i + 2 < $srcLen) { + $c1 = static::decode6Bits($chunk[2]); + $c2 = static::decode6Bits($chunk[3]); + $dest .= pack('CC', ((($c0 << 2) | ($c1 >> 4)) & 0xff), ((($c1 << 4) | ($c2 >> 2)) & 0xff)); + $err |= ($c0 | $c1 | $c2) >> 8; + if ($strictPadding) { + $err |= ($c2 << 6) & 0xff; + } + } elseif ($i + 1 < $srcLen) { + $c1 = static::decode6Bits($chunk[2]); + $dest .= pack('C', ((($c0 << 2) | ($c1 >> 4)) & 0xff)); + $err |= ($c0 | $c1) >> 8; + if ($strictPadding) { + $err |= ($c1 << 4) & 0xff; + } + } elseif ($strictPadding) { + $err |= 1; + } + } + $check = ($err === 0); + if (! $check) { + throw new RangeException('Base64::decode() only expects characters in the correct base64 alphabet'); + } + return $dest; + } + + public static function decodeNoPadding(string $encodedString): string + { + $srcLen = self::safeStrlen($encodedString); + if ($srcLen === 0) { + return ''; + } + if (($srcLen & 3) === 0) { + if ($encodedString[$srcLen - 1] === '=') { + throw new InvalidArgumentException("decodeNoPadding() doesn't tolerate padding"); + } + if (($srcLen & 3) > 1) { + if ($encodedString[$srcLen - 2] === '=') { + throw new InvalidArgumentException("decodeNoPadding() doesn't tolerate padding"); + } + } + } + return static::decode($encodedString, true); + } + + private static function doEncode(string $src, bool $pad = true): string + { + $dest = ''; + $srcLen = self::safeStrlen($src); + for ($i = 0; $i + 3 <= $srcLen; $i += 3) { + /** @var array $chunk */ + $chunk = unpack('C*', self::safeSubstr($src, $i, 3)); + $b0 = $chunk[1]; + $b1 = $chunk[2]; + $b2 = $chunk[3]; + + $dest .= + static::encode6Bits($b0 >> 2) . + static::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . + static::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) . + static::encode6Bits($b2 & 63); + } + + if ($i < $srcLen) { + /** @var array $chunk */ + $chunk = unpack('C*', self::safeSubstr($src, $i, $srcLen - $i)); + $b0 = $chunk[1]; + if ($i + 1 < $srcLen) { + $b1 = $chunk[2]; + $dest .= + static::encode6Bits($b0 >> 2) . + static::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . + static::encode6Bits(($b1 << 2) & 63); + if ($pad) { + $dest .= '='; + } + } else { + $dest .= + static::encode6Bits($b0 >> 2) . + static::encode6Bits(($b0 << 4) & 63); + if ($pad) { + $dest .= '=='; + } + } + } + return $dest; + } + + private static function decode6Bits(int $src): int + { + $ret = -1; + $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64); + $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70); + $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5); + $ret += (((0x2c - $src) & ($src - 0x2e)) >> 8) & 63; + + return $ret + ((((0x5e - $src) & ($src - 0x60)) >> 8) & 64); + } + + private static function encode6Bits(int $src): string + { + $diff = 0x41; + $diff += ((25 - $src) >> 8) & 6; + $diff -= ((51 - $src) >> 8) & 75; + $diff -= ((61 - $src) >> 8) & 13; + $diff += ((62 - $src) >> 8) & 49; + + return pack('C', $src + $diff); + } + + private static function safeStrlen(string $str): int + { + return mb_strlen($str, '8bit'); + } + + private static function safeSubstr(string $str, int $start = 0, $length = null): string + { + if ($length === 0) { + return ''; + } + return mb_substr($str, $start, $length, '8bit'); + } +} diff --git a/src/Library/Core/Util/ECKey.php b/src/Library/Core/Util/ECKey.php index aa4aac88..f84123ac 100644 --- a/src/Library/Core/Util/ECKey.php +++ b/src/Library/Core/Util/ECKey.php @@ -6,7 +6,6 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use function extension_loaded; use function is_array; diff --git a/src/Library/Core/Util/RSAKey.php b/src/Library/Core/Util/RSAKey.php index 7b47d5cc..c28fe661 100644 --- a/src/Library/Core/Util/RSAKey.php +++ b/src/Library/Core/Util/RSAKey.php @@ -6,7 +6,6 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use SpomkyLabs\Pki\ASN1\Type\Constructed\Sequence; use SpomkyLabs\Pki\ASN1\Type\Primitive\BitString; diff --git a/src/Library/Encryption/Algorithm/ContentEncryption/AESCBCHS.php b/src/Library/Encryption/Algorithm/ContentEncryption/AESCBCHS.php index 8395db17..20395fa0 100644 --- a/src/Library/Encryption/Algorithm/ContentEncryption/AESCBCHS.php +++ b/src/Library/Encryption/Algorithm/ContentEncryption/AESCBCHS.php @@ -4,8 +4,8 @@ namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\ContentEncryptionAlgorithm; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use function extension_loaded; use const OPENSSL_RAW_DATA; diff --git a/src/Library/Encryption/Algorithm/ContentEncryption/AESGCM.php b/src/Library/Encryption/Algorithm/ContentEncryption/AESGCM.php index c939df46..0b1bf43f 100644 --- a/src/Library/Encryption/Algorithm/ContentEncryption/AESGCM.php +++ b/src/Library/Encryption/Algorithm/ContentEncryption/AESGCM.php @@ -4,8 +4,8 @@ namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\ContentEncryptionAlgorithm; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use function extension_loaded; use const OPENSSL_RAW_DATA; diff --git a/src/Library/Encryption/Algorithm/KeyEncryption/AESGCMKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/AESGCMKW.php index 82db172c..37c79d9f 100644 --- a/src/Library/Encryption/Algorithm/KeyEncryption/AESGCMKW.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/AESGCMKW.php @@ -7,7 +7,7 @@ use AESKW\Wrapper as WrapperInterface; use InvalidArgumentException; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use RuntimeException; use function extension_loaded; use function in_array; diff --git a/src/Library/Encryption/Algorithm/KeyEncryption/AESKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/AESKW.php index 909f2a1e..15c408ac 100644 --- a/src/Library/Encryption/Algorithm/KeyEncryption/AESKW.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/AESKW.php @@ -7,7 +7,7 @@ use AESKW\Wrapper as WrapperInterface; use InvalidArgumentException; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use RuntimeException; use function in_array; use function is_string; diff --git a/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php b/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php index 9027a8e7..1af2818f 100644 --- a/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php @@ -7,13 +7,13 @@ use Brick\Math\BigInteger; use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\Ecc\Curve; use Jose\Component\Core\Util\Ecc\EcDH; use Jose\Component\Core\Util\Ecc\NistCurve; use Jose\Component\Core\Util\Ecc\PrivateKey; use Jose\Component\Core\Util\ECKey; use Jose\Component\Encryption\Algorithm\KeyEncryption\Util\ConcatKDF; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use Throwable; use function array_key_exists; diff --git a/src/Library/Encryption/Algorithm/KeyEncryption/Dir.php b/src/Library/Encryption/Algorithm/KeyEncryption/Dir.php index d01ec492..b4e2211a 100644 --- a/src/Library/Encryption/Algorithm/KeyEncryption/Dir.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/Dir.php @@ -6,7 +6,7 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use function in_array; use function is_string; diff --git a/src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php index a8222fc6..a93f9ee9 100644 --- a/src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php @@ -10,7 +10,7 @@ use AESKW\Wrapper as WrapperInterface; use InvalidArgumentException; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use RuntimeException; use function in_array; use function is_int; diff --git a/src/Library/Encryption/Algorithm/KeyEncryption/Util/ConcatKDF.php b/src/Library/Encryption/Algorithm/KeyEncryption/Util/ConcatKDF.php index f753b6cc..96e98e10 100644 --- a/src/Library/Encryption/Algorithm/KeyEncryption/Util/ConcatKDF.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/Util/ConcatKDF.php @@ -5,7 +5,7 @@ namespace Jose\Component\Encryption\Algorithm\KeyEncryption\Util; use InvalidArgumentException; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use const STR_PAD_LEFT; /** diff --git a/src/Library/Encryption/JWEBuilder.php b/src/Library/Encryption/JWEBuilder.php index f4e18bbd..505ae667 100644 --- a/src/Library/Encryption/JWEBuilder.php +++ b/src/Library/Encryption/JWEBuilder.php @@ -7,6 +7,7 @@ use InvalidArgumentException; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Core\Util\KeyChecker; use Jose\Component\Encryption\Algorithm\ContentEncryptionAlgorithm; @@ -19,7 +20,6 @@ use Jose\Component\Encryption\Compression\CompressionMethod; use Jose\Component\Encryption\Compression\CompressionMethodManager; use LogicException; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use function array_key_exists; use function count; diff --git a/src/Library/Encryption/Serializer/CompactSerializer.php b/src/Library/Encryption/Serializer/CompactSerializer.php index ba015e8a..4c38ff39 100644 --- a/src/Library/Encryption/Serializer/CompactSerializer.php +++ b/src/Library/Encryption/Serializer/CompactSerializer.php @@ -5,11 +5,11 @@ namespace Jose\Component\Encryption\Serializer; use InvalidArgumentException; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Encryption\JWE; use Jose\Component\Encryption\Recipient; use LogicException; -use ParagonIE\ConstantTime\Base64UrlSafe; use Throwable; use function count; use function is_array; diff --git a/src/Library/Encryption/Serializer/JSONFlattenedSerializer.php b/src/Library/Encryption/Serializer/JSONFlattenedSerializer.php index 6ecf28e3..02ea352e 100644 --- a/src/Library/Encryption/Serializer/JSONFlattenedSerializer.php +++ b/src/Library/Encryption/Serializer/JSONFlattenedSerializer.php @@ -5,10 +5,10 @@ namespace Jose\Component\Encryption\Serializer; use InvalidArgumentException; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Encryption\JWE; use Jose\Component\Encryption\Recipient; -use ParagonIE\ConstantTime\Base64UrlSafe; use function array_key_exists; use function count; use function is_array; diff --git a/src/Library/Encryption/Serializer/JSONGeneralSerializer.php b/src/Library/Encryption/Serializer/JSONGeneralSerializer.php index 96f23dc0..15b963a3 100644 --- a/src/Library/Encryption/Serializer/JSONGeneralSerializer.php +++ b/src/Library/Encryption/Serializer/JSONGeneralSerializer.php @@ -5,11 +5,11 @@ namespace Jose\Component\Encryption\Serializer; use InvalidArgumentException; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Encryption\JWE; use Jose\Component\Encryption\Recipient; use LogicException; -use ParagonIE\ConstantTime\Base64UrlSafe; use function array_key_exists; use function count; use function is_array; diff --git a/src/Library/KeyManagement/Analyzer/ESKeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/ESKeyAnalyzer.php index 2c003861..081a6b29 100644 --- a/src/Library/KeyManagement/Analyzer/ESKeyAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/ESKeyAnalyzer.php @@ -6,8 +6,8 @@ use Brick\Math\BigInteger; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\Ecc\Curve; -use ParagonIE\ConstantTime\Base64UrlSafe; use function is_string; abstract class ESKeyAnalyzer implements KeyAnalyzer diff --git a/src/Library/KeyManagement/Analyzer/HSKeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/HSKeyAnalyzer.php index 0e283a5a..35b7157c 100644 --- a/src/Library/KeyManagement/Analyzer/HSKeyAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/HSKeyAnalyzer.php @@ -5,7 +5,7 @@ namespace Jose\Component\KeyManagement\Analyzer; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use function is_string; abstract class HSKeyAnalyzer implements KeyAnalyzer diff --git a/src/Library/KeyManagement/Analyzer/OctAnalyzer.php b/src/Library/KeyManagement/Analyzer/OctAnalyzer.php index 24051793..1d769106 100644 --- a/src/Library/KeyManagement/Analyzer/OctAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/OctAnalyzer.php @@ -5,7 +5,7 @@ namespace Jose\Component\KeyManagement\Analyzer; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use function is_string; final class OctAnalyzer implements KeyAnalyzer diff --git a/src/Library/KeyManagement/Analyzer/RsaAnalyzer.php b/src/Library/KeyManagement/Analyzer/RsaAnalyzer.php index 43f0b1f5..9a354c7e 100644 --- a/src/Library/KeyManagement/Analyzer/RsaAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/RsaAnalyzer.php @@ -6,7 +6,7 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use function is_array; use function is_string; diff --git a/src/Library/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php index 2f5ccb9a..43a75fa1 100644 --- a/src/Library/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php @@ -5,7 +5,7 @@ namespace Jose\Component\KeyManagement\Analyzer; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use Throwable; use ZxcvbnPhp\Zxcvbn; use function is_string; diff --git a/src/Library/KeyManagement/JWKFactory.php b/src/Library/KeyManagement/JWKFactory.php index bf42b027..1bf4ac45 100644 --- a/src/Library/KeyManagement/JWKFactory.php +++ b/src/Library/KeyManagement/JWKFactory.php @@ -7,11 +7,11 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\ECKey; use Jose\Component\KeyManagement\KeyConverter\KeyConverter; use Jose\Component\KeyManagement\KeyConverter\RSAKey; use OpenSSLCertificate; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use Throwable; use function array_key_exists; diff --git a/src/Library/KeyManagement/KeyConverter/ECKey.php b/src/Library/KeyManagement/KeyConverter/ECKey.php index 8ee1bfad..6c3f61a7 100644 --- a/src/Library/KeyManagement/KeyConverter/ECKey.php +++ b/src/Library/KeyManagement/KeyConverter/ECKey.php @@ -5,7 +5,7 @@ namespace Jose\Component\KeyManagement\KeyConverter; use InvalidArgumentException; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use SpomkyLabs\Pki\CryptoEncoding\PEM; use SpomkyLabs\Pki\CryptoTypes\Asymmetric\EC\ECPrivateKey; use SpomkyLabs\Pki\CryptoTypes\Asymmetric\EC\ECPublicKey; diff --git a/src/Library/KeyManagement/KeyConverter/KeyConverter.php b/src/Library/KeyManagement/KeyConverter/KeyConverter.php index 4c8d938b..f72c66b4 100644 --- a/src/Library/KeyManagement/KeyConverter/KeyConverter.php +++ b/src/Library/KeyManagement/KeyConverter/KeyConverter.php @@ -6,8 +6,8 @@ use Brick\Math\BigInteger; use InvalidArgumentException; +use Jose\Component\Core\Util\Base64UrlSafe; use OpenSSLCertificate; -use ParagonIE\ConstantTime\Base64UrlSafe; use ParagonIE\Sodium\Core\Ed25519; use RuntimeException; use SpomkyLabs\Pki\CryptoEncoding\PEM; diff --git a/src/Library/KeyManagement/KeyConverter/RSAKey.php b/src/Library/KeyManagement/KeyConverter/RSAKey.php index ff98ea37..fe48e87d 100644 --- a/src/Library/KeyManagement/KeyConverter/RSAKey.php +++ b/src/Library/KeyManagement/KeyConverter/RSAKey.php @@ -6,8 +6,8 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\BigInteger; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use function array_key_exists; use function extension_loaded; diff --git a/src/Library/Signature/Algorithm/EdDSA.php b/src/Library/Signature/Algorithm/EdDSA.php index 6d59ce4d..cd09113e 100644 --- a/src/Library/Signature/Algorithm/EdDSA.php +++ b/src/Library/Signature/Algorithm/EdDSA.php @@ -6,7 +6,7 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use ParagonIE\Sodium\Core\Ed25519; use RuntimeException; use function assert; diff --git a/src/Library/Signature/Algorithm/HMAC.php b/src/Library/Signature/Algorithm/HMAC.php index badda987..92436b00 100644 --- a/src/Library/Signature/Algorithm/HMAC.php +++ b/src/Library/Signature/Algorithm/HMAC.php @@ -6,7 +6,7 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use function in_array; use function is_string; diff --git a/src/Library/Signature/JWSBuilder.php b/src/Library/Signature/JWSBuilder.php index 84201cc6..3c1a1661 100644 --- a/src/Library/Signature/JWSBuilder.php +++ b/src/Library/Signature/JWSBuilder.php @@ -8,12 +8,12 @@ use Jose\Component\Core\Algorithm; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Core\Util\KeyChecker; use Jose\Component\Signature\Algorithm\MacAlgorithm; use Jose\Component\Signature\Algorithm\SignatureAlgorithm; use LogicException; -use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use function array_key_exists; use function count; diff --git a/src/Library/Signature/JWSVerifier.php b/src/Library/Signature/JWSVerifier.php index 187d24d8..1944c4dd 100644 --- a/src/Library/Signature/JWSVerifier.php +++ b/src/Library/Signature/JWSVerifier.php @@ -9,10 +9,10 @@ use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\KeyChecker; use Jose\Component\Signature\Algorithm\MacAlgorithm; use Jose\Component\Signature\Algorithm\SignatureAlgorithm; -use ParagonIE\ConstantTime\Base64UrlSafe; use Throwable; class JWSVerifier diff --git a/src/Library/Signature/Serializer/CompactSerializer.php b/src/Library/Signature/Serializer/CompactSerializer.php index 3a657a14..03a9c0d7 100644 --- a/src/Library/Signature/Serializer/CompactSerializer.php +++ b/src/Library/Signature/Serializer/CompactSerializer.php @@ -5,10 +5,10 @@ namespace Jose\Component\Signature\Serializer; use InvalidArgumentException; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Signature\JWS; use LogicException; -use ParagonIE\ConstantTime\Base64UrlSafe; use Throwable; use function count; use function is_array; diff --git a/src/Library/Signature/Serializer/JSONFlattenedSerializer.php b/src/Library/Signature/Serializer/JSONFlattenedSerializer.php index 1a8b4cb0..93dae92c 100644 --- a/src/Library/Signature/Serializer/JSONFlattenedSerializer.php +++ b/src/Library/Signature/Serializer/JSONFlattenedSerializer.php @@ -5,9 +5,9 @@ namespace Jose\Component\Signature\Serializer; use InvalidArgumentException; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Signature\JWS; -use ParagonIE\ConstantTime\Base64UrlSafe; use function count; use function is_array; diff --git a/src/Library/Signature/Serializer/JSONGeneralSerializer.php b/src/Library/Signature/Serializer/JSONGeneralSerializer.php index 1905e645..43acd0e0 100644 --- a/src/Library/Signature/Serializer/JSONGeneralSerializer.php +++ b/src/Library/Signature/Serializer/JSONGeneralSerializer.php @@ -5,10 +5,10 @@ namespace Jose\Component\Signature\Serializer; use InvalidArgumentException; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Signature\JWS; use LogicException; -use ParagonIE\ConstantTime\Base64UrlSafe; use function array_key_exists; use function count; use function is_array; diff --git a/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKLoaderTest.php b/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKLoaderTest.php index 88774a89..5d9445bb 100644 --- a/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKLoaderTest.php +++ b/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKLoaderTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Bundle\JoseFramework\Functional\KeyManagement; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\KeyManagement\JWKFactory; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/tests/Component/Console/KeyCreationCommandTest.php b/tests/Component/Console/KeyCreationCommandTest.php index 3dc3b425..fb6ecfc1 100644 --- a/tests/Component/Console/KeyCreationCommandTest.php +++ b/tests/Component/Console/KeyCreationCommandTest.php @@ -12,7 +12,7 @@ use Jose\Component\Console\RsaKeyGeneratorCommand; use Jose\Component\Console\SecretKeyGeneratorCommand; use Jose\Component\Core\JWK; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Component/Encryption/EncrypterTest.php b/tests/Component/Encryption/EncrypterTest.php index 368723dd..b7030e7c 100644 --- a/tests/Component/Encryption/EncrypterTest.php +++ b/tests/Component/Encryption/EncrypterTest.php @@ -7,7 +7,7 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use const JSON_THROW_ON_ERROR; diff --git a/tests/Component/Encryption/JWEFlattenedTest.php b/tests/Component/Encryption/JWEFlattenedTest.php index c21c4590..f3dc4ad6 100644 --- a/tests/Component/Encryption/JWEFlattenedTest.php +++ b/tests/Component/Encryption/JWEFlattenedTest.php @@ -5,7 +5,7 @@ namespace Jose\Tests\Component\Encryption; use Jose\Component\Core\JWKSet; -use ParagonIE\ConstantTime\Base64UrlSafe; +use Jose\Component\Core\Util\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionProtectedContentOnlyTest.php b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionProtectedContentOnlyTest.php index ef018f35..9ec432be 100644 --- a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionProtectedContentOnlyTest.php +++ b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionProtectedContentOnlyTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionTest.php b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionTest.php index e8e5d589..5cb4ecf2 100644 --- a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionTest.php +++ b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTest.php b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTest.php index afe6a5dc..62f8c916 100644 --- a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTest.php +++ b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithCompressionTest.php b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithCompressionTest.php index f8b1175f..840bad6a 100644 --- a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithCompressionTest.php +++ b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithCompressionTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTest.php b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTest.php index 281d1025..83d3495d 100644 --- a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTest.php +++ b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/A256GCMKWAndA128CBC_HS256EncryptionTest.php b/tests/Component/Encryption/RFC7520/A256GCMKWAndA128CBC_HS256EncryptionTest.php index a069e51f..826539b2 100644 --- a/tests/Component/Encryption/RFC7520/A256GCMKWAndA128CBC_HS256EncryptionTest.php +++ b/tests/Component/Encryption/RFC7520/A256GCMKWAndA128CBC_HS256EncryptionTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/DirAndA128GCMEncryptionTest.php b/tests/Component/Encryption/RFC7520/DirAndA128GCMEncryptionTest.php index 556c4bc9..32bda187 100644 --- a/tests/Component/Encryption/RFC7520/DirAndA128GCMEncryptionTest.php +++ b/tests/Component/Encryption/RFC7520/DirAndA128GCMEncryptionTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/ECDH_ES_A128KWAndA128GCMEncryptionTest.php b/tests/Component/Encryption/RFC7520/ECDH_ES_A128KWAndA128GCMEncryptionTest.php index 6d1324ab..47853e81 100644 --- a/tests/Component/Encryption/RFC7520/ECDH_ES_A128KWAndA128GCMEncryptionTest.php +++ b/tests/Component/Encryption/RFC7520/ECDH_ES_A128KWAndA128GCMEncryptionTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/ECDH_ES_AndA128CBC_HS256EncryptionTest.php b/tests/Component/Encryption/RFC7520/ECDH_ES_AndA128CBC_HS256EncryptionTest.php index 13649d14..33359e70 100644 --- a/tests/Component/Encryption/RFC7520/ECDH_ES_AndA128CBC_HS256EncryptionTest.php +++ b/tests/Component/Encryption/RFC7520/ECDH_ES_AndA128CBC_HS256EncryptionTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/MultipleRecipientEncryptionTest.php b/tests/Component/Encryption/RFC7520/MultipleRecipientEncryptionTest.php index f07db246..05f1129c 100644 --- a/tests/Component/Encryption/RFC7520/MultipleRecipientEncryptionTest.php +++ b/tests/Component/Encryption/RFC7520/MultipleRecipientEncryptionTest.php @@ -6,8 +6,8 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTest.php b/tests/Component/Encryption/RFC7520/PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTest.php index de912c4f..8059a308 100644 --- a/tests/Component/Encryption/RFC7520/PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTest.php +++ b/tests/Component/Encryption/RFC7520/PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use const JSON_THROW_ON_ERROR; diff --git a/tests/Component/Encryption/RFC7520/RSA1_5AndA128CBC_HS256EncryptionTest.php b/tests/Component/Encryption/RFC7520/RSA1_5AndA128CBC_HS256EncryptionTest.php index 1537fde1..f49f0ef5 100644 --- a/tests/Component/Encryption/RFC7520/RSA1_5AndA128CBC_HS256EncryptionTest.php +++ b/tests/Component/Encryption/RFC7520/RSA1_5AndA128CBC_HS256EncryptionTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RFC7520/RSA_OAEPAndA256GCMEncryptionTest.php b/tests/Component/Encryption/RFC7520/RSA_OAEPAndA256GCMEncryptionTest.php index d9217fb9..541d141a 100644 --- a/tests/Component/Encryption/RFC7520/RSA_OAEPAndA256GCMEncryptionTest.php +++ b/tests/Component/Encryption/RFC7520/RSA_OAEPAndA256GCMEncryptionTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\Component\Encryption\RFC7520; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; /** diff --git a/tests/Component/Encryption/RSAKeyEncryptionTest.php b/tests/Component/Encryption/RSAKeyEncryptionTest.php index f134d6e2..910e5cf6 100644 --- a/tests/Component/Encryption/RSAKeyEncryptionTest.php +++ b/tests/Component/Encryption/RSAKeyEncryptionTest.php @@ -7,10 +7,10 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\KeyEncryption\RSA15; use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP; use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP256; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use const STR_PAD_LEFT; diff --git a/tests/Component/KeyManagement/JWKFactoryTest.php b/tests/Component/KeyManagement/JWKFactoryTest.php index aadcdf2a..eca351d2 100644 --- a/tests/Component/KeyManagement/JWKFactoryTest.php +++ b/tests/Component/KeyManagement/JWKFactoryTest.php @@ -4,9 +4,9 @@ namespace Jose\Tests\Component\KeyManagement; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\ECKey; use Jose\Component\KeyManagement\JWKFactory; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Component/KeyManagement/JWKTest.php b/tests/Component/KeyManagement/JWKTest.php index f76e9d91..2d37dbf4 100644 --- a/tests/Component/KeyManagement/JWKTest.php +++ b/tests/Component/KeyManagement/JWKTest.php @@ -7,9 +7,9 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Core\Util\RSAKey; use Jose\Component\KeyManagement\JWKFactory; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use const JSON_THROW_ON_ERROR; diff --git a/tests/Component/Signature/JWSTest.php b/tests/Component/Signature/JWSTest.php index f2c0c409..31ff5869 100644 --- a/tests/Component/Signature/JWSTest.php +++ b/tests/Component/Signature/JWSTest.php @@ -5,9 +5,9 @@ namespace Jose\Tests\Component\Signature; use InvalidArgumentException; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Signature\JWS; use LogicException; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use const JSON_THROW_ON_ERROR; diff --git a/tests/Component/Signature/SignerTest.php b/tests/Component/Signature/SignerTest.php index 80a66d07..e24e7a38 100644 --- a/tests/Component/Signature/SignerTest.php +++ b/tests/Component/Signature/SignerTest.php @@ -7,9 +7,9 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Signature\Serializer\CompactSerializer; use LogicException; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use const JSON_THROW_ON_ERROR; diff --git a/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php b/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php index 672642e3..3eab015c 100644 --- a/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php +++ b/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php @@ -4,10 +4,10 @@ namespace Jose\Tests\EncryptionAlgorithm\ContentEncryption\AESCBC; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\ContentEncryption\A128CBCHS256; use Jose\Component\Encryption\Algorithm\ContentEncryption\A192CBCHS384; use Jose\Component\Encryption\Algorithm\ContentEncryption\A256CBCHS512; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use ReflectionClass; diff --git a/tests/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCMContentEncryptionTest.php b/tests/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCMContentEncryptionTest.php index f659f745..41c8bbd7 100644 --- a/tests/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCMContentEncryptionTest.php +++ b/tests/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCMContentEncryptionTest.php @@ -4,10 +4,10 @@ namespace Jose\Tests\EncryptionAlgorithm\ContentEncryption\AESGCM; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\ContentEncryption\A128GCM; use Jose\Component\Encryption\Algorithm\ContentEncryption\A192GCM; use Jose\Component\Encryption\Algorithm\ContentEncryption\A256GCM; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use const STR_PAD_LEFT; diff --git a/tests/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKWKeyEncryptionTest.php b/tests/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKWKeyEncryptionTest.php index 40903389..e97a450d 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKWKeyEncryptionTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKWKeyEncryptionTest.php @@ -6,10 +6,10 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\KeyEncryption\A128GCMKW; use Jose\Component\Encryption\Algorithm\KeyEncryption\A192GCMKW; use Jose\Component\Encryption\Algorithm\KeyEncryption\A256GCMKW; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/EncryptionAlgorithm/KeyEncryption/AESKW/AESKWKeyEncryptionTest.php b/tests/EncryptionAlgorithm/KeyEncryption/AESKW/AESKWKeyEncryptionTest.php index 3f7117e9..9013745a 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/AESKW/AESKWKeyEncryptionTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/AESKW/AESKWKeyEncryptionTest.php @@ -6,10 +6,10 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\KeyEncryption\A128KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\A192KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\A256KW; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/EncryptionAlgorithm/KeyEncryption/Direct/DirAlgorithmTest.php b/tests/EncryptionAlgorithm/KeyEncryption/Direct/DirAlgorithmTest.php index 6f249c9c..5ba32c12 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/Direct/DirAlgorithmTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/Direct/DirAlgorithmTest.php @@ -6,8 +6,8 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\KeyEncryption\Dir; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESKeyAgreementTest.php b/tests/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESKeyAgreementTest.php index 51333543..b9f8fff8 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESKeyAgreementTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESKeyAgreementTest.php @@ -6,11 +6,11 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHES; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA128KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA192KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA256KW; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use const STR_PAD_LEFT; diff --git a/tests/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2_HS_AESKWKeyEncryptionTest.php b/tests/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2_HS_AESKWKeyEncryptionTest.php index e09fbd42..f60e21c1 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2_HS_AESKWKeyEncryptionTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2_HS_AESKWKeyEncryptionTest.php @@ -6,10 +6,10 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS256A128KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS384A192KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS512A256KW; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use const STR_PAD_LEFT; diff --git a/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC6979Test.php b/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC6979Test.php index 40d53ed7..eeaeb47b 100644 --- a/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC6979Test.php +++ b/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC6979Test.php @@ -5,11 +5,11 @@ namespace Jose\Tests\SignatureAlgorithm\ECDSA; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Signature\Algorithm\ES256; use Jose\Component\Signature\Algorithm\ES384; use Jose\Component\Signature\Algorithm\ES512; use Jose\Component\Signature\Algorithm\SignatureAlgorithm; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/SignatureAlgorithm/ECDSA/ECDSASignatureTest.php b/tests/SignatureAlgorithm/ECDSA/ECDSASignatureTest.php index a6f97b2d..fe138502 100644 --- a/tests/SignatureAlgorithm/ECDSA/ECDSASignatureTest.php +++ b/tests/SignatureAlgorithm/ECDSA/ECDSASignatureTest.php @@ -6,10 +6,10 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Signature\Algorithm\ES256; use Jose\Component\Signature\Algorithm\ES384; use Jose\Component\Signature\Algorithm\ES512; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/SignatureAlgorithm/EdDSA/EdDSASignatureTest.php b/tests/SignatureAlgorithm/EdDSA/EdDSASignatureTest.php index 77ee9baa..b866df5b 100644 --- a/tests/SignatureAlgorithm/EdDSA/EdDSASignatureTest.php +++ b/tests/SignatureAlgorithm/EdDSA/EdDSASignatureTest.php @@ -6,10 +6,10 @@ use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Signature\Algorithm\EdDSA; use Jose\Component\Signature\JWSBuilder; use Jose\Component\Signature\JWSVerifier; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/SignatureAlgorithm/Experimental/Blake2bTest.php b/tests/SignatureAlgorithm/Experimental/Blake2bTest.php index bcc9c455..a8d5183d 100644 --- a/tests/SignatureAlgorithm/Experimental/Blake2bTest.php +++ b/tests/SignatureAlgorithm/Experimental/Blake2bTest.php @@ -6,8 +6,8 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Experimental\Signature\Blake2b; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Before; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/SignatureAlgorithm/Experimental/P256KSignatureTest.php b/tests/SignatureAlgorithm/Experimental/P256KSignatureTest.php index bcece142..4964d81e 100644 --- a/tests/SignatureAlgorithm/Experimental/P256KSignatureTest.php +++ b/tests/SignatureAlgorithm/Experimental/P256KSignatureTest.php @@ -5,8 +5,8 @@ namespace Jose\Tests\SignatureAlgorithm\Experimental; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Experimental\Signature\ES256K; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/SignatureAlgorithm/HMAC/HMACSignatureTest.php b/tests/SignatureAlgorithm/HMAC/HMACSignatureTest.php index 80856a43..92b0e6c0 100644 --- a/tests/SignatureAlgorithm/HMAC/HMACSignatureTest.php +++ b/tests/SignatureAlgorithm/HMAC/HMACSignatureTest.php @@ -6,10 +6,10 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Signature\Algorithm\HS256; use Jose\Component\Signature\Algorithm\HS384; use Jose\Component\Signature\Algorithm\HS512; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/SignatureAlgorithm/RSA/RSASignatureTest.php b/tests/SignatureAlgorithm/RSA/RSASignatureTest.php index da510cd9..b68b27ee 100644 --- a/tests/SignatureAlgorithm/RSA/RSASignatureTest.php +++ b/tests/SignatureAlgorithm/RSA/RSASignatureTest.php @@ -8,6 +8,7 @@ use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; +use Jose\Component\Core\Util\Base64UrlSafe; use Jose\Component\Signature\Algorithm\PS256; use Jose\Component\Signature\Algorithm\PS384; use Jose\Component\Signature\Algorithm\PS512; @@ -18,7 +19,6 @@ use Jose\Component\Signature\JWSVerifier; use Jose\Component\Signature\Serializer\CompactSerializer; use Jose\Component\Signature\Serializer\JSONGeneralSerializer; -use ParagonIE\ConstantTime\Base64UrlSafe; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use const JSON_THROW_ON_ERROR; From 773e36f981d168773dda981ddce05c354cd582c9 Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Tue, 2 Jul 2024 18:07:46 +0200 Subject: [PATCH 2/3] Add Base64UrlSafe utility and refactor code references This commit adds the utility `Base64UrlSafe` to provide methods for encoding and decoding in Base64UrlSafe format. Simultaneously, the commit also updates multiple files across the library to use this utility instead of the previously used `ParagonIE\ConstantTime\Base64UrlSafe`. This change will ensure consistent use of this utility throughout the project, promoting maintainability and ease of updating in the future, if required. --- src/Library/Core/Util/Base64UrlSafe.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Library/Core/Util/Base64UrlSafe.php b/src/Library/Core/Util/Base64UrlSafe.php index c3f44d65..d7863ad3 100644 --- a/src/Library/Core/Util/Base64UrlSafe.php +++ b/src/Library/Core/Util/Base64UrlSafe.php @@ -27,7 +27,10 @@ * SOFTWARE. */ -final readonly class Base64UrlSafe +/** + * @readonly + */ +final class Base64UrlSafe { public static function encode(string $binString): string { From b2fafff61cd0b25d70e7d995f2c453a20d0d97f1 Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Tue, 2 Jul 2024 18:09:54 +0200 Subject: [PATCH 3/3] Add Base64UrlSafe utility and refactor code references This commit adds the utility `Base64UrlSafe` to provide methods for encoding and decoding in Base64UrlSafe format. Simultaneously, the commit also updates multiple files across the library to use this utility instead of the previously used `ParagonIE\ConstantTime\Base64UrlSafe`. This change will ensure consistent use of this utility throughout the project, promoting maintainability and ease of updating in the future, if required. --- phpstan-baseline.neon | 308 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 294 insertions(+), 14 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index adbac08c..77134450 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1006,11 +1006,6 @@ parameters: count: 1 path: src/Bundle/Serializer/JWESerializer.php - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWESerializer\\:\\:getSupportedTypes\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/Serializer/JWESerializer.php - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWESerializer\\:\\:supportsDenormalization\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" count: 1 @@ -1046,11 +1041,6 @@ parameters: count: 1 path: src/Bundle/Serializer/JWSSerializer.php - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSSerializer\\:\\:getSupportedTypes\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/Serializer/JWSSerializer.php - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSSerializer\\:\\:supportsDenormalization\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" count: 1 @@ -1288,16 +1278,86 @@ parameters: count: 1 path: src/Library/Checker/IssuerChecker.php + - + message: "#^Property Jose\\\\Component\\\\Console\\\\AddKeyIntoKeysetCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/AddKeyIntoKeysetCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\AddKeyIntoKeysetCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/AddKeyIntoKeysetCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\EcKeyGeneratorCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/EcKeyGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\EcKeyGeneratorCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/EcKeyGeneratorCommand.php + - message: "#^Cannot cast mixed to int\\.$#" count: 1 path: src/Library/Console/EcKeysetGeneratorCommand.php + - + message: "#^Property Jose\\\\Component\\\\Console\\\\EcKeysetGeneratorCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/EcKeysetGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\EcKeysetGeneratorCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/EcKeysetGeneratorCommand.php + - message: "#^Method Jose\\\\Component\\\\Console\\\\GeneratorCommand\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 path: src/Library/Console/GeneratorCommand.php + - + message: "#^Property Jose\\\\Component\\\\Console\\\\GetThumbprintCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/GetThumbprintCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\GetThumbprintCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/GetThumbprintCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\JKULoaderCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/JKULoaderCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\JKULoaderCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/JKULoaderCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\KeyAnalyzerCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/KeyAnalyzerCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\KeyAnalyzerCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/KeyAnalyzerCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\KeyFileLoaderCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/KeyFileLoaderCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\KeyFileLoaderCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/KeyFileLoaderCommand.php + - message: "#^Parameter \\#1 \\$jwk of method Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\KeyAnalyzerManager\\:\\:analyze\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" count: 1 @@ -1308,31 +1368,211 @@ parameters: count: 1 path: src/Library/Console/KeysetAnalyzerCommand.php + - + message: "#^Property Jose\\\\Component\\\\Console\\\\KeysetAnalyzerCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/KeysetAnalyzerCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\KeysetAnalyzerCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/KeysetAnalyzerCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\MergeKeysetCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/MergeKeysetCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\MergeKeysetCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/MergeKeysetCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\NoneKeyGeneratorCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/NoneKeyGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\NoneKeyGeneratorCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/NoneKeyGeneratorCommand.php + - message: "#^Cannot cast mixed to int\\.$#" count: 1 path: src/Library/Console/OctKeyGeneratorCommand.php + - + message: "#^Property Jose\\\\Component\\\\Console\\\\OctKeyGeneratorCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/OctKeyGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\OctKeyGeneratorCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/OctKeyGeneratorCommand.php + - message: "#^Cannot cast mixed to int\\.$#" count: 2 path: src/Library/Console/OctKeysetGeneratorCommand.php + - + message: "#^Property Jose\\\\Component\\\\Console\\\\OctKeysetGeneratorCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/OctKeysetGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\OctKeysetGeneratorCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/OctKeysetGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\OkpKeyGeneratorCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/OkpKeyGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\OkpKeyGeneratorCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/OkpKeyGeneratorCommand.php + - message: "#^Cannot cast mixed to int\\.$#" count: 1 path: src/Library/Console/OkpKeysetGeneratorCommand.php + - + message: "#^Property Jose\\\\Component\\\\Console\\\\OkpKeysetGeneratorCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/OkpKeysetGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\OkpKeysetGeneratorCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/OkpKeysetGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\OptimizeRsaKeyCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/OptimizeRsaKeyCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\OptimizeRsaKeyCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/OptimizeRsaKeyCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\P12CertificateLoaderCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/P12CertificateLoaderCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\P12CertificateLoaderCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/P12CertificateLoaderCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\PemConverterCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/PemConverterCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\PemConverterCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/PemConverterCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\PublicKeyCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/PublicKeyCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\PublicKeyCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/PublicKeyCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\PublicKeysetCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/PublicKeysetCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\PublicKeysetCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/PublicKeysetCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\RotateKeysetCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/RotateKeysetCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\RotateKeysetCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/RotateKeysetCommand.php + - message: "#^Cannot cast mixed to int\\.$#" count: 1 path: src/Library/Console/RsaKeyGeneratorCommand.php + - + message: "#^Property Jose\\\\Component\\\\Console\\\\RsaKeyGeneratorCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/RsaKeyGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\RsaKeyGeneratorCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/RsaKeyGeneratorCommand.php + - message: "#^Cannot cast mixed to int\\.$#" count: 2 path: src/Library/Console/RsaKeysetGeneratorCommand.php + - + message: "#^Property Jose\\\\Component\\\\Console\\\\RsaKeysetGeneratorCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/RsaKeysetGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\RsaKeysetGeneratorCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/RsaKeysetGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\SecretKeyGeneratorCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/SecretKeyGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\SecretKeyGeneratorCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/SecretKeyGeneratorCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\X509CertificateLoaderCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/X509CertificateLoaderCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\X509CertificateLoaderCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/X509CertificateLoaderCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\X5ULoaderCommand\\:\\:\\$defaultDescription has no type specified\\.$#" + count: 1 + path: src/Library/Console/X5ULoaderCommand.php + + - + message: "#^Property Jose\\\\Component\\\\Console\\\\X5ULoaderCommand\\:\\:\\$defaultName has no type specified\\.$#" + count: 1 + path: src/Library/Console/X5ULoaderCommand.php + - message: "#^Call to function is_string\\(\\) with string will always evaluate to true\\.$#" count: 1 @@ -1413,11 +1653,51 @@ parameters: count: 1 path: src/Library/Core/JWKSet.php + - + message: "#^Parameter \\#2 \\$mode of function count expects 0\\|1, int given\\.$#" + count: 1 + path: src/Library/Core/JWKSet.php + - message: "#^Property Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:\\$keys type has no value type specified in iterable type array\\.$#" count: 1 path: src/Library/Core/JWKSet.php + - + message: "#^Comparison operation \"\\>\" between 0 and 1 is always false\\.$#" + count: 1 + path: src/Library/Core/Util/Base64UrlSafe.php + + - + message: "#^Instantiated class Jose\\\\Component\\\\Core\\\\Util\\\\InvalidArgumentException not found\\.$#" + count: 2 + path: src/Library/Core/Util/Base64UrlSafe.php + + - + message: "#^Instantiated class Jose\\\\Component\\\\Core\\\\Util\\\\RangeException not found\\.$#" + count: 3 + path: src/Library/Core/Util/Base64UrlSafe.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\Util\\\\Base64UrlSafe\\:\\:safeSubstr\\(\\) has parameter \\$length with no type specified\\.$#" + count: 1 + path: src/Library/Core/Util/Base64UrlSafe.php + + - + message: "#^Throwing object of an unknown class Jose\\\\Component\\\\Core\\\\Util\\\\InvalidArgumentException\\.$#" + count: 2 + path: src/Library/Core/Util/Base64UrlSafe.php + + - + message: "#^Throwing object of an unknown class Jose\\\\Component\\\\Core\\\\Util\\\\RangeException\\.$#" + count: 3 + path: src/Library/Core/Util/Base64UrlSafe.php + + - + message: "#^Variable \\$i might not be defined\\.$#" + count: 2 + path: src/Library/Core/Util/Base64UrlSafe.php + - message: "#^Method Jose\\\\Component\\\\Core\\\\Util\\\\ECKey\\:\\:createECKey\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#" count: 1 @@ -1789,7 +2069,7 @@ parameters: path: src/Library/Encryption/Serializer/JSONFlattenedSerializer.php - - message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" + message: "#^Parameter \\#1 \\$encodedString of static method Jose\\\\Component\\\\Core\\\\Util\\\\Base64UrlSafe\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" count: 3 path: src/Library/Encryption/Serializer/JSONFlattenedSerializer.php @@ -1819,7 +2099,7 @@ parameters: path: src/Library/Encryption/Serializer/JSONGeneralSerializer.php - - message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" + message: "#^Parameter \\#1 \\$encodedString of static method Jose\\\\Component\\\\Core\\\\Util\\\\Base64UrlSafe\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" count: 3 path: src/Library/Encryption/Serializer/JSONGeneralSerializer.php @@ -2149,7 +2429,7 @@ parameters: path: src/Library/Signature/Serializer/CompactSerializer.php - - message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" + message: "#^Parameter \\#1 \\$encodedString of static method Jose\\\\Component\\\\Core\\\\Util\\\\Base64UrlSafe\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" count: 1 path: src/Library/Signature/Serializer/JSONFlattenedSerializer.php @@ -2174,7 +2454,7 @@ parameters: path: src/Library/Signature/Serializer/JSONGeneralSerializer.php - - message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" + message: "#^Parameter \\#1 \\$encodedString of static method Jose\\\\Component\\\\Core\\\\Util\\\\Base64UrlSafe\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" count: 1 path: src/Library/Signature/Serializer/JSONGeneralSerializer.php