ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1609070 - /webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/
Date Wed, 09 Jul 2014 09:44:04 GMT
Author: coheigea
Date: Wed Jul  9 09:44:03 2014
New Revision: 1609070

URL: http://svn.apache.org/r1609070
Log:
Only store an Id if it is non-empty


Conflicts:
	src/main/java/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java
	src/main/java/org/apache/ws/security/processor/EncryptedDataProcessor.java
	src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java
	src/main/java/org/apache/ws/security/processor/SignatureConfirmationProcessor.java

Modified:
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/BinarySecurityTokenProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedDataProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/ReferenceListProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SecurityContextTokenProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SignatureConfirmationProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SignatureProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/TimestampProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/UsernameTokenProcessor.java

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/BinarySecurityTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/BinarySecurityTokenProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/BinarySecurityTokenProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/BinarySecurityTokenProcessor.java
Wed Jul  9 09:44:03 2014
@@ -80,7 +80,9 @@ public class BinarySecurityTokenProcesso
         WSSecurityEngineResult result = 
             new WSSecurityEngineResult(WSConstants.BST, token, certs);
         wsDocInfo.addTokenElement(elem);
-        result.put(WSSecurityEngineResult.TAG_ID, id);
+        if (!"".equals(id)) {
+            result.put(WSSecurityEngineResult.TAG_ID, id);
+        }
         
         if (validator != null) {
             // Hook to allow the user to validate the BinarySecurityToken

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java
Wed Jul  9 09:44:03 2014
@@ -79,7 +79,10 @@ public class DerivedKeyTokenProcessor im
         WSSecurityEngineResult result =
             new WSSecurityEngineResult(WSConstants.DKT, null, keyBytes, null);
         wsDocInfo.addTokenElement(elem);
-        result.put(WSSecurityEngineResult.TAG_ID, dkt.getID());
+        String tokenId = dkt.getID();
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         result.put(WSSecurityEngineResult.TAG_DERIVED_KEY_TOKEN, dkt);
         result.put(WSSecurityEngineResult.TAG_SECRET, secret);
         result.put(WSSecurityEngineResult.TAG_TOKEN_ELEMENT, dkt.getElement());

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedDataProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedDataProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedDataProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedDataProcessor.java
Wed Jul  9 09:44:03 2014
@@ -184,7 +184,10 @@ public class EncryptedDataProcessor impl
         
         WSSecurityEngineResult result = 
                 new WSSecurityEngineResult(WSConstants.ENCR, Collections.singletonList(dataRef));
-        result.put(WSSecurityEngineResult.TAG_ID, elem.getAttributeNS(null, "Id"));
+        String encryptedDataId = elem.getAttributeNS(null, "Id");
+        if (!"".equals(encryptedDataId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, encryptedDataId);
+        }
         wsDocInfo.addResult(result);
         wsDocInfo.addTokenElement(elem);
         

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java
Wed Jul  9 09:44:03 2014
@@ -189,7 +189,10 @@ public class EncryptedKeyProcessor imple
             WSSecurityEngineResult.TAG_ENCRYPTED_KEY_TRANSPORT_METHOD, 
             encryptedKeyTransportMethod
         );
-        result.put(WSSecurityEngineResult.TAG_ID, elem.getAttributeNS(null, "Id"));
+        String tokenId = elem.getAttributeNS(null, "Id");
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         result.put(WSSecurityEngineResult.TAG_X509_REFERENCE_TYPE, strParser.getCertificatesReferenceType());
         wsDocInfo.addResult(result);
         wsDocInfo.addTokenElement(elem);

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/ReferenceListProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/ReferenceListProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/ReferenceListProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/ReferenceListProcessor.java
Wed Jul  9 09:44:03 2014
@@ -64,7 +64,10 @@ public class ReferenceListProcessor impl
         List<WSDataRef> dataRefs = handleReferenceList(elem, data, wsDocInfo);
         WSSecurityEngineResult result = 
             new WSSecurityEngineResult(WSConstants.ENCR, dataRefs);
-        result.put(WSSecurityEngineResult.TAG_ID, elem.getAttributeNS(null, "Id"));
+        String tokenId = elem.getAttributeNS(null, "Id");
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         wsDocInfo.addTokenElement(elem);
         wsDocInfo.addResult(result);
         return java.util.Collections.singletonList(result);

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java
Wed Jul  9 09:44:03 2014
@@ -102,7 +102,9 @@ public class SAMLTokenProcessor implemen
             result = new WSSecurityEngineResult(WSConstants.ST_UNSIGNED, assertion);
         }
         
-        result.put(WSSecurityEngineResult.TAG_ID, assertion.getId());
+        if (!"".equals(id)) {
+            result.put(WSSecurityEngineResult.TAG_ID, id);
+        }
 
         if (validator != null) {
             result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE);

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SecurityContextTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SecurityContextTokenProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SecurityContextTokenProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SecurityContextTokenProcessor.java
Wed Jul  9 09:44:03 2014
@@ -64,7 +64,10 @@ public class SecurityContextTokenProcess
             
             Credential returnedCredential = validator.validate(credential, data);
             result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE);
-            result.put(WSSecurityEngineResult.TAG_ID, sct.getID());
+            String tokenId = sct.getID();
+            if (!"".equals(tokenId)) {
+                result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+            }
             result.put(WSSecurityEngineResult.TAG_SECRET, returnedCredential.getSecretKey());
         } else {
             String id = sct.getID();

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SignatureConfirmationProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SignatureConfirmationProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SignatureConfirmationProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SignatureConfirmationProcessor.java
Wed Jul  9 09:44:03 2014
@@ -57,7 +57,9 @@ public class SignatureConfirmationProces
         
         WSSecurityEngineResult result = 
             new WSSecurityEngineResult(WSConstants.SC, sigConf);
-        result.put(WSSecurityEngineResult.TAG_ID, id);
+        if (!"".equals(id)) {
+            result.put(WSSecurityEngineResult.TAG_ID, id);
+        }
         wsDocInfo.addResult(result);
         wsDocInfo.addTokenElement(elem);
         return java.util.Collections.singletonList(result);

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SignatureProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SignatureProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SignatureProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/SignatureProcessor.java
Wed Jul  9 09:44:03 2014
@@ -250,7 +250,10 @@ public class SignatureProcessor implemen
                 certs, dataRefs, signatureValue);
         result.put(WSSecurityEngineResult.TAG_SIGNATURE_METHOD, signatureMethod);
         result.put(WSSecurityEngineResult.TAG_CANONICALIZATION_METHOD, c14nMethod);
-        result.put(WSSecurityEngineResult.TAG_ID, elem.getAttributeNS(null, "Id"));
+        String tokenId = elem.getAttributeNS(null, "Id");
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         result.put(WSSecurityEngineResult.TAG_SECRET, secretKey);
         result.put(WSSecurityEngineResult.TAG_PUBLIC_KEY, publicKey);
         result.put(WSSecurityEngineResult.TAG_X509_REFERENCE_TYPE, referenceType);

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/TimestampProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/TimestampProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/TimestampProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/TimestampProcessor.java
Wed Jul  9 09:44:03 2014
@@ -55,7 +55,10 @@ public class TimestampProcessor implemen
         
         WSSecurityEngineResult result = 
             new WSSecurityEngineResult(WSConstants.TS, timestamp);
-        result.put(WSSecurityEngineResult.TAG_ID, timestamp.getID());
+        String tokenId = timestamp.getID();
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         
         Validator validator = data.getValidator(WSSecurityEngine.TIMESTAMP);
         if (validator != null) {

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/UsernameTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/UsernameTokenProcessor.java?rev=1609070&r1=1609069&r2=1609070&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/UsernameTokenProcessor.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/UsernameTokenProcessor.java
Wed Jul  9 09:44:03 2014
@@ -77,7 +77,10 @@ public class UsernameTokenProcessor impl
             } 
         }
         WSSecurityEngineResult result = new WSSecurityEngineResult(action, token);
-        result.put(WSSecurityEngineResult.TAG_ID, token.getID());
+        String tokenId = token.getID();
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         result.put(WSSecurityEngineResult.TAG_SECRET, secretKey);
         
         if (validator != null) {



Mime
View raw message