1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Treat invalid PMDs as error and stop processing if needed

*  Improve how PMD validation result is used when searching for a valid PMD.
   We now stop if no PMD can be validated against the json schema.
This commit is contained in:
Sascha L. Teichmann 2022-08-26 16:53:18 +02:00 committed by GitHub
parent 3bb8ea0019
commit 70b4e18b58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 12 deletions

View file

@ -93,8 +93,8 @@ func (d *downloader) download(domain string) error {
"Looking for provider-metadata.json of '"+domain+"': "+format+"\n", args...)
})
if lpmd == nil {
return fmt.Errorf("no provider-metadata.json found for '%s'", domain)
if !lpmd.Valid() {
return fmt.Errorf("no valid provider-metadata.json found for '%s'", domain)
}
base, err := url.Parse(lpmd.URL)