Skip to content

Commit 92eb417

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 5200d71 commit 92eb417

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 TransformAlgorithm {
1717
process(node: Node, options: TransformAlgorithmOptions): Node {
1818
if (null == options.signatureNode) {
1919
const signature = xpath.select1(
20-
`./*[local-name(.)='Signature' and namespace-uri(.)='${XMLDSIG_URIS.NAMESPACES.ds}']`,
20+
`.//*[local-name(.)='Signature' and namespace-uri(.)='${XMLDSIG_URIS.NAMESPACES.ds}']`,
2121
node,
2222
);
2323
if (isDomNode.isNodeLike(signature) && signature.parentNode) {

0 commit comments

Comments
 (0)