cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r792683 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
Date Thu, 09 Jul 2009 20:53:34 GMT
Author: dkulp
Date: Thu Jul  9 20:53:34 2009
New Revision: 792683

URL: http://svn.apache.org/viewvc?rev=792683&view=rev
Log:
Compare the wsu:Id as well to make sure they really match

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

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java?rev=792683&r1=792682&r2=792683&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
Thu Jul  9 20:53:34 2009
@@ -40,6 +40,7 @@
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
 
+import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
@@ -55,6 +56,7 @@
 import org.apache.cxf.ws.policy.AssertionInfo;
 import org.apache.cxf.ws.policy.AssertionInfoMap;
 import org.apache.cxf.ws.policy.PolicyAssertion;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.SecurityConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
@@ -336,9 +338,20 @@
                             if (!found && "signed".equals(type)) {
                                 for (int x = 0; x < list.getLength(); x++) {
                                     Element el = (Element)list.item(x);
+                                    
+                                    Attr idAttr = el.getAttributeNodeNS(PolicyConstants.WSU_NAMESPACE_URI,
+                                                                   "Id");
+                                    if (idAttr == null) {
+                                        idAttr = el.getAttributeNode("Id");
+                                    }
+                                    String id = idAttr == null ? null : idAttr.getValue();
+
                                     for (WSDataRef r : refs) {
                                         if (r.getName().equals(new QName(el.getNamespaceURI(),
-                                                                     el.getLocalName())))
{
+                                                                     el.getLocalName()))
+                                            && r.getWsuId() != null
+                                            && (r.getWsuId().equals(id)
+                                             || r.getWsuId().equals("#" + id))) {
                                             found = true;
                                         }
                                     }



Mime
View raw message