You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2007/10/12 15:09:00 UTC

svn commit: r584157 - /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java

Author: elecharny
Date: Fri Oct 12 06:08:58 2007
New Revision: 584157

URL: http://svn.apache.org/viewvc?rev=584157&view=rev
Log:
Using a constants instead of String into the code.
Using equalsIgnoreCase to avoid some potential bug

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=584157&r1=584156&r2=584157&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java Fri Oct 12 06:08:58 2007
@@ -391,8 +391,8 @@
         
         int pos = algorithm.length() + 2;
         
-        if ( ( LdapSecurityConstants.HASH_METHOD_MD5.equals( algorithm ) ) ||
-            ( LdapSecurityConstants.HASH_METHOD_SHA.equals( algorithm ) ) )
+        if ( ( LdapSecurityConstants.HASH_METHOD_MD5.equalsIgnoreCase( algorithm ) ) ||
+            ( LdapSecurityConstants.HASH_METHOD_SHA.equalsIgnoreCase( algorithm ) ) )
         {
             try
             {
@@ -406,8 +406,8 @@
                 return credentials;
             }
         }
-        else if ( ( LdapSecurityConstants.HASH_METHOD_SMD5.equals( algorithm ) ) ||
-                 ( LdapSecurityConstants.HASH_METHOD_SSHA.equals( algorithm ) ) )
+        else if ( ( LdapSecurityConstants.HASH_METHOD_SMD5.equalsIgnoreCase( algorithm ) ) ||
+                 ( LdapSecurityConstants.HASH_METHOD_SSHA.equalsIgnoreCase( algorithm ) ) )
         {
             try
             {
@@ -429,7 +429,7 @@
                 return credentials;
             }
         }
-        else if ( LdapSecurityConstants.HASH_METHOD_CRYPT.equals( algorithm ) )
+        else if ( LdapSecurityConstants.HASH_METHOD_CRYPT.equalsIgnoreCase( algorithm ) )
         {
         	// The password is associated with a salt. Decompose it 
         	// in two parts, storing the salt into the EncryptionMethod structure.
@@ -667,7 +667,7 @@
         {
             String algorithm = sPassword.substring( 1, rightParen );
 
-            if ( "crypt".equals( algorithm ) )
+            if ( LdapSecurityConstants.HASH_METHOD_CRYPT.equalsIgnoreCase( algorithm ) )
             {
                 return algorithm;
             }
@@ -712,7 +712,7 @@
         // create message digest object
         try
         {
-            if ( "crypt".equalsIgnoreCase( algorithm ) )
+            if ( LdapSecurityConstants.HASH_METHOD_CRYPT.equalsIgnoreCase( algorithm ) )
             {
                 String saltWithCrypted = UnixCrypt.crypt( StringTools.utf8ToString( password ), "" );
                 String crypted = saltWithCrypted.substring( 2 );