Skip to content

Commit

Permalink
generate_sbom: do not clobber spdx supplier
Browse files Browse the repository at this point in the history
Broken by accident in commit 2e7e791
  • Loading branch information
mlschroe committed Sep 19, 2024
1 parent 1e04a1e commit 96c2c49
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions generate_sbom
Original file line number Diff line number Diff line change
Expand Up @@ -672,18 +672,27 @@ sub gen_pkg_id {
# CycloneDX support
#

my $cyclonedx_json_template_supplier = {
'_order' => [ qw{bom-ref name address url contact} ],
'contact' => { '_order' => [ qw{name email} ] },
};

my $cyclonedx_json_template_component = {
'_order' => [ qw{bom-ref type name version description cpe purl externalReferences properties } ],
'_order' => [ qw{bom-ref type supplier manufacturer authors name version description cpe purl externalReferences properties } ],
'externalReferences' => { '_order' => [ qw{url comment type} ] },
'supplier' => $cyclonedx_json_template_supplier,
'manufacturer' => $cyclonedx_json_template_supplier,
};

my $cyclonedx_json_template = {
'_order' => [ qw{bomFormat specVersion serialNumber version metadata components services externalReferences dependencies compositions vulnerabilities signature} ],
'version' => 'number',
'metadata' => {
'_order' => [ qw{timestamp tools component} ],
'_order' => [ qw{timestamp tools manufacturer authors component supplier} ],
'tools' => { '_order' => [ qw{vendor name version } ] }.
'component' => $cyclonedx_json_template_component,
'supplier' => $cyclonedx_json_template_supplier,
'manufacturer' => $cyclonedx_json_template_supplier,
},
'components' => $cyclonedx_json_template_component,
'dependencies' => { '_order' => [ qw{ref dependsOn} ] }
Expand Down Expand Up @@ -818,11 +827,11 @@ sub spdx_encode_pkg {
'name' => $p->{'NAME'},
'versionInfo' => $evr,
};
$spdx->{'supplier'} = 'NOASSERTION';
if ($p->{'VENDOR'}) {
$spdx->{'originator'} = "Organization: $p->{'VENDOR'}";
$spdx->{'supplier'} = $spdx->{'originator'}; # same as originator OBS-247
}
$spdx->{'supplier'} = 'NOASSERTION';
$spdx->{'downloadLocation'} = 'NOASSERTION';

if ($pkgtype eq 'deb') {
Expand Down

0 comments on commit 96c2c49

Please sign in to comment.