Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/util/password/PhabricatorPasswordHasher.php
| Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | /* -( Implementing a Hasher )---------------------------------------------- */ | ||||
| */ | */ | ||||
| protected function verifyPassword( | protected function verifyPassword( | ||||
| PhutilOpaqueEnvelope $password, | PhutilOpaqueEnvelope $password, | ||||
| PhutilOpaqueEnvelope $hash) { | PhutilOpaqueEnvelope $hash) { | ||||
| $actual_hash = $this->getPasswordHash($password)->openEnvelope(); | $actual_hash = $this->getPasswordHash($password)->openEnvelope(); | ||||
| $expect_hash = $hash->openEnvelope(); | $expect_hash = $hash->openEnvelope(); | ||||
| return ($actual_hash === $expect_hash); | return phutil_hashes_are_identical($actual_hash, $expect_hash); | ||||
| } | } | ||||
| /** | /** | ||||
| * Check if an existing hash created by this algorithm is upgradeable. | * Check if an existing hash created by this algorithm is upgradeable. | ||||
| * | * | ||||
| * The default implementation returns `false`. However, hash algorithms which | * The default implementation returns `false`. However, hash algorithms which | ||||
| * have (for example) an internal cost function may be able to upgrade an | * have (for example) an internal cost function may be able to upgrade an | ||||
| ▲ Show 20 Lines • Show All 283 Lines • Show Last 20 Lines | |||||