File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
lib/internal/Magento/Framework/Encryption Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -16,22 +16,14 @@ class Sodium implements EncryptionAdapterInterface
16
16
*/
17
17
private $ key ;
18
18
19
- /**
20
- * @var int
21
- */
22
- private $ keyVersion ;
23
-
24
19
/**
25
20
* Sodium constructor.
26
21
* @param string $key
27
- * @param int|null $keyVersion
28
22
*/
29
23
public function __construct (
30
- string $ key ,
31
- int $ keyVersion = null
24
+ string $ key
32
25
) {
33
26
$ this ->key = $ key ;
34
- $ this ->keyVersion = $ keyVersion ;
35
27
}
36
28
37
29
/**
@@ -50,9 +42,7 @@ public function encrypt(string $data): string
50
42
$ this ->key
51
43
);
52
44
53
- return $ this ->keyVersion .
54
- ': ' . Encryptor::CIPHER_AEAD_CHACHA20POLY1305 .
55
- ': ' . base64_encode ($ nonce . $ cipherText );
45
+ return $ nonce . $ cipherText ;
56
46
}
57
47
58
48
/**
Original file line number Diff line number Diff line change @@ -274,9 +274,11 @@ private function getPasswordVersion()
274
274
*/
275
275
public function encrypt ($ data )
276
276
{
277
- $ crypt = new Sodium ($ this ->keys [$ this ->keyVersion ], $ this -> keyVersion );
277
+ $ crypt = new Sodium ($ this ->keys [$ this ->keyVersion ]);
278
278
279
- return $ crypt ->encrypt ($ data );
279
+ return $ this ->keyVersion .
280
+ ': ' . self ::CIPHER_AEAD_CHACHA20POLY1305 .
281
+ ': ' . base64_encode ($ crypt ->encrypt ($ data ));
280
282
}
281
283
282
284
/**
You can’t perform that action at this time.
0 commit comments