directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r530426 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
Date Thu, 19 Apr 2007 14:31:22 GMT
Author: elecharny
Date: Thu Apr 19 07:31:20 2007
New Revision: 530426

URL: http://svn.apache.org/viewvc?view=rev&rev=530426
Log:
Fixed a bug in the decoding of a stored password. The length was not correct. 

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

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?view=diff&rev=530426&r1=530425&r2=530426
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
Thu Apr 19 07:31:20 2007
@@ -391,7 +391,7 @@
             {
             	// We just have the password just after the algorithm, base64 encoded.
             	// Just decode the password and return it.
-                return Base64.decode( new String( credentials, pos, credentials.length -
( pos + 1 ), "UTF-8" ).toCharArray() );
+                return Base64.decode( new String( credentials, pos, credentials.length -
pos, "UTF-8" ).toCharArray() );
             }
             catch ( UnsupportedEncodingException uee )
             {
@@ -408,7 +408,7 @@
             	// in two parts, after having decoded the password.
             	// The salt will be stored into the EncryptionMethod structure
             	// The salt is at the end of the credentials, and is 8 bytes long
-                byte[] passwordAndSalt = Base64.decode( new String( credentials, pos, credentials.length
- ( pos + 1 ), "UTF-8" ).toCharArray() );
+                byte[] passwordAndSalt = Base64.decode( new String( credentials, pos, credentials.length
- pos, "UTF-8" ).toCharArray() );
                 
                 encryptionMethod.salt = new byte[8];
                 byte[] password = new byte[passwordAndSalt.length - encryptionMethod.salt.length];



Mime
View raw message