You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2015/04/07 11:09:21 UTC

svn commit: r1671764 - in /webservices/wss4j/branches/2_0_x-fixes: policy/src/main/java/org/apache/wss4j/policy/ policy/src/main/java/org/apache/wss4j/policy/model/ ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/

Author: coheigea
Date: Tue Apr  7 09:09:21 2015
New Revision: 1671764

URL: http://svn.apache.org/r1671764
Log:
[WSS-529] - Support Inclusive C14N via policy

Modified:
    webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/SPConstants.java
    webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java
    webservices/wss4j/branches/2_0_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/AlgorithmSuiteAssertionState.java

Modified: webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/SPConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/SPConstants.java?rev=1671764&r1=1671763&r2=1671764&view=diff
==============================================================================
--- webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/SPConstants.java (original)
+++ webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/SPConstants.java Tue Apr  7 09:09:21 2015
@@ -329,7 +329,7 @@ public abstract class SPConstants {
 
     public final static String XPATH20 = "http://www.w3.org/2002/06/xmldsig-filter2";
 
-    public final static String C14N = "http://www.w3.org/2001/10/xml-c14n#";
+    public final static String C14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
 
     public final static String C14N11 = "http://www.w3.org/2006/12/xml-c14n11";
 

Modified: webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java?rev=1671764&r1=1671763&r2=1671764&view=diff
==============================================================================
--- webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java (original)
+++ webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java Tue Apr  7 09:09:21 2015
@@ -472,9 +472,6 @@ public class AlgorithmSuite extends Abst
                 }
                 C14NType c14NType = C14NType.lookUp(assertionName);
                 if (c14NType != null) {
-                    if (algorithmSuite.getC14n() == C14NType.InclusiveC14N) {
-                        throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
-                    }
                     algorithmSuite.setC14n(c14NType);
                     continue;
                 }

Modified: webservices/wss4j/branches/2_0_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/AlgorithmSuiteAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/AlgorithmSuiteAssertionState.java?rev=1671764&r1=1671763&r2=1671764&view=diff
==============================================================================
--- webservices/wss4j/branches/2_0_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/AlgorithmSuiteAssertionState.java (original)
+++ webservices/wss4j/branches/2_0_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/AlgorithmSuiteAssertionState.java Tue Apr  7 09:09:21 2015
@@ -194,6 +194,7 @@ public class AlgorithmSuiteAssertionStat
         } else if (WSSConstants.SigTransform.equals(keyUsage)) {
             if (algorithmSuite.getC14n() != null
                 && !algorithmSuite.getC14n().getValue().equals(algorithmSuiteSecurityEvent.getAlgorithmURI())
+                && !WSSConstants.NS_C14N_EXCL.equals(algorithmSuiteSecurityEvent.getAlgorithmURI())
                 && !WSSConstants.SOAPMESSAGE_NS10_STRTransform.equals(algorithmSuiteSecurityEvent.getAlgorithmURI())
                 && !WSSConstants.SWA_ATTACHMENT_CONTENT_SIG_TRANS.equals(algorithmSuiteSecurityEvent.getAlgorithmURI())
                 && !WSSConstants.SWA_ATTACHMENT_COMPLETE_SIG_TRANS.equals(algorithmSuiteSecurityEvent.getAlgorithmURI())) {
@@ -228,6 +229,9 @@ public class AlgorithmSuiteAssertionStat
             String namespace = algorithmSuite.getAlgorithmSuiteType().getNamespace();
             String name = algorithmSuite.getAlgorithmSuiteType().getName();
             policyAsserter.assertPolicy(new QName(namespace, name));
+            if (algorithmSuite.getC14n() != null) {
+                policyAsserter.assertPolicy(new QName(namespace, algorithmSuite.getC14n().name()));
+            }
         }
         
         return isAsserted();