Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 74830 invoked from network); 28 Sep 2006 20:25:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Sep 2006 20:25:27 -0000 Received: (qmail 47585 invoked by uid 500); 28 Sep 2006 20:25:26 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 47487 invoked by uid 500); 28 Sep 2006 20:25:25 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 47476 invoked by uid 500); 28 Sep 2006 20:25:25 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 47473 invoked by uid 99); 28 Sep 2006 20:25:25 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Sep 2006 13:25:25 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 995AD1A9822; Thu, 28 Sep 2006 13:24:34 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r451018 - in /webservices/axis2/trunk/java/modules/security/src/org/apache/rampart: MessageBuilder.java builder/AsymmetricBindingBuilder.java util/Axis2Util.java util/RampartUtil.java Date: Thu, 28 Sep 2006 20:24:34 -0000 To: axis2-cvs@ws.apache.org From: ruchithf@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060928202434.995AD1A9822@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ruchithf Date: Thu Sep 28 13:24:33 2006 New Revision: 451018 URL: http://svn.apache.org/viewvc?view=rev&rev=451018 Log: - Setting the key encr algo properly in the asymm binding - Get rid of setting DOOM as the OM impl of the system Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/MessageBuilder.java webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/builder/AsymmetricBindingBuilder.java webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/Axis2Util.java webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/RampartUtil.java Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/MessageBuilder.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/MessageBuilder.java?view=diff&rev=451018&r1=451017&r2=451018 ============================================================================== --- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/MessageBuilder.java (original) +++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/MessageBuilder.java Thu Sep 28 13:24:33 2006 @@ -24,7 +24,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.rahas.RahasConstants; -import org.apache.rahas.TrustException; import org.apache.rahas.TrustUtil; import org.apache.rampart.builder.AsymmetricBindingBuilder; import org.apache.rampart.builder.SymmetricBindingBuilder; @@ -79,13 +78,14 @@ OMElement bodyElem = msgCtx.getEnvelope().getBody(); OMElement child = bodyElem.getFirstElement(); OMElement newChild = TrustUtil.createCancelRequest(tokenId, rmd.getWstVersion()); - Node importedNode = rmd.getDocument().importNode((Element) newChild, true); + Element newDomChild = Axis2Util.toDOM(newChild); + Node importedNode = rmd.getDocument().importNode((Element) newDomChild, true); ((Element) bodyElem).replaceChild(importedNode, (Element) child); } else { throw new RampartException("tokenToBeCancelledInvalid"); } - } catch (TrustException e) { + } catch (Exception e) { throw new RampartException("errorInTokenCancellation"); } } Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/builder/AsymmetricBindingBuilder.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/builder/AsymmetricBindingBuilder.java?view=diff&rev=451018&r1=451017&r2=451018 ============================================================================== --- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/builder/AsymmetricBindingBuilder.java (original) +++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/builder/AsymmetricBindingBuilder.java Thu Sep 28 13:24:33 2006 @@ -147,6 +147,7 @@ encr.setDocument(doc); RampartUtil.setEncryptionUser(rmd, encr); encr.setSymmetricEncAlgorithm(rpd.getAlgorithmSuite().getEncryption()); + encr.setKeyEncAlgo(rpd.getAlgorithmSuite().getAsymmetricKeyWrap()); encr.prepare(doc, RampartUtil.getEncryptionCrypto(config, rmd.getCustomClassLoader())); Element bstElem = encr.getBinarySecurityTokenElement(); @@ -378,6 +379,7 @@ encr.setDocument(doc); RampartUtil.setEncryptionUser(rmd, encr); encr.setSymmetricEncAlgorithm(rpd.getAlgorithmSuite().getEncryption()); + encr.setKeyEncAlgo(rpd.getAlgorithmSuite().getAsymmetricKeyWrap()); encr.prepare(doc, RampartUtil.getEncryptionCrypto(rpd .getRampartConfig(), rmd.getCustomClassLoader())); Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/Axis2Util.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/Axis2Util.java?view=diff&rev=451018&r1=451017&r2=451018 ============================================================================== --- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/Axis2Util.java (original) +++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/Axis2Util.java Thu Sep 28 13:24:33 2006 @@ -16,21 +16,17 @@ package org.apache.rampart.util; -import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axiom.om.OMNode; import org.apache.axiom.om.impl.builder.StAXOMBuilder; import org.apache.axiom.om.impl.dom.DOOMAbstractFactory; -import org.apache.axiom.om.impl.dom.factory.OMDOMFactory; import org.apache.axiom.om.util.StAXUtils; import org.apache.axiom.soap.SOAP11Constants; import org.apache.axiom.soap.SOAP12Constants; import org.apache.axiom.soap.SOAPEnvelope; import org.apache.axiom.soap.SOAPFactory; import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder; -import org.apache.axiom.soap.impl.dom.soap11.SOAP11Factory; -import org.apache.axiom.soap.impl.dom.soap12.SOAP12Factory; import org.apache.rampart.handler.WSSHandlerConstants; import org.apache.ws.security.WSSecurityException; import org.apache.xml.security.utils.XMLUtils; @@ -40,6 +36,7 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.stream.FactoryConfigurationError; import javax.xml.stream.XMLStreamReader; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -56,19 +53,20 @@ } public static void useDOOM(boolean isDOOMRequired) { - if(isDOOMRequired) { - if(!isUseDOOM()) { - System.setProperty(OMAbstractFactory.SOAP11_FACTORY_NAME_PROPERTY, SOAP11Factory.class.getName()); - System.setProperty(OMAbstractFactory.SOAP12_FACTORY_NAME_PROPERTY, SOAP12Factory.class.getName()); - System.setProperty(OMAbstractFactory.OM_FACTORY_NAME_PROPERTY, OMDOMFactory.class.getName()); - doomTacker.set(new Object()); - } - } else { - System.getProperties().remove(OMAbstractFactory.SOAP11_FACTORY_NAME_PROPERTY); - System.getProperties().remove(OMAbstractFactory.SOAP12_FACTORY_NAME_PROPERTY); - System.getProperties().remove(OMAbstractFactory.OM_FACTORY_NAME_PROPERTY); - doomTacker.set(null); - } +//TODO Enable this when we have DOOM fixed to be able to flow in and out of Axis2 +// if(isDOOMRequired) { +// if(!isUseDOOM()) { +// System.setProperty(OMAbstractFactory.SOAP11_FACTORY_NAME_PROPERTY, SOAP11Factory.class.getName()); +// System.setProperty(OMAbstractFactory.SOAP12_FACTORY_NAME_PROPERTY, SOAP12Factory.class.getName()); +// System.setProperty(OMAbstractFactory.OM_FACTORY_NAME_PROPERTY, OMDOMFactory.class.getName()); +// doomTacker.set(new Object()); +// } +// } else { +// System.getProperties().remove(OMAbstractFactory.SOAP11_FACTORY_NAME_PROPERTY); +// System.getProperties().remove(OMAbstractFactory.SOAP12_FACTORY_NAME_PROPERTY); +// System.getProperties().remove(OMAbstractFactory.OM_FACTORY_NAME_PROPERTY); +// doomTacker.set(null); +// } } Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/RampartUtil.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/RampartUtil.java?view=diff&rev=451018&r1=451017&r2=451018 ============================================================================== --- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/RampartUtil.java (original) +++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/RampartUtil.java Thu Sep 28 13:24:33 2006 @@ -419,8 +419,7 @@ // Set request action client.setAction(action); - OMElement tmpl = Axis2Util.toOM((Element)rstTemplate); - client.setRstTemplate(tmpl); + client.setRstTemplate(rstTemplate); // Set crypto information Crypto crypto = RampartUtil.getSignatureCrypto(rmd.getPolicyData().getRampartConfig(), --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org