-
Notifications
You must be signed in to change notification settings - Fork 170
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
Add the SHA256 digest of the intoto payload into the rekor entry #764
Conversation
Signed-off-by: Bob Callaway <bcallaway@google.com>
Signed-off-by: Bob Callaway <bcallaway@google.com>
Signed-off-by: Bob Callaway <bcallaway@google.com>
Codecov Report
@@ Coverage Diff @@
## main #764 +/- ##
==========================================
- Coverage 49.15% 48.96% -0.19%
==========================================
Files 61 61
Lines 5566 5577 +11
==========================================
- Hits 2736 2731 -5
- Misses 2536 2551 +15
- Partials 294 295 +1
Continue to review full report at Codecov.
|
if err != nil { | ||
return nil, errors.Wrap(err, "decoding attestation") | ||
} | ||
attH := sha256.Sum256(decodedAttestation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you either return an error if a non sha256 algorithm enum is specified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're setting the value, its not user selectable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, looks good then!
Nice! |
Currently we are storing the digest over the entire intoto envelope in the corresponding Rekor entry. This PR adds the SHA256 digest for the envelope's payload (the base64 decoded bytes) into the log entry as well.
This also fixes the length check in
Attestation
to measure against the length of bytes after base64 decoding the payload, instead of the payload itself.@asraa @haydentherapper @SantiagoTorres