[SECURITY] Ensure ARGON2 constants are defined, or throw exception

Esse commit está contido em:
Hugo Sales
2020-07-27 22:18:23 +00:00
commit 0bb44602b2
+6 -3
Ver Arquivo
@@ -362,11 +362,14 @@ class LocalUser implements UserInterface
case 'bcrypt':
return PASSWORD_BCRYPT;
case 'argon2i':
return PASSWORD_ARGON2I;
case 'argon2d':
return PASSWORD_ARGON2D;
case 'argon2id':
return PASSWORD_ARGON2ID;
$c = 'PASSWORD_' . strtoupper($algo);
if (defined($c)) {
return constant($c);
}
// fallthrough
// no break
default:
throw new Exception('Unsupported or unsafe hashing algorithm requested');
}