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 E1B7AE132 for ; Mon, 11 Feb 2013 17:10:57 +0000 (UTC) Received: (qmail 89408 invoked by uid 500); 11 Feb 2013 17:10:57 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 89360 invoked by uid 500); 11 Feb 2013 17:10:57 -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 89353 invoked by uid 99); 11 Feb 2013 17:10:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2013 17:10:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2013 17:10:55 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 25CAE2388978; Mon, 11 Feb 2013 17:10:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1444874 - /cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java Date: Mon, 11 Feb 2013 17:10:35 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130211171035.25CAE2388978@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: coheigea Date: Mon Feb 11 17:10:34 2013 New Revision: 1444874 URL: http://svn.apache.org/r1444874 Log: Merged revisions 1444865 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes ........ r1444865 | coheigea | 2013-02-11 17:01:42 +0000 (Mon, 11 Feb 2013) | 10 lines Merged revisions 1444862 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1444862 | coheigea | 2013-02-11 16:58:05 +0000 (Mon, 11 Feb 2013) | 2 lines Simplifying Crypto configuration ........ ........ Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java?rev=1444874&r1=1444873&r2=1444874&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java Mon Feb 11 17:10:34 2013 @@ -118,7 +118,7 @@ public class PolicyBasedWSS4JInIntercept super(true); } - private static Properties getProps(Object o, String propsKey, URL propsURL, SoapMessage message) { + private static Properties getProps(Object o, URL propsURL, SoapMessage message) { Properties properties = null; if (o instanceof Properties) { properties = (Properties)o; @@ -370,16 +370,14 @@ public class PolicyBasedWSS4JInIntercept encrCrypto = (Crypto)e; } else if (e != null) { URL propsURL = getPropertiesFileURL(e, message); - String propsKey = e.toString(); - if (propsURL != null) { - propsKey = propsURL.getPath(); - } - Properties props = getProps(e, propsKey, propsURL, message); - encrCrypto = CryptoFactory.getInstance(props); - - EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo(); - synchronized (info) { - info.setProperty(SecurityConstants.ENCRYPT_CRYPTO, encrCrypto); + Properties props = getProps(e, propsURL, message); + if (props != null) { + encrCrypto = CryptoFactory.getInstance(props); + + EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo(); + synchronized (info) { + info.setProperty(SecurityConstants.ENCRYPT_CRYPTO, encrCrypto); + } } } return encrCrypto; @@ -391,16 +389,14 @@ public class PolicyBasedWSS4JInIntercept signCrypto = (Crypto)s; } else if (s != null) { URL propsURL = getPropertiesFileURL(s, message); - String propsKey = s.toString(); - if (propsURL != null) { - propsKey = propsURL.getPath(); - } - Properties props = getProps(s, propsKey, propsURL, message); - signCrypto = CryptoFactory.getInstance(props); - - EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo(); - synchronized (info) { - info.setProperty(SecurityConstants.SIGNATURE_CRYPTO, signCrypto); + Properties props = getProps(s, propsURL, message); + if (props != null) { + signCrypto = CryptoFactory.getInstance(props); + + EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo(); + synchronized (info) { + info.setProperty(SecurityConstants.SIGNATURE_CRYPTO, signCrypto); + } } } return signCrypto;