Skip to content

Commit

Permalink
#100 Fix bug in cert string normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
tngan committed Jul 19, 2017
1 parent f76b83c commit dd9fead
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 @@ -471,14 +471,14 @@ const libSaml = () => {
if (typeof metadataCert === 'string') {
metadataCert = [metadataCert];
}
metadataCert = metadataCert.map(utility.normalizeCerString);
const x509Certificate = select("//*[local-name(.)='X509Certificate']", s)[0].firstChild.data;
if (includes(metadataCert, x509Certificate)) {
selectedCert = x509Certificate;
}
if (selectedCert === '') {
throw new Error('certificate in document is not matched those specified in metadata');
}
metadataCert = metadataCert.map(utility.normalizeCerString);
sig.keyInfoProvider = new this.getKeyInfo(selectedCert);
} else {
throw new Error('undefined certificate in \'opts\' object');
Expand Down

1 comment on commit dd9fead

@puneetmakkar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.