ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1660429 - in /webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom: message/token/ processor/ saml/
Date Tue, 17 Feb 2015 15:57:29 GMT
Author: coheigea
Date: Tue Feb 17 15:57:28 2015
New Revision: 1660429

URL: http://svn.apache.org/r1660429
Log:
Some changes to supplying parameters to the STRParsers

Modified:
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Timestamp.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedDataProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Timestamp.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Timestamp.java?rev=1660429&r1=1660428&r2=1660429&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Timestamp.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Timestamp.java
Tue Feb 17 15:57:28 2015
@@ -53,7 +53,7 @@ import org.w3c.dom.Text;
 public class Timestamp {
     
     private Element element;
-    private List<Element> customElements;
+    private List<Element> customElements = new ArrayList<>();
     private Date createdDate;
     private Date expiresDate;
     
@@ -68,7 +68,6 @@ public class Timestamp {
     public Timestamp(Element timestampElement, BSPEnforcer bspEnforcer) throws WSSecurityException
{
 
         element = timestampElement;
-        customElements = new ArrayList<>();
 
         String strCreated = null;
         String strExpires = null;
@@ -188,7 +187,6 @@ public class Timestamp {
      */
     public Timestamp(boolean milliseconds, Document doc, WSTimeSource timeSource, int ttl)
{
 
-        customElements = new ArrayList<>();
         element = 
             doc.createElementNS(
                 WSConstants.WSU_NS, WSConstants.WSU_PREFIX + ":" + WSConstants.TIMESTAMP_TOKEN_LN

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java?rev=1660429&r1=1660428&r2=1660429&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java
Tue Feb 17 15:57:28 2015
@@ -19,7 +19,9 @@
 
 package org.apache.wss4j.dom.processor;
 
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 import org.w3c.dom.Element;
 import org.apache.wss4j.dom.WSConstants;
@@ -60,8 +62,9 @@ public class DerivedKeyTokenProcessor im
         Element secRefElement = dkt.getSecurityTokenReferenceElement();
         if (secRefElement != null) {
             STRParser strParser = new DerivedKeyTokenSTRParser();
+            Map<String, Object> parameters = Collections.emptyMap();
             strParser.parseSecurityTokenReference(
-                secRefElement, data, wsDocInfo, null
+                secRefElement, data, wsDocInfo, parameters
             );
             secret = strParser.getSecretKey();
         } else {
@@ -85,7 +88,7 @@ public class DerivedKeyTokenProcessor im
         result.put(WSSecurityEngineResult.TAG_SECRET, secret);
         result.put(WSSecurityEngineResult.TAG_TOKEN_ELEMENT, dkt.getElement());
         wsDocInfo.addResult(result);
-        return java.util.Collections.singletonList(result);
+        return Collections.singletonList(result);
     }
 
 

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedDataProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedDataProcessor.java?rev=1660429&r1=1660428&r2=1660429&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedDataProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedDataProcessor.java
Tue Feb 17 15:57:28 2015
@@ -99,7 +99,7 @@ public class EncryptedDataProcessor impl
         Principal principal = null;
         if (secRefToken != null) {
             STRParser strParser = new SecurityTokenRefSTRParser();
-            Map<String, Object> parameters = new HashMap<>();
+            Map<String, Object> parameters = new HashMap<String, Object>(1);
             parameters.put(SecurityTokenRefSTRParser.SIGNATURE_METHOD, symEncAlgo);
             strParser.parseSecurityTokenReference(
                 secRefToken, request,

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java?rev=1660429&r1=1660428&r2=1660429&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
Tue Feb 17 15:57:28 2015
@@ -26,8 +26,10 @@ import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
 import java.security.spec.MGF1ParameterSpec;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 
 import javax.crypto.Cipher;
 import javax.crypto.KeyGenerator;
@@ -89,7 +91,7 @@ public class EncryptedKeyProcessor imple
              if (result != null && 
                  WSConstants.ENCR == (Integer)result.get(WSSecurityEngineResult.TAG_ACTION)
              ) {
-                 return java.util.Collections.singletonList(result);
+                 return Collections.singletonList(result);
              }
         }
         
@@ -235,7 +237,7 @@ public class EncryptedKeyProcessor imple
         result.put(WSSecurityEngineResult.TAG_X509_REFERENCE_TYPE, strParser.getCertificatesReferenceType());
         wsDocInfo.addResult(result);
         wsDocInfo.addTokenElement(elem);
-        return java.util.Collections.singletonList(result);
+        return Collections.singletonList(result);
     }
     
     /**
@@ -385,7 +387,8 @@ public class EncryptedKeyProcessor imple
             X509Certificate[] certs = null;
             if (SecurityTokenReference.SECURITY_TOKEN_REFERENCE.equals(strElement.getLocalName())

                 && WSConstants.WSSE_NS.equals(strElement.getNamespaceURI())) {
-                strParser.parseSecurityTokenReference(strElement, data, wsDocInfo, null);
+                Map<String, Object> parameters = Collections.emptyMap();
+                strParser.parseSecurityTokenReference(strElement, data, wsDocInfo, parameters);
                 
                 certs = strParser.getCertificates();
             } else if (WSConstants.SIG_NS.equals(strElement.getNamespaceURI())

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java?rev=1660429&r1=1660428&r2=1660429&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
Tue Feb 17 15:57:28 2015
@@ -24,6 +24,7 @@ import java.io.InputStream;
 import java.security.NoSuchAlgorithmException;
 import java.security.Principal;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -86,7 +87,7 @@ public class ReferenceListProcessor impl
         }
         wsDocInfo.addTokenElement(elem);
         wsDocInfo.addResult(result);
-        return java.util.Collections.singletonList(result);
+        return Collections.singletonList(result);
     }
 
     /**
@@ -180,7 +181,7 @@ public class ReferenceListProcessor impl
             symmetricKey = X509Util.getSharedKey(keyInfoElement, symEncAlgo, data.getCallbackHandler());
         } else {
             STRParser strParser = new SecurityTokenRefSTRParser();
-            Map<String, Object> parameters = new HashMap<>();
+            Map<String, Object> parameters = new HashMap<String, Object>(1);
             parameters.put(SecurityTokenRefSTRParser.SIGNATURE_METHOD, symEncAlgo);
             strParser.parseSecurityTokenReference(
                 secRefToken, data,

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java?rev=1660429&r1=1660428&r2=1660429&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
Tue Feb 17 15:57:28 2015
@@ -160,7 +160,7 @@ public class SignatureProcessor implemen
                 }
             } else {
                 STRParser strParser = new SignatureSTRParser();
-                Map<String, Object> parameters = new HashMap<>();
+                Map<String, Object> parameters = new HashMap<>(1);
                 parameters.put(SignatureSTRParser.SIGNATURE_METHOD, signatureMethod);
                 strParser.parseSecurityTokenReference(
                     child, data, wsDocInfo, parameters

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java?rev=1660429&r1=1660428&r2=1660429&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java
Tue Feb 17 15:57:28 2015
@@ -20,15 +20,15 @@
 package org.apache.wss4j.dom.saml;
 
 import java.security.Principal;
-import java.util.HashMap;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.Text;
-
 import org.apache.wss4j.common.crypto.AlgorithmSuite;
 import org.apache.wss4j.common.crypto.AlgorithmSuiteValidator;
 import org.apache.wss4j.common.ext.WSSecurityException;
@@ -98,8 +98,9 @@ public class WSSSAMLKeyInfoProcessor imp
                     }
                 } else if (SecurityTokenReference.STR_QNAME.equals(el)) {
                     STRParser strParser = new SignatureSTRParser();
+                    Map<String, Object> parameters = Collections.emptyMap();
                     strParser.parseSecurityTokenReference(
-                        (Element)node, data, docInfo, new HashMap<String, Object>()
+                        (Element)node, data, docInfo, parameters
                     );
                     SAMLKeyInfo samlKeyInfo = new SAMLKeyInfo(strParser.getCertificates());
                     samlKeyInfo.setPublicKey(strParser.getPublicKey());



Mime
View raw message