ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1833037 - in /webservices/wss4j/branches/2_1_x-fixes: parent/ ws-security-dom/src/main/java/org/apache/wss4j/dom/util/ ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/ ws-security-stax/src/main/java/org/apache/wss...
Date Wed, 06 Jun 2018 15:09:25 GMT
Author: coheigea
Date: Wed Jun  6 15:09:25 2018
New Revision: 1833037

URL: http://svn.apache.org/viewvc?rev=1833037&view=rev
Log:
Revert "Some fixes following from latest Santuario changes"

This reverts commit 4fb24f77af4ad751421ee64a4e266aa138b8e8e5.

Modified:
    webservices/wss4j/branches/2_1_x-fixes/parent/pom.xml
    webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
    webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
    webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java

Modified: webservices/wss4j/branches/2_1_x-fixes/parent/pom.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/parent/pom.xml?rev=1833037&r1=1833036&r2=1833037&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/parent/pom.xml (original)
+++ webservices/wss4j/branches/2_1_x-fixes/parent/pom.xml Wed Jun  6 15:09:25 2018
@@ -46,7 +46,7 @@
         <woodstox.core.version>5.0.3</woodstox.core.version>
         <wsdl4j.version>1.6.3</wsdl4j.version>
         <xalan.version>2.7.2</xalan.version>
-        <xmlsec.version>2.0.11-SNAPSHOT</xmlsec.version>
+        <xmlsec.version>2.0.10</xmlsec.version>
         <xmlunit.version>1.6</xmlunit.version>
         
         <!-- OSGi related properties -->

Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java?rev=1833037&r1=1833036&r2=1833037&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
(original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
Wed Jun  6 15:09:25 2018
@@ -49,6 +49,7 @@ import javax.crypto.SecretKey;
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.ParserConfigurationException;
 
 import java.io.ByteArrayInputStream;
@@ -391,18 +392,19 @@ public final class EncryptionUtils {
         
         // For the xop:Include case, we need to replace the xop:Include Element with the
         // decrypted Element
+        DocumentBuilder db =
+                org.apache.xml.security.utils.XMLUtils.createDocumentBuilder(false);
         byte[] bytes = JavaUtils.getBytesFromStream(attachmentInputStream);
 
         Document document = null;
         try {
-            document = org.apache.xml.security.utils.XMLUtils.parse(new ByteArrayInputStream(bytes),
false);
+            document = db.parse(new ByteArrayInputStream(bytes));
         } catch (SAXException ex) {
             // See if a prefix was not bound. Try to fix the DOM Element in this case.
             if (ex.getMessage() != null && ex.getMessage().startsWith("The prefix")
                 && ex.getMessage().endsWith("is not bound.")) {
                 String fixedElementStr = setParentPrefixes(encData, new String(bytes));
-                document = org.apache.xml.security.utils.XMLUtils.parse(new ByteArrayInputStream(fixedElementStr.getBytes()),
-                                                                        false);
+                document = db.parse(new ByteArrayInputStream(fixedElementStr.getBytes()));
             } else {
                 throw ex;
             }
@@ -411,6 +413,7 @@ public final class EncryptionUtils {
         Node decryptedNode =
             encData.getOwnerDocument().importNode(document.getDocumentElement(), true);
         encData.getParentNode().appendChild(decryptedNode);
+        org.apache.xml.security.utils.XMLUtils.repoolDocumentBuilder(db);
         encData.getParentNode().removeChild(encData);
         return decryptedNode;
     }

Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java?rev=1833037&r1=1833036&r2=1833037&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
(original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
Wed Jun  6 15:09:25 2018
@@ -32,6 +32,7 @@ import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
@@ -445,7 +446,9 @@ public class SAMLTokenInputHandler exten
             throws XMLSecurityException {
         Document document = null;
         try {
-            document = XMLUtils.newDocument(false);
+            DocumentBuilder db = XMLUtils.createDocumentBuilder(false);
+            document = db.newDocument();
+            XMLUtils.repoolDocumentBuilder(db);
         } catch (ParserConfigurationException e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
e);
         }

Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java?rev=1833037&r1=1833036&r2=1833037&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
(original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
Wed Jun  6 15:09:25 2018
@@ -28,6 +28,7 @@ import java.util.List;
 
 import javax.crypto.spec.SecretKeySpec;
 import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.stream.XMLStreamException;
 
@@ -62,7 +63,6 @@ import org.apache.xml.security.stax.secu
 import org.apache.xml.security.stax.securityToken.SecurityTokenProvider;
 import org.apache.xml.security.utils.XMLUtils;
 import org.opensaml.saml.common.SAMLVersion;
-import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 public class SAMLTokenOutputProcessor extends AbstractOutputProcessor {
@@ -442,8 +442,9 @@ public class SAMLTokenOutputProcessor ex
                 OutputProcessorUtils.updateSecurityHeaderOrder(outputProcessorChain, headerElementName,
getAction(), false);
 
                 try {
-                    Document doc = XMLUtils.newDocument(false);
-                    outputDOMElement(samlAssertionWrapper.toDOM(doc), subOutputProcessorChain);
+                    DocumentBuilder db = XMLUtils.createDocumentBuilder(false);
+                    outputDOMElement(samlAssertionWrapper.toDOM(db.newDocument()), subOutputProcessorChain);
+                    XMLUtils.repoolDocumentBuilder(db);
                 } catch (ParserConfigurationException ex) {
                     LOG.debug("Error writing out SAML Assertion", ex);
                     throw new XMLSecurityException(ex);



Mime
View raw message