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 9F26D98D8 for ; Fri, 2 Mar 2012 10:41:54 +0000 (UTC) Received: (qmail 68585 invoked by uid 500); 2 Mar 2012 10:41:54 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 68545 invoked by uid 500); 2 Mar 2012 10:41:54 -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 68536 invoked by uid 99); 2 Mar 2012 10:41:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2012 10:41:54 +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; Fri, 02 Mar 2012 10:41:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 502DC23888E4; Fri, 2 Mar 2012 10:41:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1296122 - /cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java Date: Fri, 02 Mar 2012 10:41:31 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120302104131.502DC23888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: coheigea Date: Fri Mar 2 10:41:30 2012 New Revision: 1296122 URL: http://svn.apache.org/viewvc?rev=1296122&view=rev Log: [CXF-4049] - Check external CryptoProvider from message context properties in Wss4jInInterceptor - Patch applied, thanks. - I made some changes as per my comments in the JIRA. Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java?rev=1296122&r1=1296121&r2=1296122&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java (original) +++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java Fri Mar 2 10:41:30 2012 @@ -68,6 +68,7 @@ import org.apache.ws.security.WSSConfig; import org.apache.ws.security.WSSecurityEngine; import org.apache.ws.security.WSSecurityEngineResult; import org.apache.ws.security.WSSecurityException; +import org.apache.ws.security.components.crypto.Crypto; import org.apache.ws.security.handler.RequestData; import org.apache.ws.security.handler.WSHandlerConstants; import org.apache.ws.security.handler.WSHandlerResult; @@ -376,7 +377,19 @@ public class WSS4JInInterceptor extends * @param reqData */ protected void computeAction(SoapMessage msg, RequestData reqData) { - + // + // Try to get Crypto Provider from message context properties. + // It gives a possibility to use external Crypto Provider + // + Crypto encCrypto = (Crypto)msg.getContextualProperty(SecurityConstants.ENCRYPT_CRYPTO); + if (encCrypto != null) { + reqData.setEncCrypto(encCrypto); + reqData.setDecCrypto(encCrypto); + } + Crypto sigCrypto = (Crypto)msg.getContextualProperty(SecurityConstants.SIGNATURE_CRYPTO); + if (sigCrypto != null) { + reqData.setSigCrypto(sigCrypto); + } } protected void doResults( @@ -657,7 +670,6 @@ public class WSS4JInInterceptor extends return fault; } - static class CXFRequestData extends RequestData { public CXFRequestData() { }