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 2006/08/16 23:10:10 UTC

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

Author: elecharny
Date: Wed Aug 16 14:10:10 2006
New Revision: 432037

URL: http://svn.apache.org/viewvc?rev=432037&view=rev
Log:
Fix the potential bug DIRSERVER-582

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

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=432037&r1=432036&r2=432037&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java Wed Aug 16 14:10:10 2006
@@ -102,7 +102,7 @@
         }
         else if ( creds instanceof String )
         {
-            creds = ( ( String ) creds ).getBytes();
+            creds = StringTools.getBytesUtf8( ( String ) creds );
         }
 
         byte[] userPassword = null;
@@ -127,7 +127,7 @@
                 String algorithm = this.getAlgorithmForHashedPassword( userPassword );
                 String digestedCredits = this.createDigestedPassword( algorithm, creds );
 
-                credentialsMatch = ArrayUtils.isEquals( digestedCredits.getBytes(), userPassword );
+                credentialsMatch = ArrayUtils.isEquals( StringTools.getBytesUtf8( digestedCredits ), userPassword );
             }
             catch ( NoSuchAlgorithmException nsae )
             {
@@ -312,7 +312,7 @@
         }
         else if ( password instanceof String )
         {
-            data = ( ( String ) password ).getBytes();
+            data = StringTools.getBytesUtf8( ( String ) password );
         }
         else
         {