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 313C0E165 for ; Tue, 12 Feb 2013 15:44:05 +0000 (UTC) Received: (qmail 449 invoked by uid 500); 12 Feb 2013 15:44:05 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 394 invoked by uid 500); 12 Feb 2013 15:44:05 -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 386 invoked by uid 99); 12 Feb 2013 15:44:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 15:44:05 +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; Tue, 12 Feb 2013 15:44:03 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0591B23889B3; Tue, 12 Feb 2013 15:43:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1445206 - /cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java Date: Tue, 12 Feb 2013 15:43:44 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130212154345.0591B23889B3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: coheigea Date: Tue Feb 12 15:43:44 2013 New Revision: 1445206 URL: http://svn.apache.org/r1445206 Log: Merged revisions 1445204 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1445204 | coheigea | 2013-02-12 15:40:57 +0000 (Tue, 12 Feb 2013) | 2 lines Throw an exception if there is an error trying to load a Crypto properties file ........ Modified: cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java Modified: cxf/branches/2.7.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.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java?rev=1445206&r1=1445205&r2=1445206&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java (original) +++ cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java Tue Feb 12 15:43:44 2013 @@ -371,13 +371,16 @@ public class PolicyBasedWSS4JInIntercept } else if (e != null) { URL propsURL = getPropertiesFileURL(e, message); 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); - } + if (props == null) { + LOG.fine("Cannot find Crypto Encryption properties: " + e); + throw new WSSecurityException("Cannot find Crypto Encryption properties: " + e); + } + + encrCrypto = CryptoFactory.getInstance(props); + + EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo(); + synchronized (info) { + info.setProperty(SecurityConstants.ENCRYPT_CRYPTO, encrCrypto); } } return encrCrypto; @@ -390,13 +393,16 @@ public class PolicyBasedWSS4JInIntercept } else if (s != null) { URL propsURL = getPropertiesFileURL(s, message); 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); - } + if (props == null) { + LOG.fine("Cannot find Crypto Signature properties: " + s); + throw new WSSecurityException("Cannot find Crypto Signature properties: " + s); + } + + signCrypto = CryptoFactory.getInstance(props); + + EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo(); + synchronized (info) { + info.setProperty(SecurityConstants.SIGNATURE_CRYPTO, signCrypto); } } return signCrypto;