Moves all new encryption to the sodium library. Supports decryption using legacy mcrypt ciphers. This PR ensures new values are (en-de)crypted with sodium and legacy values can be decrypted using mcrypt.
A data patch updating configuration values with a backend_model of \Magento\Config\Model\Config\Backend\Encrypted::class and the contents of sales_order_payment.cc_number_enc. This mirrors the re-encryption behavior when change the key in Magento\EncryptionKey\Model\ResourceModel\Key\Change
Fixed Issues (if relevant)
magento-engcom/php-7.2-support#124
magento-engcom/php-7.2-support#128 - \Magento\Framework\Encryption\Crypt is deprecated and replaced with \Magento\Framework\Encryption\Adapter\Mcrypt. An exception is thrown when Mcrypt::encrypt is called.
magento-engcom/php-7.2-support#129
Manual testing scenarios
Install any Magento version using mcrypt
Configure Braintree Payment Gateway in admin panel
Checkout using Braintree Payment
Expect success
Upgrade installation to libsodium
Checkout using Braintree Payment
Expect success - the existing mcrypt gateway credentials are decrypted to allow checkout. Values are not re-encrypted with sodium.
Update Braintree encrypted values in admin panel to trigger sodium encryption
Checkout using Braintree Payment
Expect success
Contribution checklist
[ ] Pull request has a meaningful description of its purpose
[ ] All commits are accompanied by meaningful commit messages
[ ] All new or changed code is covered with unit/integration tests (if applicable)
[ ] All automated tests passed successfully (all builds on Travis CI are green)
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
Description
Moves all new encryption to the sodium library. Supports decryption using legacy mcrypt ciphers. This PR ensures new values are (en-de)crypted with sodium and legacy values can be decrypted using mcrypt.
A data patch updating configuration values with a
backend_model
of\Magento\Config\Model\Config\Backend\Encrypted::class
and the contents ofsales_order_payment.cc_number_enc
. This mirrors the re-encryption behavior when change the key inMagento\EncryptionKey\Model\ResourceModel\Key\Change
Fixed Issues (if relevant)
\Magento\Framework\Encryption\Crypt
is deprecated and replaced with\Magento\Framework\Encryption\Adapter\Mcrypt
. An exception is thrown whenMcrypt::encrypt
is called.Manual testing scenarios
Contribution checklist