Skip to content

Commit

Permalink
throw when cert is null
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkrick authored Oct 29, 2020
1 parent 32ce430 commit 6f608a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libsaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ const libSaml = () => {
const certificateNode = select(".//*[local-name(.)='X509Certificate']", signatureNode) as any;
// certificate in metadata
let metadataCert: any = opts.metadata.getX509Certificate(certUse.signing);
if (!metadataCert) {
throw new Error('INVALID_CERTIFICATE_PROVIDED')
}
// flattens the nested array of Certificates from each KeyDescriptor
if (Array.isArray(metadataCert)) {
metadataCert = flattenDeep(metadataCert);
Expand Down

0 comments on commit 6f608a9

Please sign in to comment.