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:47:37 UTC

svn commit: r1514756 - /webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java

Author: coheigea
Date: Fri Aug 16 15:47:37 2013
New Revision: 1514756

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

Modified:
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java

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=1514756&r1=1514755&r2=1514756&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 Fri Aug 16 15:47:37 2013
@@ -74,6 +74,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.FAILURE, "noDecCryptoFile");
         }