magento-engcom / php-7.2-support

Repository for implementing support of php-7.2 support in Magento
Open Software License 3.0
23 stars 25 forks source link

Sodium Encryption #135

Closed pmclain closed 6 years ago

pmclain commented 6 years ago

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 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)

  1. magento-engcom/php-7.2-support#124
  2. 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.
  3. magento-engcom/php-7.2-support#129

Manual testing scenarios

  1. Install any Magento version using mcrypt
  2. Configure Braintree Payment Gateway in admin panel
  3. Checkout using Braintree Payment
  4. Expect success
  5. Upgrade installation to libsodium
  6. Checkout using Braintree Payment
  7. Expect success - the existing mcrypt gateway credentials are decrypted to allow checkout. Values are not re-encrypted with sodium.
  8. Update Braintree encrypted values in admin panel to trigger sodium encryption
  9. Checkout using Braintree Payment
  10. Expect success

Contribution checklist

magento-cicd2 commented 6 years ago

CLA assistant check
All committers have signed the CLA.

magento-cicd2 commented 6 years ago

CLA assistant check
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.