explicitly reject empty hashes

This commit is contained in:
Jeidnx 2024-11-21 10:46:44 +01:00
parent e4ba19556c
commit 77cd736c06
No known key found for this signature in database
GPG Key ID: 0E9E697B7E99DF39

View File

@ -96,6 +96,9 @@ public class UserHandlers {
}
private static boolean hashMatch(String hash, String pass) {
if (hash.isBlank()) {
return false;
}
return hash.startsWith("$argon2") ?
argon2PasswordEncoder.matches(pass, hash) :
bcryptPasswordEncoder.matches(pass, hash);