You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2017/12/04 16:47:59 UTC

[cxf] branch master updated: CXF-7578 - Set the signature algorithm properly for the TransportBinding IssuedToken case (StAX)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 60975c7  CXF-7578 - Set the signature algorithm properly for the TransportBinding IssuedToken case (StAX)
60975c7 is described below

commit 60975c7b39497ff6b911735732ffb4baa285581b
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Mon Dec 4 16:46:10 2017 +0000

    CXF-7578 - Set the signature algorithm properly for the TransportBinding IssuedToken case (StAX)
---
 .../wss4j/policyhandlers/StaxTransportBindingHandler.java      | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
index 5ea70ad..3f9dcf5 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
@@ -312,6 +312,16 @@ public class StaxTransportBindingHandler extends AbstractStaxBindingHandler {
             SecurityToken securityToken = getSecurityToken();
             addIssuedToken(token, securityToken, false, true);
             signPartsAndElements(wrapper.getSignedParts(), wrapper.getSignedElements());
+
+            WSSSecurityProperties properties = getProperties();
+            if (securityToken != null && securityToken.getSecret() != null) {
+                properties.setSignatureAlgorithm(tbinding.getAlgorithmSuite().getSymmetricSignature());
+            } else {
+                properties.setSignatureAlgorithm(tbinding.getAlgorithmSuite().getAsymmetricSignature());
+            }
+            properties.setSignatureCanonicalizationAlgorithm(tbinding.getAlgorithmSuite().getC14n().getValue());
+            AlgorithmSuiteType algType = tbinding.getAlgorithmSuite().getAlgorithmSuiteType();
+            properties.setSignatureDigestAlgorithm(algType.getDigest());
         } else if (token instanceof SecureConversationToken
             || token instanceof SecurityContextToken || token instanceof SpnegoContextToken) {
             SecurityToken securityToken = getSecurityToken();

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <co...@cxf.apache.org>'].