Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 85481 invoked from network); 19 Apr 2007 14:31:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Apr 2007 14:31:43 -0000 Received: (qmail 97079 invoked by uid 500); 19 Apr 2007 14:31:50 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 97044 invoked by uid 500); 19 Apr 2007 14:31:50 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 97032 invoked by uid 99); 19 Apr 2007 14:31:49 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2007 07:31:49 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2007 07:31:42 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id A72931A9838; Thu, 19 Apr 2007 07:31:22 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070419143122.A72931A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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];