[SECURITY] Ensure ARGON2 constants are defined, or throw exception
This commit is contained in:
		| @@ -362,11 +362,14 @@ class LocalUser implements UserInterface | |||||||
|         case 'bcrypt': |         case 'bcrypt': | ||||||
|             return PASSWORD_BCRYPT; |             return PASSWORD_BCRYPT; | ||||||
|         case 'argon2i': |         case 'argon2i': | ||||||
|             return PASSWORD_ARGON2I; |  | ||||||
|         case 'argon2d': |         case 'argon2d': | ||||||
|             return PASSWORD_ARGON2D; |  | ||||||
|         case 'argon2id': |         case 'argon2id': | ||||||
|             return PASSWORD_ARGON2ID; |             $c = 'PASSWORD_' . strtoupper($algo); | ||||||
|  |             if (defined($c)) { | ||||||
|  |                 return constant($c); | ||||||
|  |             } | ||||||
|  |             // fallthrough | ||||||
|  |             // no break | ||||||
|         default: |         default: | ||||||
|             throw new Exception('Unsupported or unsafe hashing algorithm requested'); |             throw new Exception('Unsupported or unsafe hashing algorithm requested'); | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user