Skip to content

Commit

Permalink
Fix unstable replacement of encrypt assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
tngan committed May 2, 2017
1 parent f3a9682 commit 61c5bb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libsaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ const libSaml = function () {
if (!res) {
return reject(new Error('undefined encrypted assertion'));
}
return resolve(utility.base64Encode(entireXML.replace(assertion, '<saml:EncryptedAssertion>' + res + '</saml:EncryptedAssertion>')));
return resolve(utility.base64Encode(entireXML.replace(/<saml:Assertion(.*)<\/saml:Assertion>/g, '<saml:EncryptedAssertion>' + res + '</saml:EncryptedAssertion>')));
});
} else {
return resolve(utility.base64Encode(entireXML)); // No need to do encrpytion
Expand Down

0 comments on commit 61c5bb8

Please sign in to comment.