Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mcrypt services #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 0 additions & 110 deletions Cryptography/MCryptEncryptionService.php

This file was deleted.

56 changes: 0 additions & 56 deletions DependencyInjection/Compiler/LegacyEncryptionPass.php

This file was deleted.

6 changes: 0 additions & 6 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ public function getConfigTreeBuilder()
->then(function ($config) {
@trigger_error($this->getSecretDeprecationMessage(), E_USER_DEPRECATED);

$config['encryption'] = array(
'enabled' => true,
'provider' => 'mcrypt',
'secret' => $config['secret'],
);

return $config;
})
->end()
Expand Down
6 changes: 1 addition & 5 deletions DependencyInjection/JMSPaymentCoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,10 @@ public function load(array $configs, ContainerBuilder $container)
if ($config['encryption']['enabled']) {
$container->setParameter('payment.encryption', $config['encryption']['provider']);
$container->setParameter('payment.encryption.secret', $config['encryption']['secret']);

foreach (array('mcrypt', 'defuse_php_encryption') as $provider) {
$container->setParameter("payment.encryption.$provider.secret", $config['encryption']['secret']);
}
$container->setParameter("payment.encryption.defuse_php_encryption.secret", $config['encryption']['secret']);
} else {
$container->removeAlias('payment.encryption_service');
$container->removeDefinition('payment.encryption');
$container->removeDefinition('payment.encryption.mcrypt');
$container->removeDefinition('payment.encryption.defuse_php_encryption');
}
}
Expand Down
2 changes: 0 additions & 2 deletions JMSPaymentCoreBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use JMS\Payment\CoreBundle\DependencyInjection\Compiler\AddPaymentMethodFormTypesPass;
use JMS\Payment\CoreBundle\DependencyInjection\Compiler\AddPaymentPluginsPass;
use JMS\Payment\CoreBundle\DependencyInjection\Compiler\ConfigureEncryptionPass;
use JMS\Payment\CoreBundle\DependencyInjection\Compiler\LegacyEncryptionPass;
use JMS\Payment\CoreBundle\Entity\ExtendedDataType;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down Expand Up @@ -41,7 +40,6 @@ public function build(ContainerBuilder $builder)

$builder->addCompilerPass(new AddPaymentPluginsPass());
$builder->addCompilerPass(new AddPaymentMethodFormTypesPass());
$builder->addCompilerPass(new LegacyEncryptionPass());
$builder->addCompilerPass(new ConfigureEncryptionPass());
}
}
22 changes: 0 additions & 22 deletions Resources/config/payment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,8 @@
<parameter key="payment.form.choose_payment_method_type.class">JMS\Payment\CoreBundle\Form\ChoosePaymentMethodType</parameter>
<parameter key="payment.form.choose_payment_method_transformer.class">JMS\Payment\CoreBundle\Form\Transformer\ChoosePaymentMethodTransformer</parameter>

<parameter key="payment.encryption.mcrypt.class">JMS\Payment\CoreBundle\Cryptography\MCryptEncryptionService</parameter>
<parameter key="payment.encryption.mcrypt.secret"></parameter>
<parameter key="payment.encryption.mcrypt.cipher">rijndael-256</parameter>
<parameter key="payment.encryption.mcrypt.mode">ctr</parameter>

<parameter key="payment.encryption.defuse_php_encryption.class">JMS\Payment\CoreBundle\Cryptography\DefusePhpEncryptionService</parameter>
<parameter key="payment.encryption.defuse_php_encryption.secret"></parameter>

<!-- DEPRECATED since 1.3, will be removed in 2.0: use the payment.encryption.mcrypt.* parameters instead -->
<parameter key="payment.encryption_service.class">JMS\Payment\CoreBundle\Cryptography\MCryptEncryptionService</parameter>
<parameter key="payment.encryption_service.secret"></parameter>
<parameter key="payment.encryption_service.cipher">rijndael-256</parameter>
<parameter key="payment.encryption_service.mode">ctr</parameter>

</parameters>

<services>
Expand All @@ -50,16 +38,6 @@
<argument type="service" id="event_dispatcher" />
</service>

<!-- DEPRECATED since 1.3, will be removed in 2.0: use payment.encryption.mcrypt directly instead -->
<service id="payment.encryption_service" alias="payment.encryption.mcrypt" />

<service id="payment.encryption.mcrypt" class="%payment.encryption.mcrypt.class%">
<argument>%payment.encryption.mcrypt.secret%</argument>
<argument>%payment.encryption.mcrypt.cipher%</argument>
<argument>%payment.encryption.mcrypt.mode%</argument>
<tag name="payment.encryption" alias="mcrypt" />
</service>

<service id="payment.encryption.defuse_php_encryption" alias="JMS\Payment\CoreBundle\Cryptography\DefusePhpEncryptionService"/>
<service id="JMS\Payment\CoreBundle\Cryptography\DefusePhpEncryptionService" class="%payment.encryption.defuse_php_encryption.class%" public="true">
<argument>%payment.encryption.defuse_php_encryption.secret%</argument>
Expand Down
78 changes: 0 additions & 78 deletions Tests/Cryptography/MCryptEncryptionServiceTest.php

This file was deleted.

17 changes: 0 additions & 17 deletions Tests/DependencyInjection/Configuration/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@ public function testNoSecret()
);
}

public function testSecret()
{
$this->assertConfigurationIsValid(array('secret' => 'foo'));

$this->assertConfigurationEquals(
array('secret' => 'foo'),
array(
'secret' => 'foo',
'encryption' => array(
'enabled' => true,
'secret' => 'foo',
'provider' => 'mcrypt',
),
)
);
}

public function testEncryptionDisabled()
{
$this->assertConfigurationIsValid(array());
Expand Down
27 changes: 0 additions & 27 deletions Tests/Functional/PaymentWorkflowMcryptTest.php

This file was deleted.