Repository: cxf Updated Branches: refs/heads/master 7c3e2c4f6 -> cc674df55
Modifying last commit Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cc674df5 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cc674df5 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cc674df5 Branch: refs/heads/master Commit: cc674df55d596c8774d732ff537e490a159abfe5 Parents: 7c3e2c4 Author: Colm O hEigeartaigh <[email protected]> Authored: Mon Apr 28 22:13:29 2014 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Mon Apr 28 22:13:29 2014 +0100 ---------------------------------------------------------------------- .../apache/cxf/rs/security/xml/EncryptionProperties.java | 2 +- .../apache/cxf/rs/security/xml/XmlSecOutInterceptor.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/cc674df5/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/EncryptionProperties.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/EncryptionProperties.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/EncryptionProperties.java index 02828d3..06d3e11 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/EncryptionProperties.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/EncryptionProperties.java @@ -22,7 +22,7 @@ import org.apache.xml.security.encryption.XMLCipher; public class EncryptionProperties { private String encryptionKeyTransportAlgo = XMLCipher.RSA_OAEP; - private String encryptionSymmetricKeyAlgo = XMLCipher.AES_256; + private String encryptionSymmetricKeyAlgo; private String encryptionDigestAlgo; private String encryptionKeyIdType; http://git-wip-us.apache.org/repos/asf/cxf/blob/cc674df5/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java index 84e3d3b..16ac06f 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java @@ -54,6 +54,7 @@ import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.dom.WSConstants; import org.apache.xml.security.Init; import org.apache.xml.security.algorithms.JCEMapper; +import org.apache.xml.security.encryption.XMLCipher; import org.apache.xml.security.exceptions.XMLSecurityException; import org.apache.xml.security.stax.ext.OutboundXMLSec; import org.apache.xml.security.stax.ext.SecurePart; @@ -153,10 +154,10 @@ public class XmlSecOutInterceptor extends AbstractPhaseInterceptor<Message> { private void configureEncryption(Message message, XMLSecurityProperties properties) throws Exception { - properties.setEncryptionSymAlgorithm( - encryptionProperties.getEncryptionSymmetricKeyAlgo()); - properties.setEncryptionKey( - getSymmetricKey(encryptionProperties.getEncryptionSymmetricKeyAlgo())); + String symEncAlgo = encryptionProperties.getEncryptionSymmetricKeyAlgo() == null + ? XMLCipher.AES_256 : encryptionProperties.getEncryptionSymmetricKeyAlgo(); + properties.setEncryptionSymAlgorithm(symEncAlgo); + properties.setEncryptionKey(getSymmetricKey(symEncAlgo)); if (encryptSymmetricKey) { X509Certificate sendingCert = null; String userName =
