axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
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 GMT
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


Mime
View raw message