cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1124690 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
Date Thu, 19 May 2011 11:33:19 GMT
Author: coheigea
Date: Thu May 19 11:33:19 2011
New Revision: 1124690

URL: http://svn.apache.org/viewvc?rev=1124690&view=rev
Log:
Minor clean up of the SymmetricBindingHandler

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java?rev=1124690&r1=1124689&r2=1124690&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
Thu May 19 11:33:19 2011
@@ -301,8 +301,7 @@ public class SymmetricBindingHandler ext
                 this.addEncryptedKeyElement(sigTokElem);
             } else if (isRequestor() && sigToken instanceof X509Token) {
                 Element el = sigTok.getToken();
-                sigTokElem = (Element)secHeader.getSecurityHeader().getOwnerDocument()
-                        .importNode(el, true);
+                sigTokElem = cloneElement(el);
                 this.addEncryptedKeyElement(sigTokElem);
             } else {
                 tokIncluded = false;
@@ -387,14 +386,13 @@ public class SymmetricBindingHandler ext
             }
 
             if (attached && encrTok.getAttachedReference() != null) {
-                dkEncr.setExternalKey(encrTok.getSecret(),
-                                      (Element)saaj.getSOAPPart()
-                                          .importNode((Element) encrTok.getAttachedReference(),
-                                true));
+                dkEncr.setExternalKey(
+                    encrTok.getSecret(), cloneElement(encrTok.getAttachedReference())
+                );
             } else if (encrTok.getUnattachedReference() != null) {
-                dkEncr.setExternalKey(encrTok.getSecret(), (Element)saaj.getSOAPPart()
-                        .importNode((Element) encrTok.getUnattachedReference(),
-                                true));
+                dkEncr.setExternalKey(
+                    encrTok.getSecret(), cloneElement(encrTok.getUnattachedReference())
+                );
             } else if (!isRequestor()) { 
                 // If the Encrypted key used to create the derived key is not
                 // attached use key identifier as defined in WSS1.1 section
@@ -569,8 +567,7 @@ public class SymmetricBindingHandler ext
         }
         
         if (ref != null) {
-            dkSign.setExternalKey(tok.getSecret(), 
-                                  (Element)saaj.getSOAPPart().importNode(ref, true));
+            dkSign.setExternalKey(tok.getSecret(), cloneElement(ref));
         } else if (!isRequestor() && policyToken.isDerivedKeys()) { 
             // If the Encrypted key used to create the derived key is not
             // attached use key identifier as defined in WSS1.1 section



Mime
View raw message