Skip to content

Commit 8c1af97

Browse files
committed
fix: Support nested enveloped signature location (#525)
Update XPath query to find Signature elements at any depth within the document, not just direct children. This fixes an issue where signatures nested within other elements were not properly detected and removed.
1 parent 9443fb2 commit 8c1af97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/enveloped-signature.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class EnvelopedSignature implements CanonicalizationOrTransformationAlgor
1717
process(node: Node, options: CanonicalizationOrTransformationAlgorithmProcessOptions): Node {
1818
if (null == options.signatureNode) {
1919
const signature = xpath.select1(
20-
"./*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",
20+
".//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",
2121
node,
2222
);
2323
if (isDomNode.isNodeLike(signature) && signature.parentNode) {

0 commit comments

Comments
 (0)