Skip to content

Commit b03eaa9

Browse files
author
ogorkun
committed
MC-36790: [2.3.x] Passwords hashed with Sodium cannot be validated with later library versions
1 parent b772013 commit b03eaa9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/internal/Magento/Framework/Encryption/Encryptor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ private function getCrypt(
517517
int $cipherVersion = null,
518518
string $initVector = null
519519
): ?EncryptionAdapterInterface {
520+
//phpcs:disable PHPCompatibility.Constants.RemovedConstants
520521
if (null === $key && null === $cipherVersion) {
521522
$cipherVersion = $this->getCipherVersion();
522523
}
@@ -548,6 +549,7 @@ private function getCrypt(
548549
$cipher = MCRYPT_BLOWFISH;
549550
$mode = MCRYPT_MODE_ECB;
550551
}
552+
//phpcs:enable PHPCompatibility.Constants.RemovedConstants
551553

552554
return new Mcrypt($key, $cipher, $mode, $initVector);
553555
}

lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ public function testLegacyDecrypt(): void
263263
[$iv, $encrypted] = array_slice(explode(':', $data, 4), 2, 2);
264264

265265
// Decrypt returned data with RIJNDAEL_256 cipher, cbc mode
266+
//phpcs:ignore PHPCompatibility.Constants.RemovedConstants
266267
$crypt = new Crypt(self::CRYPT_KEY_1, MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC, $iv);
267268
// Verify decrypted matches original data
268269
$this->assertEquals($encrypted, base64_encode($crypt->encrypt($actual)));

0 commit comments

Comments
 (0)