You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xml-crypto is not generating the correct value for the SignatureValue for the signature. I've verified by feeding the same XML repeatedly to xml-crypto and there's a mismatch in the output.
The SignatureValue value from samltool works with SP but the one xml-crypto generates doesn't.
DigestValue is correct and matches the one from samltool though.
return new Promise(function (resolve, reject) {
let SignedXml = require('xml-crypto').SignedXml;
var sig = new SignedXml();
sig.signingKey = require('fs').readFileSync(self.privateKey);
sig.canonicalizationAlgorithm = "http://www.w3.org/2001/10/xml-exc-c14n#";
sig.signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
sig.addReference("//*[local-name()='Response']",
[
"http://www.w3.org/2000/09/xmldsig#enveloped-signature",
"http://www.w3.org/2001/10/xml-exc-c14n#"
],
"http://www.w3.org/2000/09/xmldsig#sha1"
);
sig.keyInfoProvider = new (function () {
this.getKeyInfo = function () {
return `<ds:X509Data><ds:X509Certificate>${self.getPublicKey()}</ds:X509Certificate></ds:X509Data>`
}
});
sig.computeSignature(xml, {
prefix: 'ds',
location: { reference: "//*[local-name(.)='Issuer']", action: "after" } // place the signature after the Issuer
});
resolve(sig.getSignedXml());
});
The text was updated successfully, but these errors were encountered:
sweetodev
changed the title
Mismatch SignatureValue of the signature if compared with samltool
Mismatch SignatureValue if compared with samltool
Nov 15, 2019
sweetodev
changed the title
Mismatch SignatureValue if compared with samltool
Mismatch SignatureValue compared to samltool
Nov 15, 2019
@sweetodev , this certainly sounds like something we'd like to address. Could you please create a PR with a test suite that replicates the problem, including notes about how you signed things over at SAML Tool? That would really help everyone in getting to the bottom of this as you aren't the first person to report having difficulty getting signatures to match.
xml-crypto is not generating the correct value for the
SignatureValue
for the signature. I've verified by feeding the same XML repeatedly toxml-crypto
and there's a mismatch in the output.The SignatureValue value from samltool works with SP but the one
xml-crypto
generates doesn't.DigestValue is correct and matches the one from samltool though.
xml signature
The text was updated successfully, but these errors were encountered: