Remove CRUD funcs of CveContents

This commit is contained in:
Kota Kanbe
2017-05-10 11:43:10 +09:00
committed by kota kanbe
parent dd5a7920e5
commit b285cb0e57
5 changed files with 12 additions and 47 deletions

View File

@@ -73,7 +73,8 @@ func (o Debian) fillOvalInfo(r *models.ScanResult, definition *ovalmodels.Defini
}
} else {
cveContents := vinfo.CveContents
if _, ok := vinfo.CveContents.Get(models.NewCveContentType(r.Family)); ok {
ctype := models.NewCveContentType(r.Family)
if _, ok := vinfo.CveContents[ctype]; ok {
util.Log.Infof("%s will be updated by OVAL", definition.Debian.CveID)
} else {
util.Log.Infof("%s is also detected by OVAL", definition.Debian.CveID)
@@ -82,7 +83,7 @@ func (o Debian) fillOvalInfo(r *models.ScanResult, definition *ovalmodels.Defini
if vinfo.Confidence.Score < models.OvalMatch.Score {
vinfo.Confidence = models.OvalMatch
}
cveContents.Upsert(ovalContent)
cveContents[ctype] = ovalContent
vinfo.CveContents = cveContents
}
r.ScannedCves[definition.Debian.CveID] = vinfo

View File

@@ -70,7 +70,7 @@ func (o Redhat) fillOvalInfo(r *models.ScanResult, definition *ovalmodels.Defini
}
} else {
cveContents := vinfo.CveContents
if _, ok := vinfo.CveContents.Get(models.RedHat); ok {
if _, ok := vinfo.CveContents[models.RedHat]; ok {
util.Log.Infof("%s will be updated by OVAL", cve.CveID)
} else {
util.Log.Infof("%s is also detected by OVAL", cve.CveID)
@@ -80,7 +80,7 @@ func (o Redhat) fillOvalInfo(r *models.ScanResult, definition *ovalmodels.Defini
if vinfo.Confidence.Score < models.OvalMatch.Score {
vinfo.Confidence = models.OvalMatch
}
cveContents.Upsert(ovalContent)
cveContents[models.RedHat] = ovalContent
vinfo.CveContents = cveContents
}
r.ScannedCves[cve.CveID] = vinfo