Author: alessio.soldano(a)jboss.com
Date: 2013-01-10 06:09:48 -0500 (Thu, 10 Jan 2013)
New Revision: 17228
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import/macros-deploy-native.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/Constants.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/STRTransform.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/samples/wssecurity/simple-encrypt/META-INF/jboss-wsse-client.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/samples/wssecurity/simple-encrypt/WEB-INF/jboss-wsse-server.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties
Log:
[JBPAPP-7601] Move to Santuario 1.5.2 and add GCM algorithm support
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import/macros-deploy-native.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import/macros-deploy-native.xml 2013-01-10
06:59:53 UTC (rev 17227)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import/macros-deploy-native.xml 2013-01-10
11:09:48 UTC (rev 17228)
@@ -143,6 +143,7 @@
<include name="policy.jar"/>
<include name="stax-ex.jar"/>
<include name="streambuffer.jar"/>
+ <include name="xmlsec.jar"/>
<include name="wsdl4j.jar"/>
</fileset>
</copy>
@@ -182,6 +183,7 @@
<include name="policy.jar"/>
<include name="stax-ex.jar"/>
<include name="streambuffer.jar"/>
+ <include name="xmlsec.jar"/>
<include name="wsdl4j.jar"/>
<!-- Remove only, do not deploy -->
<include name="jbossws-wsconsume-impl.jar"/>
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/Constants.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/Constants.java 2013-01-10
06:59:53 UTC (rev 17227)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/Constants.java 2013-01-10
11:09:48 UTC (rev 17228)
@@ -51,7 +51,7 @@
public static final String XML_ENCRYPTION_NS = EncryptionConstants.EncryptionSpecNS;
- public static final String XML_ENCRYPTION_PREFIX = "xenc";
+ public static final String XML_ENCRYPTION_PREFIX = "ds"; //xmlsec 1.4.2
requires this to be "ds" to correctly create KeyInfo elements
public static final String ID = "Id";
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2013-01-10
06:59:53 UTC (rev 17227)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/EncryptionOperation.java 2013-01-10
11:09:48 UTC (rev 17228)
@@ -71,6 +71,9 @@
algorithms.put("aes-128", new Algorithm("AES",
XMLCipher.AES_128, 128));
algorithms.put("aes-192", new Algorithm("AES",
XMLCipher.AES_192, 192));
algorithms.put("aes-256", new Algorithm("AES",
XMLCipher.AES_256, 256));
+ algorithms.put("aes-128-gcm", new Algorithm("AES",
XMLCipher.AES_128_GCM, 128));
+ algorithms.put("aes-192-gcm", new Algorithm("AES",
XMLCipher.AES_192_GCM, 192));
+ algorithms.put("aes-256-gcm", new Algorithm("AES",
XMLCipher.AES_256_GCM, 256));
algorithms.put("tripledes", new Algorithm("TripleDes",
XMLCipher.TRIPLEDES, 168));
}
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/STRTransform.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/STRTransform.java 2013-01-10
06:59:53 UTC (rev 17227)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/STRTransform.java 2013-01-10
11:09:48 UTC (rev 17228)
@@ -22,6 +22,7 @@
package org.jboss.ws.extensions.security;
import java.io.IOException;
+import java.io.OutputStream;
import javax.xml.parsers.ParserConfigurationException;
@@ -91,7 +92,14 @@
@Override
- protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input) throws
IOException, CanonicalizationException,
+ protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input, Transform
transformObject) throws IOException, CanonicalizationException,
+ InvalidCanonicalizerException, TransformationException,
ParserConfigurationException, SAXException
+ {
+ return enginePerformTransform(input, null, transformObject);
+ }
+
+ @Override
+ protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input,
OutputStream os, Transform transformObject) throws IOException,
CanonicalizationException,
InvalidCanonicalizerException, TransformationException,
ParserConfigurationException, SAXException
{
@@ -115,7 +123,7 @@
element = token.getSTRTransformElement();
// Obtain the canonicalizer specified in the transformation parameters
- Element parameters =
XMLUtils.selectNode(this._transformObject.getElement().getFirstChild(),
Constants.WSSE_NS,
+ Element parameters =
XMLUtils.selectNode(transformObject.getElement().getFirstChild(), Constants.WSSE_NS,
"TransformationParameters", 0);
if (parameters == null)
throw new TransformationException("wsse:TransformationParameters
expected!");
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java 2013-01-10
06:59:53 UTC (rev 17227)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/element/EncryptedKey.java 2013-01-10
11:09:48 UTC (rev 17228)
@@ -75,6 +75,7 @@
try
{
cipher = XMLCipher.getInstance();
+ cipher.init(XMLCipher.DECRYPT_MODE, null);
key = cipher.loadEncryptedKey(element);
}
catch (XMLSecurityException e)
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java 2013-01-10
06:59:53 UTC (rev 17227)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/extensions/security/element/SecurityHeader.java 2013-01-10
11:09:48 UTC (rev 17228)
@@ -172,6 +172,7 @@
Element element = document.createElementNS(Constants.WSSE_NS,
Constants.WSSE_HEADER);
Util.addNamespace(element, Constants.WSSE_PREFIX, Constants.WSSE_NS);
Util.addNamespace(element, Constants.WSU_PREFIX, Constants.WSU_NS);
+ Util.addNamespace(element, Constants.XML_ENCRYPTION_PREFIX,
Constants.XML_SIGNATURE_NS);
if (timestamp != null)
element.appendChild(timestamp.getElement());
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/samples/wssecurity/simple-encrypt/META-INF/jboss-wsse-client.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/samples/wssecurity/simple-encrypt/META-INF/jboss-wsse-client.xml 2013-01-10
06:59:53 UTC (rev 17227)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/samples/wssecurity/simple-encrypt/META-INF/jboss-wsse-client.xml 2013-01-10
11:09:48 UTC (rev 17228)
@@ -3,7 +3,7 @@
<jboss-ws-security
xmlns="http://www.jboss.com/ws-security/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
<config>
- <encrypt type="x509v3" alias="wsse"/>
+ <encrypt type="x509v3" algorithm="aes-128-gcm"
alias="wsse"/>
<requires>
<encryption/>
</requires>
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/samples/wssecurity/simple-encrypt/WEB-INF/jboss-wsse-server.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/samples/wssecurity/simple-encrypt/WEB-INF/jboss-wsse-server.xml 2013-01-10
06:59:53 UTC (rev 17227)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/samples/wssecurity/simple-encrypt/WEB-INF/jboss-wsse-server.xml 2013-01-10
11:09:48 UTC (rev 17228)
@@ -7,7 +7,7 @@
<trust-store-file>WEB-INF/wsse.truststore</trust-store-file>
<trust-store-password>jbossws</trust-store-password>
<config>
- <encrypt type="x509v3" alias="wsse"/>
+ <encrypt type="x509v3" algorithm="aes-128-gcm"
alias="wsse"/>
<requires>
<encryption/>
</requires>
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties 2013-01-10
06:59:53 UTC (rev 17227)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties 2013-01-10
11:09:48 UTC (rev 17228)
@@ -15,7 +15,7 @@
implementation.vendor.id=http://www.jboss.org
# Thirdparty library versions that are referenced in component-info.xml
-apache-xmlsec=1.3.0
+apache-xmlsec=1.5.2
ibm-wsdl4j=1.6.2
jbpm-bpel=1.1.0.Beta5
stax-api=1.0