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/03/20 17:03:05 UTC

svn commit: r1458904 - in /webservices/wss4j/branches/1_6_x-fixes/src: main/java/org/apache/ws/security/ main/java/org/apache/ws/security/message/ main/java/org/apache/ws/security/message/token/ main/java/org/apache/ws/security/processor/ main/java/org...

Author: coheigea
Date: Wed Mar 20 16:03:04 2013
New Revision: 1458904

URL: http://svn.apache.org/r1458904
Log:
Removing some non namespace aware DOM calls

Modified:
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/WSDocInfo.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/WSSecBase.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/BinarySecurity.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/Reference.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/SignatureConfirmation.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/Timestamp.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/UsernameToken.java
    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/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/SignatureProcessor.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/X509Util.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/transform/STRTransform.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/util/WSSecurityUtil.java
    webservices/wss4j/branches/1_6_x-fixes/src/test/java/org/apache/ws/security/message/ModifiedRequestTest.java

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/WSDocInfo.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/WSDocInfo.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/WSDocInfo.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/WSDocInfo.java Wed Mar 20 16:03:04 2013
@@ -121,17 +121,17 @@ public class WSDocInfo {
                 return true;
             }
         }
-        if (firstElement.hasAttribute("AssertionID")
-            && secondElement.hasAttribute("AssertionID")) {
-            String id = firstElement.getAttribute("AssertionID");
-            String id2 = secondElement.getAttribute("AssertionID");
+        if (firstElement.hasAttributeNS(null, "AssertionID")
+            && secondElement.hasAttributeNS(null, "AssertionID")) {
+            String id = firstElement.getAttributeNS(null, "AssertionID");
+            String id2 = secondElement.getAttributeNS(null, "AssertionID");
             if (id.equals(id2)) {
                 return true;
             }
         }
-        if (firstElement.hasAttribute("ID") && secondElement.hasAttribute("ID")) {
-            String id = firstElement.getAttribute("ID");
-            String id2 = secondElement.getAttribute("ID");
+        if (firstElement.hasAttributeNS(null, "ID") && secondElement.hasAttributeNS(null, "ID")) {
+            String id = firstElement.getAttributeNS(null, "ID");
+            String id2 = secondElement.getAttributeNS(null, "ID");
             if (id.equals(id2)) {
                 return true;
             }
@@ -155,8 +155,8 @@ public class WSDocInfo {
         if (tokenList != null) {
             for (Element elem : tokenList) {
                 String cId = elem.getAttributeNS(WSConstants.WSU_NS, "Id");
-                String samlId = elem.getAttribute("AssertionID");
-                String samlId2 = elem.getAttribute("ID");
+                String samlId = elem.getAttributeNS(null, "AssertionID");
+                String samlId2 = elem.getAttributeNS(null, "ID");
                 if ((elem.hasAttributeNS(WSConstants.WSU_NS, "Id") && id.equals(cId)) 
                     || (elem.hasAttribute("AssertionID") && id.equals(samlId))
                     || (elem.hasAttribute("ID") && id.equals(samlId2))) {

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/WSSecBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/WSSecBase.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/WSSecBase.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/WSSecBase.java Wed Mar 20 16:03:04 2013
@@ -154,7 +154,7 @@ public class WSSecBase {
         ) {
             // If it is an XML-Enc derived element, it may already have an ID,
             // plus it is not schema valid to add an additional ID.
-            id = bodyElement.getAttribute("Id");
+            id = bodyElement.getAttributeNS(null, "Id");
             newAttrPrefix = WSConstants.ENC_PREFIX;
             newAttrNs = WSConstants.ENC_NS;
         }

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/BinarySecurity.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/BinarySecurity.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/BinarySecurity.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/BinarySecurity.java Wed Mar 20 16:03:04 2013
@@ -159,7 +159,7 @@ public class BinarySecurity {
      * @return the value type
      */
     public String getValueType() {
-        return element.getAttribute("ValueType");
+        return element.getAttributeNS(null, "ValueType");
     }
 
     /**
@@ -177,7 +177,7 @@ public class BinarySecurity {
      * @return the encoding type.
      */
     public String getEncodingType() {
-        return element.getAttribute("EncodingType");
+        return element.getAttributeNS(null, "EncodingType");
     }
 
     /**

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/Reference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/Reference.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/Reference.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/Reference.java Wed Mar 20 16:03:04 2013
@@ -97,7 +97,7 @@ public class Reference {
      * @return the ValueType attribute
      */
     public String getValueType() {
-        return element.getAttribute("ValueType");
+        return element.getAttributeNS(null, "ValueType");
     }
 
     /**
@@ -106,7 +106,7 @@ public class Reference {
      * @return the URI
      */
     public String getURI() {
-        return element.getAttribute("URI");
+        return element.getAttributeNS(null, "URI");
     }
 
     /**

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java Wed Mar 20 16:03:04 2013
@@ -480,7 +480,7 @@ public class SecurityTokenReference {
      */
     public X509Certificate[] getKeyIdentifier(Crypto crypto) throws WSSecurityException {
         Element elem = getFirstElement();
-        String value = elem.getAttribute("ValueType");
+        String value = elem.getAttributeNS(null, "ValueType");
 
         if (X509Security.X509_V3_TYPE.equals(value)) {
             X509Security token = new X509Security(elem);
@@ -528,7 +528,7 @@ public class SecurityTokenReference {
     public String getKeyIdentifierValueType() {
         if (containsKeyIdentifier()) {
             Element elem = getFirstElement();
-            return elem.getAttribute("ValueType");
+            return elem.getAttributeNS(null, "ValueType");
         } 
         return null;
     }
@@ -536,7 +536,7 @@ public class SecurityTokenReference {
     public String getKeyIdentifierEncodingType() {
         if (containsKeyIdentifier()) {
             Element elem = getFirstElement();
-            return elem.getAttribute("EncodingType");
+            return elem.getAttributeNS(null, "EncodingType");
         } 
         return null;
     }
@@ -815,7 +815,7 @@ public class SecurityTokenReference {
                     WSSecurityException.INVALID_SECURITY, "invalidValueType"
                 );
             }
-            String encodingType = getFirstElement().getAttribute("EncodingType");
+            String encodingType = getFirstElement().getAttributeNS(null, "EncodingType");
             // Encoding Type must be equal to Base64Binary if it's specified
             if (encodingType != null && !"".equals(encodingType)
                 && !BinarySecurity.BASE64_ENCODING.equals(encodingType)) {

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/SignatureConfirmation.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/SignatureConfirmation.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/SignatureConfirmation.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/SignatureConfirmation.java Wed Mar 20 16:03:04 2013
@@ -52,7 +52,7 @@ public class SignatureConfirmation {
      */
     public SignatureConfirmation(Element elem) throws WSSecurityException {
         element = elem;
-        String sv = element.getAttribute(SC_VALUE_ATTR);
+        String sv = element.getAttributeNS(null, SC_VALUE_ATTR);
         if (sv != null) {
             signatureValue = Base64.decode(sv);
         }

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/Timestamp.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/Timestamp.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/Timestamp.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/Timestamp.java Wed Mar 20 16:03:04 2013
@@ -90,7 +90,7 @@ public class Timestamp {
                 if (WSConstants.CREATED_LN.equals(currentChild.getLocalName()) &&
                         WSConstants.WSU_NS.equals(currentChild.getNamespaceURI())) {
                     if (strCreated == null) {
-                        String valueType = currentChildElement.getAttribute("ValueType");
+                        String valueType = currentChildElement.getAttributeNS(null, "ValueType");
                         if (bspCompliant && valueType != null && !"".equals(valueType)) {
                             // We can't have a ValueType attribute as per the BSP spec
                             throw new WSSecurityException(
@@ -115,7 +115,7 @@ public class Timestamp {
                             WSSecurityException.INVALID_SECURITY, "invalidTimestamp"
                         ); 
                     } else {
-                        String valueType = currentChildElement.getAttribute("ValueType");
+                        String valueType = currentChildElement.getAttributeNS(null, "ValueType");
                         if (bspCompliant && valueType != null && !"".equals(valueType)) {
                             // We can't have a ValueType attribute as per the BSP spec
                             throw new WSSecurityException(

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/UsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/UsernameToken.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/UsernameToken.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/token/UsernameToken.java Wed Mar 20 16:03:04 2013
@@ -189,7 +189,7 @@ public class UsernameToken {
         
         if (elementPassword != null) {
             if (elementPassword.hasAttribute(WSConstants.PASSWORD_TYPE_ATTR)) {
-                passwordType = elementPassword.getAttribute(WSConstants.PASSWORD_TYPE_ATTR);
+                passwordType = elementPassword.getAttributeNS(null, WSConstants.PASSWORD_TYPE_ATTR);
             } else if (elementPassword.hasAttributeNS(
                 WSConstants.WSSE_NS, WSConstants.PASSWORD_TYPE_ATTR)
             ) {
@@ -1148,7 +1148,7 @@ public class UsernameToken {
         
         if (nonceElements.size() == 1) {
             Element nonce = nonceElements.get(0);
-            String encodingType = nonce.getAttribute("EncodingType");
+            String encodingType = nonce.getAttributeNS(null, "EncodingType");
             // Encoding Type must be equal to Base64Binary
             if (encodingType == null || "".equals(encodingType)
                 || !BinarySecurity.BASE64_ENCODING.equals(encodingType)) {

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=1458904&r1=1458903&r2=1458904&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 Mar 20 16:03:04 2013
@@ -144,7 +144,7 @@ public class BinarySecurityTokenProcesso
         Element element,
         WSSConfig config
     ) throws WSSecurityException {
-        String type = element.getAttribute("ValueType");
+        String type = element.getAttributeNS(null, "ValueType");
         BinarySecurity token = null;
         if (X509Security.X509_V3_TYPE.equals(type)) {
             token = new X509Security(element, config.isWsiBSPCompliant());

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=1458904&r1=1458903&r2=1458904&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 Mar 20 16:03:04 2013
@@ -243,7 +243,7 @@ public class EncryptedKeyProcessor imple
             Element digestElement = 
                 WSSecurityUtil.getDirectChildElement(tmpE, "DigestMethod", WSConstants.SIG_NS);
             if (digestElement != null) {
-                return digestElement.getAttribute("Algorithm");
+                return digestElement.getAttributeNS(null, "Algorithm");
             }
         }
         return null;
@@ -339,7 +339,7 @@ public class EncryptedKeyProcessor imple
                 if (Node.ELEMENT_NODE == node.getNodeType()
                         && WSConstants.ENC_NS.equals(node.getNamespaceURI())
                         && "DataReference".equals(node.getLocalName())) {
-                    String dataRefURI = ((Element) node).getAttribute("URI");
+                    String dataRefURI = ((Element) node).getAttributeNS(null, "URI");
                     if (dataRefURI.charAt(0) == '#') {
                         dataRefURI = dataRefURI.substring(1);
                     }
@@ -427,25 +427,25 @@ public class EncryptedKeyProcessor imple
      * @throws WSSecurityException
      */
     private void checkBSPCompliance(Element elem, String encAlgo) throws WSSecurityException {
-        String attribute = elem.getAttribute("Type");
+        String attribute = elem.getAttributeNS(null, "Type");
         if (attribute != null && !"".equals(attribute)) {
             throw new WSSecurityException(
                 WSSecurityException.FAILED_CHECK, "badAttribute", new Object[]{attribute}
             );
         }
-        attribute = elem.getAttribute("MimeType");
+        attribute = elem.getAttributeNS(null, "MimeType");
         if (attribute != null && !"".equals(attribute)) {
             throw new WSSecurityException(
                 WSSecurityException.FAILED_CHECK, "badAttribute", new Object[]{attribute}
             );
         }
-        attribute = elem.getAttribute("Encoding");
+        attribute = elem.getAttributeNS(null, "Encoding");
         if (attribute != null && !"".equals(attribute)) {
             throw new WSSecurityException(
                 WSSecurityException.FAILED_CHECK, "badAttribute", new Object[]{attribute}
             );
         }
-        attribute = elem.getAttribute("Recipient");
+        attribute = elem.getAttributeNS(null, "Recipient");
         if (attribute != null && !"".equals(attribute)) {
             throw new WSSecurityException(
                 WSSecurityException.FAILED_CHECK, "badAttribute", new Object[]{attribute}

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=1458904&r1=1458903&r2=1458904&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 Mar 20 16:03:04 2013
@@ -95,7 +95,7 @@ public class ReferenceListProcessor impl
             if (Node.ELEMENT_NODE == node.getNodeType()
                 && WSConstants.ENC_NS.equals(node.getNamespaceURI())
                 && "DataReference".equals(node.getLocalName())) {
-                String dataRefURI = ((Element) node).getAttribute("URI");
+                String dataRefURI = ((Element) node).getAttributeNS(null, "URI");
                 if (dataRefURI.charAt(0) == '#') {
                     dataRefURI = dataRefURI.substring(1);
                 }

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=1458904&r1=1458903&r2=1458904&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 Mar 20 16:03:04 2013
@@ -251,7 +251,7 @@ 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.getAttribute("Id"));
+        result.put(WSSecurityEngineResult.TAG_ID, elem.getAttributeNS(null, "Id"));
         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/X509Util.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/X509Util.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/X509Util.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/processor/X509Util.java Wed Mar 20 16:03:04 2013
@@ -43,7 +43,7 @@ public final class X509Util {
 
     public static boolean isContent(Node encBodyData) {
         if (encBodyData != null) {
-            String typeStr = ((Element)encBodyData).getAttribute("Type");
+            String typeStr = ((Element)encBodyData).getAttributeNS(null, "Type");
             if (typeStr != null) {
                  return typeStr.equals(WSConstants.ENC_NS + "Content");
             }
@@ -58,7 +58,7 @@ public final class X509Util {
             );
         String symEncAlgo = null;
         if (tmpE != null) {
-            symEncAlgo = tmpE.getAttribute("Algorithm");
+            symEncAlgo = tmpE.getAttributeNS(null, "Algorithm");
             if (symEncAlgo == null || "".equals(symEncAlgo)) {
                 throw new WSSecurityException(
                     WSSecurityException.UNSUPPORTED_ALGORITHM, "noEncAlgo"

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java Wed Mar 20 16:03:04 2013
@@ -194,7 +194,7 @@ public class SignatureSTRParser implemen
                         proc.handleToken(token, data, wsDocInfo);
                     secretKey = 
                         (byte[])encrResult.get(0).get(WSSecurityEngineResult.TAG_SECRET);
-                    principal = new CustomTokenPrincipal(token.getAttribute("Id"));
+                    principal = new CustomTokenPrincipal(token.getAttributeNS(null, "Id"));
                 }
             }
         } else if (secRef.containsX509Data() || secRef.containsX509IssuerSerial()) {

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/transform/STRTransform.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/transform/STRTransform.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/transform/STRTransform.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/transform/STRTransform.java Wed Mar 20 16:03:04 2013
@@ -144,7 +144,7 @@ public class STRTransform extends Transf
                 WSSecurityUtil.getDirectChildElement(
                     transformParams, "CanonicalizationMethod", WSConstants.SIG_NS
                 );
-            canonAlgo = canonElem.getAttribute("Algorithm");
+            canonAlgo = canonElem.getAttributeNS(null, "Algorithm");
         }
         try {
             //
@@ -201,7 +201,7 @@ public class STRTransform extends Transf
                 STRTransformUtil.dereferenceSTR(doc, secRef, wsDocInfo);
             
             if (dereferencedToken != null) {
-                String type = dereferencedToken.getAttribute("ValueType");
+                String type = dereferencedToken.getAttributeNS(null, "ValueType");
                 if ((X509Security.X509_V3_TYPE.equals(type) 
                     || PKIPathSecurity.getType().equals(type))) {
                     //

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/util/WSSecurityUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/util/WSSecurityUtil.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/util/WSSecurityUtil.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/util/WSSecurityUtil.java Wed Mar 20 16:03:04 2013
@@ -410,9 +410,9 @@ public final class WSSecurityUtil {
             // start node processing at this point
             if (startNode.getNodeType() == Node.ELEMENT_NODE) {
                 Element se = (Element) startNode;
-                if ((se.hasAttribute("ID") && value.equals(se.getAttribute("ID")))
+                if ((se.hasAttribute("ID") && value.equals(se.getAttributeNS(null, "ID")))
                     || (se.hasAttribute("AssertionID") 
-                        && value.equals(se.getAttribute("AssertionID")))) {
+                        && value.equals(se.getAttributeNS(null, "AssertionID")))) {
                     if (foundElement == null) {
                         foundElement = se; // Continue searching to find duplicates
                     } else {
@@ -558,7 +558,7 @@ public final class WSSecurityUtil {
         while (e != null && (e.getNodeType() == Node.ELEMENT_NODE)) {
             Attr attr = null;
             if (prefix == null) {
-                attr = ((Element) e).getAttributeNode("xmlns");
+                attr = ((Element) e).getAttributeNodeNS(null, "xmlns");
             } else {
                 attr = ((Element) e).getAttributeNodeNS(WSConstants.XMLNS_NS, prefix);
             }

Modified: webservices/wss4j/branches/1_6_x-fixes/src/test/java/org/apache/ws/security/message/ModifiedRequestTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/test/java/org/apache/ws/security/message/ModifiedRequestTest.java?rev=1458904&r1=1458903&r2=1458904&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/test/java/org/apache/ws/security/message/ModifiedRequestTest.java (original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/test/java/org/apache/ws/security/message/ModifiedRequestTest.java Wed Mar 20 16:03:04 2013
@@ -332,7 +332,7 @@ public class ModifiedRequestTest extends
         Element body = WSSecurityUtil.findBodyElement(doc);
         Element encryptionMethod = 
             WSSecurityUtil.findElement(body, "EncryptionMethod", WSConstants.ENC_NS);
-        encryptionMethod.setAttribute("Algorithm", "http://new-algorithm");
+        encryptionMethod.setAttributeNS(null, "Algorithm", "http://new-algorithm");
         
         String outputString = 
             org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);