Skip to content
Permalink
Browse files

Merge branch 'b-6.x'

  • Loading branch information...
gregorhyneck committed Mar 27, 2019
2 parents 578198b + a3d432a commit bf9ae2213ebb5e761cd601a614c3e6bad4c1f6ae
@@ -2001,7 +2001,7 @@ public function setPassword($password = null)
*/
private function hashPassword(string $password): string
{
$algorithm = Registry::getConfig()->getConfigParam('passwordHashingAlgorithm') ?? PASSWORD_DEFAULT;
$algorithm = Registry::getConfig()->getConfigParam('passwordHashingAlgorithm') ?? 'PASSWORD_BCRYPT';
$passwordServiceBridge = $this->getContainer()->get(PasswordServiceBridgeInterface::class);
return $passwordServiceBridge->hash($password, $algorithm);
@@ -18,7 +18,7 @@ class PasswordHashStrategiesArray implements ArrayAccess
/**
* @var array
*/
private $container = [];
private $strategies = [];
/**
* @param mixed $offset
@@ -34,7 +34,7 @@ public function offsetSet($offset, $value)
throw new \RuntimeException('The array key must be set');
}
$this->container[$offset] = $value;
$this->strategies[$offset] = $value;
}
/**
@@ -44,15 +44,15 @@ public function offsetSet($offset, $value)
*/
public function offsetExists($offset): bool
{
return isset($this->container[$offset]);
return isset($this->strategies[$offset]);
}
/**
* @param mixed $offset
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
unset($this->strategies[$offset]);
}
/**
@@ -62,9 +62,9 @@ public function offsetUnset($offset)
*/
public function offsetGet($offset): PasswordHashStrategyInterface
{
if (!isset($this->container[$offset])) {
if (!isset($this->strategies[$offset])) {
throw new \RuntimeException('The requested password hash strategy is not available: ' . $offset);
}
return $this->container[$offset] ?? null;
return $this->strategies[$offset] ?? null;
}
}
@@ -13,9 +13,9 @@ services:
OxidEsales\EshopCommunity\Internal\Password\Service\PasswordHashServiceInterface:
class: OxidEsales\EshopCommunity\Internal\Password\Service\PasswordHashService
calls:
- [addPasswordHashStrategy, [PASSWORD_BCRYPT, "@OxidEsales\\EshopCommunity\\Internal\\Password\\Strategy\\PasswordHashBcryptStrategy"]]
- [addPasswordHashStrategy, [PASSWORD_ARGON2I, "@OxidEsales\\EshopCommunity\\Internal\\Password\\Strategy\\PasswordHashArgon2IStrategy"]]
- [addPasswordHashStrategy, [PASSWORD_ARGON2ID, "@OxidEsales\\EshopCommunity\\Internal\\Password\\Strategy\\PasswordHashArgon2IdStrategy"]]
- [addPasswordHashStrategy, ['PASSWORD_BCRYPT', "@OxidEsales\\EshopCommunity\\Internal\\Password\\Strategy\\PasswordHashBcryptStrategy"]]
- [addPasswordHashStrategy, ['PASSWORD_ARGON2I', "@OxidEsales\\EshopCommunity\\Internal\\Password\\Strategy\\PasswordHashArgon2IStrategy"]]
- [addPasswordHashStrategy, ['PASSWORD_ARGON2ID', "@OxidEsales\\EshopCommunity\\Internal\\Password\\Strategy\\PasswordHashArgon2IdStrategy"]]

OxidEsales\EshopCommunity\Internal\Password\Service\PasswordVerificationServiceInterface:
class: OxidEsales\EshopCommunity\Internal\Password\Service\PasswordVerificationService
@@ -182,8 +182,8 @@ $this->aSlaveHosts = null;
$this->blDelSetupDir = true;

/**
* Supported values are the PASSWORD_* constants available in your PHP version.
* Some of the hashing algorithms may not be available on your system.
* Supported values are the strings PASSWORD_BCRYPT, PASSWORD_ARGON2I and PASSWORD_ARGON2ID.
* Some of the hashing algorithms may not be available on your system depending on your PHP version.
*/
$this->passwordHashingAlgorithm = 'PASSWORD_BCRYPT';

0 comments on commit bf9ae22

Please sign in to comment.
You can’t perform that action at this time.