mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-23 00:32:55 +01:00
Fix: Check changes before stopping the scan of already tested advisories
This commit is contained in:
parent
9e758507a3
commit
d38dc285cc
1 changed files with 26 additions and 25 deletions
|
|
@ -651,23 +651,6 @@ func (p *processor) integrity(
|
|||
continue
|
||||
}
|
||||
|
||||
if p.markChecked(u, mask) {
|
||||
continue
|
||||
}
|
||||
p.checkTLS(u)
|
||||
|
||||
// Check if the filename is conforming.
|
||||
p.badFilenames.use()
|
||||
if !util.ConformingFileName(filepath.Base(u)) {
|
||||
p.badFilenames.error("%s does not have a conforming filename.", u)
|
||||
}
|
||||
|
||||
var folderYear *int
|
||||
if m := yearFromURL.FindStringSubmatch(u); m != nil {
|
||||
year, _ := strconv.Atoi(m[1])
|
||||
folderYear = &year
|
||||
}
|
||||
|
||||
res, err := client.Get(u)
|
||||
if err != nil {
|
||||
lg(ErrorType, "Fetching %s failed: %v.", u, err)
|
||||
|
|
@ -702,6 +685,32 @@ func (p *processor) integrity(
|
|||
continue
|
||||
}
|
||||
|
||||
if len(p.times) > 0 && p.badChanges.used() {
|
||||
current, fault := p.extractTime(doc, `current_release_date`, u)
|
||||
if fault != "" {
|
||||
p.badChanges.error(fault)
|
||||
} else if t, ok := p.times[f.URL()]; !ok || !current.Equal(t) {
|
||||
p.badChanges.error("Current release date in changes.csv and %s is not identical", u)
|
||||
}
|
||||
}
|
||||
|
||||
if p.markChecked(u, mask) {
|
||||
continue
|
||||
}
|
||||
p.checkTLS(u)
|
||||
|
||||
// Check if the filename is conforming.
|
||||
p.badFilenames.use()
|
||||
if !util.ConformingFileName(filepath.Base(u)) {
|
||||
p.badFilenames.error("%s does not have a conforming filename.", u)
|
||||
}
|
||||
|
||||
var folderYear *int
|
||||
if m := yearFromURL.FindStringSubmatch(u); m != nil {
|
||||
year, _ := strconv.Atoi(m[1])
|
||||
folderYear = &year
|
||||
}
|
||||
|
||||
p.invalidAdvisories.use()
|
||||
|
||||
// Validate against JSON schema.
|
||||
|
|
@ -741,14 +750,6 @@ func (p *processor) integrity(
|
|||
case date.UTC().Year() != *folderYear:
|
||||
p.badFolders.error("%s should be in folder %d", u, date.UTC().Year())
|
||||
}
|
||||
if len(p.times) > 0 && p.badChanges.used() {
|
||||
current, fault := p.extractTime(doc, `current_release_date`, u)
|
||||
if fault != "" {
|
||||
p.badChanges.error(fault)
|
||||
} else if t, ok := p.times[f.URL()]; !ok || !current.Equal(t) {
|
||||
p.badChanges.error("Current release date in changes.csv and %s is not identical", u)
|
||||
}
|
||||
}
|
||||
|
||||
// Check hashes
|
||||
p.badIntegrities.use()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue