Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1089 → Rev 1090

/trunk/plugins/viathinksoft/auth/A4_argon2/OIDplusAuthPluginArgon2.class.php
36,7 → 36,6
 
public function verify(OIDplusRAAuthInfo $authInfo, $check_password) {
$authKey = $authInfo->getAuthKey();
$salt = $authInfo->getSalt();
 
if (!$this->supportedCryptAlgo($authKey)) {
// Unsupported algorithm
47,10 → 46,6
// \_____/ \__/ \____________/ \____________________/ \_________________________________________/
// Algo Vers Cost options Salt Hash
 
if ($salt != '') {
throw new OIDplusException(_L('This function does not accept an explicit salt'));
}
 
return password_verify($check_password, $authKey);
}
 
66,13 → 61,12
}
 
public function generate($password): OIDplusRAAuthInfo {
$s_salt = ''; // Argon2 automatically generates a salt
$hashalgo = $this->getBestHashAlgo();
assert($hashalgo !== false); // Should not happen if we called available() before!
$calc_authkey = password_hash($password, $hashalgo);
if (!$calc_authkey) throw new OIDplusException(_L('Error creating password hash'));
assert($this->supportedCryptAlgo($calc_authkey));
return new OIDplusRAAuthInfo($s_salt, $calc_authkey);
return new OIDplusRAAuthInfo($calc_authkey);
}
 
private function supportsArgon2i(): bool {