samlesa 4.7.6 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/src/libsamlSoap.js
CHANGED
|
@@ -118,18 +118,26 @@ function verifySignature(xml, signatureNodes, opts) {
|
|
|
118
118
|
const publicKeys = resolvePublicCertificates(signatureNode, opts);
|
|
119
119
|
let verifiedSig = null;
|
|
120
120
|
let lastError = null;
|
|
121
|
+
const parentXml = signatureNode?.parentNode ? serializeWithInheritedNamespaces(signatureNode.parentNode) : '';
|
|
122
|
+
const rawParentXml = signatureNode?.parentNode?.toString?.() || '';
|
|
123
|
+
const xmlCandidates = uniqueXmlCandidates([xml, parentXml, rawParentXml]);
|
|
121
124
|
for (const publicKey of publicKeys) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
for (const xmlCandidate of xmlCandidates) {
|
|
126
|
+
try {
|
|
127
|
+
const sig = new SignedXml();
|
|
128
|
+
sig.publicCert = publicKey;
|
|
129
|
+
sig.loadSignature(signatureNode);
|
|
130
|
+
if (sig.checkSignature(xmlCandidate)) {
|
|
131
|
+
verifiedSig = sig;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
lastError = error;
|
|
129
137
|
}
|
|
130
138
|
}
|
|
131
|
-
|
|
132
|
-
|
|
139
|
+
if (verifiedSig) {
|
|
140
|
+
break;
|
|
133
141
|
}
|
|
134
142
|
}
|
|
135
143
|
if (!verifiedSig) {
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libsamlSoap.d.ts","sourceRoot":"","sources":["../../src/libsamlSoap.ts"],"names":[],"mappings":"AAKA,OAAgB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AA2FjE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;IAC7C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;IACrC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"libsamlSoap.d.ts","sourceRoot":"","sources":["../../src/libsamlSoap.ts"],"names":[],"mappings":"AAKA,OAAgB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AA2FjE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;IAC7C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;IACrC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAqJD,iBAAe,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAoCpH;;;;AAED,wBAEE"}
|