Skip to content

Commit 422d9b8

Browse files
Mikhail Swiftcolek42
authored andcommitted
chore: add additional debug logging during verify
Adds some debug logging when an envelope is skipped due to signature verification or marshalling errors during witness verify. Signed-off-by: Mikhail Swift <mikhail@testifysec.com>
1 parent bbfe5a2 commit 422d9b8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/verify.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/testifysec/witness/pkg/cryptoutil"
2424
"github.com/testifysec/witness/pkg/dsse"
2525
"github.com/testifysec/witness/pkg/intoto"
26+
"github.com/testifysec/witness/pkg/log"
2627
"github.com/testifysec/witness/pkg/policy"
2728
)
2829

@@ -96,11 +97,13 @@ func Verify(policyEnvelope dsse.Envelope, policyVerifiers []cryptoutil.Verifier,
9697
for _, env := range vo.collectionEnvelopes {
9798
passedVerifiers, err := env.Verify(dsse.WithVerifiers(pubkeys), dsse.WithRoots(roots), dsse.WithIntermediates(intermediates))
9899
if err != nil {
100+
log.Debugf("(verify) skipping envelope: couldn't verify enveloper's signature with the policy's verifiers: %+v", err)
99101
continue
100102
}
101103

102104
statement := intoto.Statement{}
103105
if err := json.Unmarshal(env.Payload, &statement); err != nil {
106+
log.Debugf("(verify) skipping envelope: couldn't unmarshal envelope payload into in-toto statement: %+v", err)
104107
continue
105108
}
106109

0 commit comments

Comments
 (0)