Author: coheigea
Date: Wed Aug 29 15:00:21 2018
New Revision: 1839586
URL: http://svn.apache.org/viewvc?rev=1839586&view=rev
Log:
Updating to Santuario 2.2.0-SNAPSHOT
Modified:
webservices/wss4j/trunk/parent/pom.xml
webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
Modified: webservices/wss4j/trunk/parent/pom.xml
URL:
http://svn.apache.org/viewvc/webservices/wss4j/trunk/parent/pom.xml?rev=1839586&r1=1839585&r2=1839586&view=diff
==============================================================================
--- webservices/wss4j/trunk/parent/pom.xml (original)
+++ webservices/wss4j/trunk/parent/pom.xml Wed Aug 29 15:00:21 2018
@@ -48,7 +48,7 @@
<wsdl4j.version>1.6.3</wsdl4j.version>
<xalan.version>2.7.2</xalan.version>
<xz.version>1.8</xz.version>
- <xmlsec.version>2.1.2</xmlsec.version>
+ <xmlsec.version>2.2.0-SNAPSHOT</xmlsec.version>
<xmlunit.version>1.6</xmlunit.version>
<!-- OSGi related properties -->
Modified:
webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java?rev=1839586&r1=1839585&r2=1839586&view=diff
==============================================================================
---
webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
(original)
+++
webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
Wed Aug 29 15:00:21 2018
@@ -47,7 +47,6 @@ 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;
@@ -390,19 +389,18 @@ 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 = db.parse(new ByteArrayInputStream(bytes));
+ document = org.apache.xml.security.utils.XMLUtils.read(new
ByteArrayInputStream(bytes), false);
} 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 = db.parse(new
ByteArrayInputStream(fixedElementStr.getBytes()));
+ document = org.apache.xml.security.utils.XMLUtils.read(
+ new ByteArrayInputStream(fixedElementStr.getBytes()),
false);
} else {
throw ex;
}
@@ -411,7 +409,6 @@ 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/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java?rev=1839586&r1=1839585&r2=1839586&view=diff
==============================================================================
---
webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
(original)
+++
webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
Wed Aug 29 15:00:21 2018
@@ -32,7 +32,6 @@ 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;
@@ -410,9 +409,7 @@ public class SAMLTokenInputHandler exten
throws XMLSecurityException {
Document document = null;
try {
- DocumentBuilder db = XMLUtils.createDocumentBuilder(false);
- document = db.newDocument();
- XMLUtils.repoolDocumentBuilder(db);
+ document = XMLUtils.newDocument();
} catch (ParserConfigurationException e) {
throw new
WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, e);
}
Modified:
webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java?rev=1839586&r1=1839585&r2=1839586&view=diff
==============================================================================
---
webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
(original)
+++
webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
Wed Aug 29 15:00:21 2018
@@ -28,7 +28,6 @@ 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;
@@ -442,9 +441,7 @@ public class SAMLTokenOutputProcessor ex
OutputProcessorUtils.updateSecurityHeaderOrder(outputProcessorChain,
headerElementName, getAction(), false);
try {
- DocumentBuilder db = XMLUtils.createDocumentBuilder(false);
-
outputDOMElement(samlAssertionWrapper.toDOM(db.newDocument()),
subOutputProcessorChain);
- XMLUtils.repoolDocumentBuilder(db);
+
outputDOMElement(samlAssertionWrapper.toDOM(XMLUtils.newDocument()),
subOutputProcessorChain);
} catch (ParserConfigurationException ex) {
LOG.debug("Error writing out SAML Assertion", ex);
throw new XMLSecurityException(ex);