File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
lib/internal/Magento/Framework/Encryption Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace Magento \Framework \Encryption \Adapter ;
6
6
7
- use Magento \Framework \Encryption \Encryptor ;
8
-
9
7
/**
10
8
* Sodium adapter for encrypting and decrypting strings
11
9
*/
12
- class Sodium implements EncryptionAdapterInterface
10
+ class SodiumChachaIetf implements EncryptionAdapterInterface
13
11
{
14
12
/**
15
13
* @var string
Original file line number Diff line number Diff line change 12
12
use Magento \Framework \Encryption \Adapter \EncryptionAdapterInterface ;
13
13
use Magento \Framework \Encryption \Helper \Security ;
14
14
use Magento \Framework \Math \Random ;
15
- use Magento \Framework \Encryption \Adapter \Sodium ;
15
+ use Magento \Framework \Encryption \Adapter \SodiumChachaIetf ;
16
16
use Magento \Framework \Encryption \Adapter \Mcrypt ;
17
17
18
18
/**
@@ -274,7 +274,7 @@ private function getPasswordVersion()
274
274
*/
275
275
public function encrypt ($ data )
276
276
{
277
- $ crypt = new Sodium ($ this ->keys [$ this ->keyVersion ]);
277
+ $ crypt = new SodiumChachaIetf ($ this ->keys [$ this ->keyVersion ]);
278
278
279
279
return $ this ->keyVersion .
280
280
': ' . self ::CIPHER_AEAD_CHACHA20POLY1305 .
@@ -408,7 +408,7 @@ private function getCrypt(
408
408
$ cipherVersion = $ this ->validateCipher ($ cipherVersion );
409
409
410
410
if ($ cipherVersion >= self ::CIPHER_AEAD_CHACHA20POLY1305 ) {
411
- return new Sodium ($ key );
411
+ return new SodiumChachaIetf ($ key );
412
412
}
413
413
414
414
if ($ cipherVersion === self ::CIPHER_RIJNDAEL_128 ) {
Original file line number Diff line number Diff line change 9
9
namespace Magento \Framework \Encryption \Test \Unit ;
10
10
11
11
use Magento \Framework \Encryption \Adapter \Mcrypt ;
12
- use Magento \Framework \Encryption \Adapter \Sodium ;
12
+ use Magento \Framework \Encryption \Adapter \SodiumChachaIetf ;
13
13
use Magento \Framework \Encryption \Encryptor ;
14
14
use Magento \Framework \Encryption \Crypt ;
15
15
use Magento \Framework \App \DeploymentConfig ;
@@ -159,7 +159,7 @@ public function testEncrypt()
159
159
$ parts = explode (': ' , $ actual , 3 );
160
160
list (, , $ encryptedData ) = $ parts ;
161
161
162
- $ crypt = new Sodium (self ::CRYPT_KEY_1 );
162
+ $ crypt = new SodiumChachaIetf (self ::CRYPT_KEY_1 );
163
163
// Verify decrypted matches original data
164
164
$ this ->assertEquals ($ data , $ crypt ->decrypt (base64_decode ((string )$ encryptedData )));
165
165
}
You can’t perform that action at this time.
0 commit comments