ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1626783 - /webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java
Date Mon, 22 Sep 2014 14:10:52 GMT
Author: coheigea
Date: Mon Sep 22 14:10:52 2014
New Revision: 1626783

URL: http://svn.apache.org/r1626783
Log:
Fixing bug wrt AlgorithmSuite namespace

Modified:
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java?rev=1626783&r1=1626782&r2=1626783&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java
(original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java
Mon Sep 22 14:10:52 2014
@@ -216,6 +216,22 @@ public class AlgorithmSuite extends Abst
             this.maximumAsymmetricKeyLength = maximumAsymmetricKeyLength;
         }
         
+        public AlgorithmSuiteType(AlgorithmSuiteType algorithmSuiteType) {
+            this.name = algorithmSuiteType.name;
+            this.digest = algorithmSuiteType.digest;
+            this.encryption = algorithmSuiteType.encryption;
+            this.symmetricKeyWrap = algorithmSuiteType.symmetricKeyWrap;
+            this.asymmetricKeyWrap = algorithmSuiteType.asymmetricKeyWrap;
+            this.encryptionKeyDerivation = algorithmSuiteType.encryptionKeyDerivation;
+            this.signatureKeyDerivation = algorithmSuiteType.signatureKeyDerivation;
+            this.encryptionDerivedKeyLength = algorithmSuiteType.encryptionDerivedKeyLength;
+            this.signatureDerivedKeyLength = algorithmSuiteType.signatureDerivedKeyLength;
+            this.minimumSymmetricKeyLength = algorithmSuiteType.minimumSymmetricKeyLength;
+            this.maximumSymmetricKeyLength = algorithmSuiteType.maximumSymmetricKeyLength;
+            this.minimumAsymmetricKeyLength = algorithmSuiteType.minimumAsymmetricKeyLength;
+            this.maximumAsymmetricKeyLength = algorithmSuiteType.maximumAsymmetricKeyLength;
+        }
+        
         public String getName() {
             return name;
         }
@@ -447,8 +463,11 @@ public class AlgorithmSuite extends Abst
                     if (algorithmSuite.getAlgorithmSuiteType() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
-                    algorithmSuiteType.setNamespace(getVersion().getNamespace());
-                    algorithmSuite.setAlgorithmSuiteType(algorithmSuiteType);
+                    
+                    // Clone so as not to change the namespace for other AlgorithmSuiteTypes...
+                    AlgorithmSuiteType newAlgorithmSuiteType = new AlgorithmSuiteType(algorithmSuiteType);
+                    newAlgorithmSuiteType.setNamespace(getVersion().getNamespace());
+                    algorithmSuite.setAlgorithmSuiteType(newAlgorithmSuiteType);
                     continue;
                 }
                 C14NType c14NType = C14NType.lookUp(assertionName);



Mime
View raw message