Skip to content

Commit

Permalink
[LDAP-13] - Don't hash password values
Browse files Browse the repository at this point in the history
  • Loading branch information
coheigea committed Jun 24, 2014
1 parent eb5a9a4 commit 07c06f1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ protected final void hashPassword(final Attribute passwordAttr, final String ent
}

private String hashBytes(final byte[] plain, final String algorithm, final long randSeed) {
String plainPassword = new String(plain);
if (plainPassword != null && plainPassword.startsWith("{")) {
String digest = plainPassword.substring(1, plainPassword.indexOf('}'));
if (digest != null && algorithm.equalsIgnoreCase(digest)) {
return plainPassword;
}
}

MessageDigest digest = null;
try {
if (algorithm.equalsIgnoreCase("SSHA") || algorithm.equalsIgnoreCase("SHA")) {
Expand Down

0 comments on commit 07c06f1

Please sign in to comment.