yaronn/xml-crypto — pull request #31 by ploer (2014-05-31 01:49:38+00:00)
Title: Updating EnvelopedSignature transform

Updating EnvelopedSignature transform to strip signature from inside the current node, not just first signature in the document.

Includes a test to verify (and which fails before this change).

I ran into this problem in the passport-saml library, which needs to verify xml signatures on SAML documents. Some SAML documents have two signatures on separate elements, and without this fix, when trying to verify the signature on the second element, it would strep the first enveloped signature from the whole document, but the element in question would still have its signature in place (and therefore get an incorrect digest).