fix null pointer
This commit is contained in:
parent
142ef50728
commit
9a3e023c43
1 changed files with 4 additions and 0 deletions
|
@ -51,6 +51,10 @@ public class CredentialValidation {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean validateHashedCredential(RealmModel realm, UserModel user, String unhashedCredValue, UserCredentialValueModel credential) {
|
public static boolean validateHashedCredential(RealmModel realm, UserModel user, String unhashedCredValue, UserCredentialValueModel credential) {
|
||||||
|
if(unhashedCredValue == null){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
boolean validated = new Pbkdf2PasswordEncoder(credential.getSalt()).verify(unhashedCredValue, credential.getValue(), credential.getHashIterations());
|
boolean validated = new Pbkdf2PasswordEncoder(credential.getSalt()).verify(unhashedCredValue, credential.getValue(), credential.getHashIterations());
|
||||||
if (validated) {
|
if (validated) {
|
||||||
int iterations = hashIterations(realm);
|
int iterations = hashIterations(realm);
|
||||||
|
|
Loading…
Reference in a new issue