Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Asra Ali <asraa@google.com>
  • Loading branch information
asraa committed Apr 26, 2022
1 parent a675a5b commit 47035c0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkg/types/intoto/v0.0.1/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,15 @@ func (v V001Entry) IndexKeys() ([]string, error) {
result = append(result, alg+":"+ds)
}
}
predicate, err := parseSlsaPredicate(v.env.Payload)
if err == nil {
for _, s := range predicate.Predicate.Materials {
for alg, ds := range s.Digest {
result = append(result, alg+":"+ds)
// Not all in-toto statements will contain a SLSA provenance predicate.
// See https://github.com/in-toto/attestation/blob/main/spec/README.md#predicate
// for other predicates.
if predicate, err := parseSlsaPredicate(v.env.Payload); err == nil {
if predicate.Predicate.Materials != nil {
for _, s := range predicate.Predicate.Materials {
for alg, ds := range s.Digest {
result = append(result, alg+":"+ds)
}
}
}
}
Expand Down

0 comments on commit 47035c0

Please sign in to comment.