You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by co...@apache.org on 2009/07/10 13:32:37 UTC

svn commit: r792889 - in /xml/security/trunk: ./ src/org/apache/xml/security/ src/org/apache/xml/security/c14n/implementations/ src/org/apache/xml/security/encryption/ src/org/apache/xml/security/keys/keyresolver/implementations/ src/org/apache/xml/sec...

Author: coheigea
Date: Fri Jul 10 11:32:36 2009
New Revision: 792889

URL: http://svn.apache.org/viewvc?rev=792889&view=rev
Log:
[42986] - The </#document> node inserted at the end of SOAPEnvelope.

Modified:
    xml/security/trunk/CHANGELOG.txt
    xml/security/trunk/src/org/apache/xml/security/Init.java
    xml/security/trunk/src/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java
    xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java
    xml/security/trunk/src/org/apache/xml/security/keys/keyresolver/implementations/RetrievalMethodResolver.java
    xml/security/trunk/src/org/apache/xml/security/utils/IdResolver.java

Modified: xml/security/trunk/CHANGELOG.txt
URL: http://svn.apache.org/viewvc/xml/security/trunk/CHANGELOG.txt?rev=792889&r1=792888&r2=792889&view=diff
==============================================================================
--- xml/security/trunk/CHANGELOG.txt (original)
+++ xml/security/trunk/CHANGELOG.txt Fri Jul 10 11:32:36 2009
@@ -1,5 +1,6 @@
 Changelog for "Apache xml-security" <http://santuario.apache.org/>
 New in v ...
+    Fixed Bug 42986: The </#document> node inserted at the end of SOAPEnvelope.
     Fixed Bug 47029: Unnecessary namespace declarations on EncryptedData children.
     Fixed Bug 44335: Can't validate after invalid validation.
     Fixed Bug 47260: Improve Java unit testing.

Modified: xml/security/trunk/src/org/apache/xml/security/Init.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src/org/apache/xml/security/Init.java?rev=792889&r1=792888&r2=792889&view=diff
==============================================================================
--- xml/security/trunk/src/org/apache/xml/security/Init.java (original)
+++ xml/security/trunk/src/org/apache/xml/security/Init.java Fri Jul 10 11:32:36 2009
@@ -145,7 +145,7 @@
                 }
             }
 			for (Node el=config.getFirstChild();el!=null;el=el.getNextSibling()) {
-                if (!(el instanceof Element)) {
+                if (el == null || Node.ELEMENT_NODE != el.getNodeType()) {
                 	continue;
                 }
                 String tag=el.getLocalName();

Modified: xml/security/trunk/src/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java?rev=792889&r1=792888&r2=792889&view=diff
==============================================================================
--- xml/security/trunk/src/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java (original)
+++ xml/security/trunk/src/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java Fri Jul 10 11:32:36 2009
@@ -198,7 +198,7 @@
         try {
          NameSpaceSymbTable ns=new NameSpaceSymbTable();
          int nodeLevel=NODE_BEFORE_DOCUMENT_ELEMENT;
-         if (rootNode instanceof Element) {
+         if (rootNode != null && Node.ELEMENT_NODE == rootNode.getNodeType()) {
          	//Fills the nssymbtable with the definitions of the parent of the root subnode
          	getParentNameSpaces((Element)rootNode,ns);
          	nodeLevel=NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT;
@@ -327,8 +327,8 @@
     			if (parentNode==endnode)
     				return;
     			sibling=parentNode.getNextSibling();
-    			parentNode=parentNode.getParentNode();   
-    			if (!(parentNode instanceof Element)) {
+    			parentNode=parentNode.getParentNode();
+    			if (parentNode == null || Node.ELEMENT_NODE != parentNode.getNodeType()) {
     				documentLevel=NODE_AFTER_DOCUMENT_ELEMENT;
     				parentNode=null;
     			}    			
@@ -384,7 +384,7 @@
 		return;
 	boolean currentNodeIsVisible = false;	  
 	NameSpaceSymbTable ns=new  NameSpaceSymbTable();
-	if (currentNode instanceof Element)
+	if (currentNode != null && Node.ELEMENT_NODE == currentNode.getNodeType())
 		getParentNameSpaces((Element)currentNode,ns);
   	Node sibling=null;
 	Node parentNode=null;	
@@ -505,7 +505,7 @@
 				return;
 			sibling=parentNode.getNextSibling();
 			parentNode=parentNode.getParentNode();   
-			if (!(parentNode instanceof Element)) {
+			if (parentNode == null || Node.ELEMENT_NODE != parentNode.getNodeType()) {
 				parentNode=null;
 				documentLevel=NODE_AFTER_DOCUMENT_ELEMENT;
 			}    			
@@ -587,7 +587,7 @@
    	final void getParentNameSpaces(Element el,NameSpaceSymbTable ns)  {
    		List parents=new ArrayList(10);
    		Node n1=el.getParentNode();
-   		if (!(n1 instanceof Element)) {
+   		if (n1 == null || Node.ELEMENT_NODE != n1.getNodeType()) {
    			return;
    		}
    		//Obtain all the parents of the elemnt
@@ -595,7 +595,7 @@
    		while (parent!=null) {
    			parents.add(parent);
    			Node n=parent.getParentNode();
-   			if (!(n instanceof Element )) {
+   			if (n == null || Node.ELEMENT_NODE != n.getNodeType()) {
    				break;
    			}
    			parent=(Element)n;

Modified: xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java?rev=792889&r1=792888&r2=792889&view=diff
==============================================================================
--- xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java (original)
+++ xml/security/trunk/src/org/apache/xml/security/encryption/XMLCipher.java Fri Jul 10 11:32:36 2009
@@ -1391,7 +1391,7 @@
 		// The de-serialiser returns a fragment whose children we need to
 		// take on.
 
-		if (sourceParent instanceof Document) {
+		if (sourceParent != null && Node.DOCUMENT_NODE == sourceParent.getNodeType()) {
 			
 		    // If this is a content decryption, this may have problems
 

Modified: xml/security/trunk/src/org/apache/xml/security/keys/keyresolver/implementations/RetrievalMethodResolver.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src/org/apache/xml/security/keys/keyresolver/implementations/RetrievalMethodResolver.java?rev=792889&r1=792888&r2=792889&view=diff
==============================================================================
--- xml/security/trunk/src/org/apache/xml/security/keys/keyresolver/implementations/RetrievalMethodResolver.java (original)
+++ xml/security/trunk/src/org/apache/xml/security/keys/keyresolver/implementations/RetrievalMethodResolver.java Fri Jul 10 11:32:36 2009
@@ -279,7 +279,7 @@
 	   Element e=null;
 	   while (it.hasNext()) {
 		   Node currentNode=(Node)it.next();
-		   if (currentNode instanceof Element) {
+		   if (currentNode != null && Node.ELEMENT_NODE == currentNode.getNodeType()) {
 			   e=(Element)currentNode;
 			   break;
 		   }
@@ -291,7 +291,7 @@
   		do {
   			parents.add(e);
   			Node n=e.getParentNode();
-  			if (!(n instanceof Element )) {
+  			if (n == null || Node.ELEMENT_NODE != n.getNodeType()) {
   				break;
   			}
   			e=(Element)n;

Modified: xml/security/trunk/src/org/apache/xml/security/utils/IdResolver.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src/org/apache/xml/security/utils/IdResolver.java?rev=792889&r1=792888&r2=792889&view=diff
==============================================================================
--- xml/security/trunk/src/org/apache/xml/security/utils/IdResolver.java (original)
+++ xml/security/trunk/src/org/apache/xml/security/utils/IdResolver.java Fri Jul 10 11:32:36 2009
@@ -219,7 +219,7 @@
     	} while (sibling==null  && parentNode!=null) {    		      		      			
     			sibling=parentNode.getNextSibling();
     			parentNode=parentNode.getParentNode();   
-    			if (!(parentNode instanceof Element)) {
+    			if (parentNode != null && Node.ELEMENT_NODE != parentNode.getNodeType()) {
     				parentNode=null;
     			}    			
     		}