From 9a3e023c439425e4c10999062b127ec699984f22 Mon Sep 17 00:00:00 2001 From: Michael Gerber Date: Tue, 24 Nov 2015 13:54:33 +0000 Subject: [PATCH] fix null pointer --- .../java/org/keycloak/models/utils/CredentialValidation.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/model/api/src/main/java/org/keycloak/models/utils/CredentialValidation.java b/model/api/src/main/java/org/keycloak/models/utils/CredentialValidation.java index 7ce15d8eee..af9b6b562b 100755 --- a/model/api/src/main/java/org/keycloak/models/utils/CredentialValidation.java +++ b/model/api/src/main/java/org/keycloak/models/utils/CredentialValidation.java @@ -51,6 +51,10 @@ public class CredentialValidation { } 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()); if (validated) { int iterations = hashIterations(realm);