Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(oval/oracle): ignore fips patched version for non fips package versions #2047

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions oval/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ func isOvalDefAffected(def ovalmodels.Definition, req request, family, release s
if extractOracleKsplice(ovalPack.Version) != extractOracleKsplice(req.versionRelease) {
continue
}
if strings.HasSuffix(ovalPack.Version, "_fips") != strings.HasSuffix(req.versionRelease, "_fips") {
continue
}
case constant.SUSEEnterpriseServer:
if strings.Contains(ovalPack.Version, ".TDC.") != strings.Contains(req.versionRelease, ".TDC.") {
continue
Expand Down
64 changes: 64 additions & 0 deletions oval/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1929,6 +1929,70 @@ func TestIsOvalDefAffected(t *testing.T) {
},
affected: false,
},
// in: _fips , req: not fips
{
in: in{
family: constant.Oracle,
def: ovalmodels.Definition{
AffectedPacks: []ovalmodels.Package{
{
Name: "gnutls",
Version: "10:3.6.16-4.0.1.el8_fips",
Arch: "x86_64",
},
},
},
req: request{
packName: "gnutls",
versionRelease: "3.6.16-4.el8",
arch: "x86_64",
},
},
affected: false,
},
// in: _fips , req: _fips
{
in: in{
family: constant.Oracle,
def: ovalmodels.Definition{
AffectedPacks: []ovalmodels.Package{
{
Name: "gnutls",
Version: "10:3.6.16-8.el8_9.3_fips",
Arch: "x86_64",
},
},
},
req: request{
packName: "gnutls",
versionRelease: "10:3.6.16-4.0.1.el8_fips",
arch: "x86_64",
},
},
affected: true,
fixedIn: "10:3.6.16-8.el8_9.3_fips",
},
// in: non fips (upstream?), req: _fips
{
in: in{
family: constant.Oracle,
def: ovalmodels.Definition{
AffectedPacks: []ovalmodels.Package{
{
Name: "gnutls",
Version: "0:3.6.16-5.el8_6",
Arch: "x86_64",
},
},
},
req: request{
packName: "gnutls",
versionRelease: "10:3.6.16-4.0.1.el8_fips",
arch: "x86_64",
},
},
affected: false,
},
// same arch
{
in: in{
Expand Down
Loading