Return-Path: X-Original-To: apmail-directory-users-archive@www.apache.org Delivered-To: apmail-directory-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AA41410989 for ; Thu, 9 Jan 2014 09:17:28 +0000 (UTC) Received: (qmail 29771 invoked by uid 500); 9 Jan 2014 09:17:27 -0000 Delivered-To: apmail-directory-users-archive@directory.apache.org Received: (qmail 29667 invoked by uid 500); 9 Jan 2014 09:17:23 -0000 Mailing-List: contact users-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@directory.apache.org Delivered-To: mailing list users@directory.apache.org Delivered-To: moderator for users@directory.apache.org Received: (qmail 22512 invoked by uid 99); 9 Jan 2014 06:14:16 -0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of flaviomattos86@gmail.com designates 209.85.212.180 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mB0rpAXibKftdZImIag3F/QTmSGeycMa5cT/mguSwyI=; b=ZNaIHOj4Ay68xXtDQcJIm8Kd5PwjhKmbxOh94OkV1ZqXJ8B5zP5QUNpjEzKdGKmwLh 5VNNyP8BFqn8AJo0fi3gA4935Y0yNj5sZr+Bu3XBG1B0mYF0ef08S+GdaHExkiklDhbj vaSgoG7si9bUXkUbZ8dIoqdLuxW3L5KBkKMUflmTVDSuVT+rLn9oKxqc1Ck/uEKwNseh fk9kheZhcrMGbpsr5FsGPpPuh2ojpBNL0SNYFipDjCKk4EBlUlu0R73P6q1E/BRuGMef +OslQeGu6qoxjPH2d0ydi9g58O0AN2RsZiE54GBT9ccrz6XlfWK9GFM0Xr2xesJb3/oE JLiQ== MIME-Version: 1.0 X-Received: by 10.180.12.70 with SMTP id w6mr1560019wib.4.1389248030861; Wed, 08 Jan 2014 22:13:50 -0800 (PST) In-Reply-To: References: Date: Wed, 8 Jan 2014 22:13:50 -0800 Message-ID: Subject: Re: possible bugwhen adding {sha} password From: Flavio Mattos To: "api@directory.apache.org" Cc: "users@directory.apache.org" Content-Type: multipart/alternative; boundary=001a11c223ac626eb404ef838315 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c223ac626eb404ef838315 Content-Type: text/plain; charset=ISO-8859-1 Hi! Thanks for answering me.. I am expecting it without the quotes... As I sad it just happens for a few entries. I would say 5% of the entries. Remembering that I am using the same method to generate the hash value. I also have tried hard coded hash and the problem persist. Thanks On Wednesday, January 8, 2014, Kiran Ayyagari wrote: > On Thu, Jan 9, 2014 at 6:54 AM, Flavio Mattos > >wrote: > > > Hi everyone! > > > > I have noticed a strage behavior/bug using the client API when I try to > > create entries with encrypted password using {SHA}. > > I am invoking the method the following constructor: > > > > > > What is happening is: For some reason the API is adding a "'" for a few > > entries. To make sure the problem is not with my code I have tried to > use a > > hardcoded value. > > When I go to the Apache Directory Studio the password is like this: > > '{sha}W6ph5Mm5Pz8GgiULbPgzG37mj9g=' and instead of being {sha} encrypted > it > > > this is the value of the hashed password(including the hash method), what > else are you expecting? > > > becomes plain text password. > > The code below is inside a loop where I add different entries.. > > > > Entry entry = new DefaultEntry(dn, finalArray); //dn is a String and > > finalArray is Object[] > > > > private void addEntry(Entry entry, LdapConnection conn) throws > > LdapException { > > > > AddRequest addRequest = new AddRequestImpl(); > > addRequest.setEntry(entry); > > AddResponse response = conn.add(addRequest); > > > > if > > > (ResultCodeEnum.SUCCESS.equals(response.getLdapResult().getResultCode())) { > > logger.log(Level.INFO, "Entry {0} added successfully", > > entry.getDn().getName()); > > } else { > > logger.log(Level.SEVERE, "Error adding entry {0} {1}", new > > Object[]{entry.getDn().getName(), > response.getLdapResult().getResultCode() > > + "-" + response.getLdapResult().getResultCode().getMessage()}); > > if (! > > > > > response.getLdapResult().getResultCode().equals(ResultCodeEnum.ENTRY_ALREADY_EXISTS) > > ) { > > > > > > > ldapExceptionManagerLocal.insert(this.createLdapSyncException(entry.getDn().getName(), > > response.getLdapResult().getResultCode().name(), > > response.getLdapResult().getResultCode().getMessage(), > > LdapSyncException.ESYNC_TYPE.WALLET)); > > throw new > > LdapException(response.getLdapResult().getResultCode().name()); > > } > > } > > } > > > > > > > > That is result of the toString method. > > Entry: > > dn: uid=30,ou=customer_db,,dc=example,dc=com > > objectclass: inetOrgPerson > > objectclass: organizationalPerson > > objectclass: person > > objectclass: top > > stateorprovincename: NY > > postalcode: 10475 > > mail: unittest30@example.com > > sn: Doe > > userpassword: {sha}W6ph5Mm5Pz8GgiULbPgzG37mj9g= > > cn: John > > street: 999 N TEST AVE > > givenname: John > > localityname: UNITED STATES > > > > > > Does anybody know if there is a bug already registered for this? > > > > Thanks > > > > Flavio > > > > > > -- > Kiran Ayyagari > http://keydap.com > --001a11c223ac626eb404ef838315--