Skip to content

Commit 314e7f8

Browse files
authored
Merge pull request #20204 from mlschroe/master
BSConSign, BSRekor: prepare for spdx v3
2 parents a4e5101 + addd4d6 commit 314e7f8

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/backend/BSConSign.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ our $mt_intoto = 'application/vnd.in-toto+json';
3636
our $mt_cosign_bundle = 'application/vnd.dev.sigstore.bundle.v0.3+json';
3737

3838
our $intoto_predicate_spdx = 'https://spdx.dev/Document';
39+
our $intoto_predicate_spdx_v3 = 'https://spdx.dev/Document/v3';
3940
our $intoto_predicate_cyclonedx = 'https://cyclonedx.org/bom';
4041
our $intoto_predicate_cosign_sign_v1 = 'https://sigstore.dev/cosign/sign/v1';
4142
our $intoto_stmt_v01 = 'https://in-toto.io/Statement/v0.1';
@@ -198,6 +199,7 @@ sub fixup_intoto_attestation {
198199
my $predicate_type;
199200
# autodetect predicate type
200201
$predicate_type = $intoto_predicate_spdx if $attestation->{'spdxVersion'};
202+
$predicate_type = $intoto_predicate_spdx_v3 if $attestation->{'@context'} && $attestation->{'@context'} =~ /\/3\.\d+\.\d+\/spdx-context.jsonld$/;
201203
$predicate_type = $intoto_predicate_cyclonedx if ($attestation->{'bomFormat'} || '') eq 'CycloneDX';
202204
# wrap into an in-toto v0.1 attestation
203205
$attestation = { '_type' => $intoto_stmt_v01, 'predicateType' => $predicate_type, 'predicate' => $attestation } if $predicate_type;

src/backend/BSRekor.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ our $intoto_slsav_v01 = "https://slsa.dev/provenance/v0.1";
3333
our $intoto_slsav_v02 = "https://slsa.dev/provenance/v0.2";
3434
our $intoto_slsa_v1 = "https://slsa.dev/provenance/v1";
3535
our $intoto_spdx = "https://spdx.dev/Document";
36+
our $intoto_spdx_v3 = "https://spdx.dev/Document/v3";
3637
our $intoto_link_v1 = "https://in-toto.io/Link/v1";
3738
our $intoto_cosign_v1 = "cosign.sigstore.dev/attestation/v1";
3839
our $intoto_vuln_v1 = "cosign.sigstore.dev/attestation/vuln/v1";

0 commit comments

Comments
 (0)