You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2013/06/11 14:05:46 UTC

svn commit: r1491761 - /directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java

Author: pamarcelot
Date: Tue Jun 11 12:05:45 2013
New Revision: 1491761

URL: http://svn.apache.org/r1491761
Log:
Used 'prefix' rather than 'algorithm' which can differ in the case of salted hashing mechanisms.

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java?rev=1491761&r1=1491760&r2=1491761&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java Tue Jun 11 12:05:45 2013
@@ -165,7 +165,7 @@ public class PasswordUtil
 
         if ( algorithm != null )
         {
-            sb.append( '{' ).append( algorithm.getAlgorithm().toUpperCase() ).append( '}' );
+            sb.append( '{' ).append( algorithm.getPrefix().toUpperCase() ).append( '}' );
 
             if ( algorithm == LdapSecurityConstants.HASH_METHOD_CRYPT )
             {
@@ -357,7 +357,7 @@ public class PasswordUtil
      */
     public static byte[] splitCredentials( byte[] credentials, EncryptionMethod encryptionMethod )
     {
-        int algoLength = encryptionMethod.getAlgorithm().getAlgorithm().length() + 2;
+        int algoLength = encryptionMethod.getAlgorithm().getPrefix().length() + 2;
 
         switch ( encryptionMethod.getAlgorithm() )
         {