Skip to content

Commit 1750886

Browse files
committed
Merge remote-tracking branch 'origin/MC-19686' into 2.3-develop-pr80
2 parents 06d3698 + f02cb96 commit 1750886

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,12 @@ public function isValidHash($password, $hash)
273273
{
274274
try {
275275
$this->explodePasswordHash($hash);
276+
$recreated = $password;
276277
foreach ($this->getPasswordVersion() as $hashVersion) {
277278
if ($hashVersion === self::HASH_VERSION_ARGON2ID13) {
278-
$recreated = $this->getArgonHash($password, $this->getPasswordSalt());
279+
$recreated = $this->getArgonHash($recreated, $this->getPasswordSalt());
279280
} else {
280-
$recreated = $this->generateSimpleHash($this->getPasswordSalt() . $password, $hashVersion);
281+
$recreated = $this->generateSimpleHash($this->getPasswordSalt() . $recreated, $hashVersion);
281282
}
282283
$hash = $this->getPasswordHash();
283284
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public function validateHashDataProvider(): array
152152
['password', 'hash:salt:1', false],
153153
['password', '67a1e09bb1f83f5007dc119c14d663aa:salt:0', true],
154154
['password', '13601bda4ea78e55a07b98866d2be6be0744e3866f13c00c811cab608a28f322:salt:1', true],
155+
['password', 'c6aad9e058f6c4b06187c06d2b69bf506a786af030f81fb6d83778422a68205e:salt:1:2', true],
155156
];
156157
}
157158

0 commit comments

Comments
 (0)