Remove Makefile #56
infection.yml
on: push
0️⃣ Mutation Testing
6m 0s
Annotations
10 warnings
0️⃣ Mutation Testing:
src/Bundle/DependencyInjection/Compiler/AlgorithmCompilerPass.php#L19
Escaped Mutant for Mutator "LogicalNot":
@@ @@
#[Override]
public function process(ContainerBuilder $container): void
{
- if (!$container->hasDefinition(AlgorithmManagerFactory::class)) {
+ if ($container->hasDefinition(AlgorithmManagerFactory::class)) {
return;
}
$definition = $container->getDefinition(AlgorithmManagerFactory::class);
|
0️⃣ Mutation Testing:
src/Bundle/DependencyInjection/Compiler/AlgorithmCompilerPass.php#L26
Escaped Mutant for Mutator "Foreach_":
@@ @@
}
$definition = $container->getDefinition(AlgorithmManagerFactory::class);
$taggedAlgorithmServices = $container->findTaggedServiceIds('jose.algorithm');
- foreach ($taggedAlgorithmServices as $id => $tags) {
+ foreach ([] as $id => $tags) {
foreach ($tags as $attributes) {
if (!isset($attributes['alias'])) {
throw new InvalidArgumentException(sprintf('The algorithm "%s" does not have any "alias" attribute.', $id));
|
0️⃣ Mutation Testing:
src/Bundle/DependencyInjection/Compiler/AlgorithmCompilerPass.php#L27
Escaped Mutant for Mutator "Foreach_":
@@ @@
$definition = $container->getDefinition(AlgorithmManagerFactory::class);
$taggedAlgorithmServices = $container->findTaggedServiceIds('jose.algorithm');
foreach ($taggedAlgorithmServices as $id => $tags) {
- foreach ($tags as $attributes) {
+ foreach ([] as $attributes) {
if (!isset($attributes['alias'])) {
throw new InvalidArgumentException(sprintf('The algorithm "%s" does not have any "alias" attribute.', $id));
}
|
0️⃣ Mutation Testing:
src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php#L61
Escaped Mutant for Mutator "LogicalOrNegation":
@@ @@
}
$agreed_key = $this->calculateAgreementKey($private_key, $public_key);
$apu = array_key_exists('apu', $complete_header) ? $complete_header['apu'] : '';
- is_string($apu) || throw new InvalidArgumentException('Invalid APU.');
+ !(is_string($apu) || throw new InvalidArgumentException('Invalid APU.'));
$apv = array_key_exists('apv', $complete_header) ? $complete_header['apv'] : '';
is_string($apv) || throw new InvalidArgumentException('Invalid APU.');
return ConcatKDF::generate($agreed_key, $algorithm, $encryptionKeyLength, $apu, $apv);
|
0️⃣ Mutation Testing:
src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php#L63
Escaped Mutant for Mutator "Throw_":
@@ @@
$apu = array_key_exists('apu', $complete_header) ? $complete_header['apu'] : '';
is_string($apu) || throw new InvalidArgumentException('Invalid APU.');
$apv = array_key_exists('apv', $complete_header) ? $complete_header['apv'] : '';
- is_string($apv) || throw new InvalidArgumentException('Invalid APU.');
+ is_string($apv) || new InvalidArgumentException('Invalid APU.');
return ConcatKDF::generate($agreed_key, $algorithm, $encryptionKeyLength, $apu, $apv);
}
#[Override]
|
0️⃣ Mutation Testing:
src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php#L63
Escaped Mutant for Mutator "LogicalOrNegation":
@@ @@
$apu = array_key_exists('apu', $complete_header) ? $complete_header['apu'] : '';
is_string($apu) || throw new InvalidArgumentException('Invalid APU.');
$apv = array_key_exists('apv', $complete_header) ? $complete_header['apv'] : '';
- is_string($apv) || throw new InvalidArgumentException('Invalid APU.');
+ !(is_string($apv) || throw new InvalidArgumentException('Invalid APU.'));
return ConcatKDF::generate($agreed_key, $algorithm, $encryptionKeyLength, $apu, $apv);
}
#[Override]
|
0️⃣ Mutation Testing:
src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php#L74
Escaped Mutant for Mutator "ProtectedVisibility":
@@ @@
{
return self::MODE_AGREEMENT;
}
- protected function calculateAgreementKey(JWK $private_key, JWK $public_key): string
+ private function calculateAgreementKey(JWK $private_key, JWK $public_key): string
{
$crv = $public_key->get('crv');
if (!is_string($crv)) {
|
0️⃣ Mutation Testing:
src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php#L80
Escaped Mutant for Mutator "SharedCaseRemoval":
@@ @@
switch ($crv) {
case 'P-256':
case 'P-384':
- case 'P-521':
$curve = $this->getCurve($crv);
if (function_exists('openssl_pkey_derive')) {
try {
|
0️⃣ Mutation Testing:
src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php#L91
Escaped Mutant for Mutator "FalseValue":
@@ @@
$publicPem = ECKey::convertPublicKeyToPEM($public_key);
$privatePem = ECKey::convertPrivateKeyToPEM($private_key);
$res = openssl_pkey_derive($publicPem, $privatePem, $curve->getSize());
- if ($res === false) {
+ if ($res === true) {
throw new RuntimeException('Unable to derive the key');
}
return $res;
|
0️⃣ Mutation Testing:
src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php#L92
Escaped Mutant for Mutator "Throw_":
@@ @@
$privatePem = ECKey::convertPrivateKeyToPEM($private_key);
$res = openssl_pkey_derive($publicPem, $privatePem, $curve->getSize());
if ($res === false) {
- throw new RuntimeException('Unable to derive the key');
+ new RuntimeException('Unable to derive the key');
}
return $res;
} catch (Throwable) {
|