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 2025/03/21 11:07:39 UTC

(santuario-xml-security-java) 03/04: [SANTUARIO-576] Fix saml validation with saaj 1.4+ (#453)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.0.x-fixes
in repository https://gitbox.apache.org/repos/asf/santuario-xml-security-java.git

commit 5488262b2b0b6f5ad80cde12aa709797ed994237
Author: Lukas F. <32...@users.noreply.github.com>
AuthorDate: Fri Mar 21 10:39:35 2025 +0100

    [SANTUARIO-576] Fix saml validation with saaj 1.4+ (#453)
    
    * [SANTUARIO-576] Fix saml validation with saaj 1.4
    
    Signature element was not removed due to type mismatch
    
    * [SANTUARIO-576] Check for reference equality first
    
    ---------
    
    Co-authored-by: Lukas Fabian <lu...@svc.co.at>
---
 .../org/apache/xml/security/c14n/implementations/CanonicalizerBase.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java b/src/main/java/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java
index aadd7662..712ceeaf 100644
--- a/src/main/java/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java
+++ b/src/main/java/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java
@@ -241,7 +241,7 @@ public abstract class CanonicalizerBase extends CanonicalizerSpi {
 
             case Node.ELEMENT_NODE :
                 documentLevel = NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT;
-                if (currentNode == excludeNode) {
+                if (currentNode == excludeNode || (excludeNode != null && (excludeNode.isSameNode(currentNode) || currentNode.isSameNode(excludeNode)))) {
                     break;
                 }
                 Element currentElement = (Element)currentNode;