Return-Path: X-Original-To: apmail-ws-dev-archive@www.apache.org Delivered-To: apmail-ws-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 26E857353 for ; Tue, 13 Dec 2011 14:08:01 +0000 (UTC) Received: (qmail 71933 invoked by uid 500); 13 Dec 2011 14:08:00 -0000 Delivered-To: apmail-ws-dev-archive@ws.apache.org Received: (qmail 71739 invoked by uid 500); 13 Dec 2011 14:08:00 -0000 Mailing-List: contact dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ws.apache.org Delivered-To: mailing list dev@ws.apache.org Received: (qmail 71732 invoked by uid 99); 13 Dec 2011 14:08:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Dec 2011 14:08:00 +0000 X-ASF-Spam-Status: No, hits=-2001.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Dec 2011 14:07:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D9CC6110EEC for ; Tue, 13 Dec 2011 14:07:30 +0000 (UTC) Date: Tue, 13 Dec 2011 14:07:30 +0000 (UTC) From: "Maxim Naidenov (Closed) (JIRA)" To: dev@ws.apache.org Message-ID: <1982436517.5754.1323785250893.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2093720887.4817.1323764131030.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Closed] (WSS-330) CryptoBase.getAliasForX509CertThumb calculates hash wrongly, could only match first certificate correctly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WSS-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maxim Naidenov closed WSS-330. ------------------------------ Resolution: Not A Problem Hi Colm, you are right, seems I was too fast to write a bug report before doing a good old debug and especially carefully checking the certificates that are compared. Sorry for taking your time. Maxim > CryptoBase.getAliasForX509CertThumb calculates hash wrongly, could only match first certificate correctly > --------------------------------------------------------------------------------------------------------- > > Key: WSS-330 > URL: https://issues.apache.org/jira/browse/WSS-330 > Project: WSS4J > Issue Type: Bug > Components: WSS4J Core > Affects Versions: 1.5.12 > Reporter: Maxim Naidenov > Assignee: Colm O hEigeartaigh > Fix For: 1.5.13 > > > The method CryptoBase.getAliasForX509CertThumb(byte[] thumb) does not calculate the hash of certificates in the keystore correctly and could possibly match only the first certificate. > This is because the SHA1 message digest is reset once: > sha = MessageDigest.getInstance("SHA-1"); > sha.reset(); > but is updated every time while enumerating over certificates in the keystore: > sha.update(cert.getEncoded()); > byte[] data = sha.digest(); > The fix would be to move the digest reset in the beginning of the enumeration loop. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org For additional commands, e-mail: dev-help@ws.apache.org