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 2013/08/16 17:46:20 UTC

svn commit: r1514755 - /webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java

Author: coheigea
Date: Fri Aug 16 15:46:19 2013
New Revision: 1514755

URL: http://svn.apache.org/r1514755
Log:
[WSS-475] - Don't process an EncryptedKey again if it has already been processed

Modified:
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java

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=1514755&r1=1514754&r2=1514755&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 Fri Aug 16 15:46:19 2013
@@ -75,6 +75,18 @@ public class EncryptedKeyProcessor imple
         if (log.isDebugEnabled()) {
             log.debug("Found encrypted key element");
         }
+        
+        // See if this key has already been processed. If so then just return the result
+        String id = elem.getAttributeNS(null, "Id");
+        if (!"".equals(id)) {
+             WSSecurityEngineResult result = wsDocInfo.getResult(id);
+             if (result != null && 
+                 WSConstants.ENCR == (Integer)result.get(WSSecurityEngineResult.TAG_ACTION)
+             ) {
+                 return java.util.Collections.singletonList(result);
+             }
+        }
+        
         if (data.getDecCrypto() == null) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noDecCryptoFile");
         }