Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BEC1DFE44 for ; Mon, 26 May 2014 16:07:58 +0000 (UTC) Received: (qmail 73235 invoked by uid 500); 26 May 2014 16:07:58 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 73170 invoked by uid 500); 26 May 2014 16:07:58 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 73163 invoked by uid 99); 26 May 2014 16:07:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 May 2014 16:07:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 58C0C9A58AE; Mon, 26 May 2014 16:07:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Message-Id: <8602313610534c308355e56f3a6f07e3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: [CXF-5766] - Caching nonces to disk may not work if the service QName is too long Date: Mon, 26 May 2014 16:07:58 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/master cf0575568 -> 779cf32e4 [CXF-5766] - Caching nonces to disk may not work if the service QName is too long Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/779cf32e Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/779cf32e Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/779cf32e Branch: refs/heads/master Commit: 779cf32e40fbe53f9ef1726a973512a07925b681 Parents: cf05755 Author: Colm O hEigeartaigh Authored: Mon May 26 17:07:17 2014 +0100 Committer: Colm O hEigeartaigh Committed: Mon May 26 17:07:17 2014 +0100 ---------------------------------------------------------------------- .../org/apache/cxf/ws/security/wss4j/WSS4JUtils.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/779cf32e/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java index add1bb6..7ed5886 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java @@ -92,7 +92,12 @@ public final class WSS4JUtils { if (replayCache == null) { String cacheKey = instanceKey; if (info.getName() != null) { - cacheKey += "-" + info.getName().toString(); + int hashcode = info.getName().toString().hashCode(); + if (hashcode < 0) { + cacheKey += hashcode; + } else { + cacheKey += "-" + hashcode; + } } URL configFile = getConfigFileURL(message); @@ -159,7 +164,12 @@ public final class WSS4JUtils { if (cacheIdentifier != null) { cacheKey += "-" + cacheIdentifier; } else if (info.getName() != null) { - cacheKey += "-" + info.getName().toString(); + int hashcode = info.getName().toString().hashCode(); + if (hashcode < 0) { + cacheKey += hashcode; + } else { + cacheKey += "-" + hashcode; + } } tokenStore = tokenStoreFactory.newTokenStore(cacheKey, message); info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);