Skip to content
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

compute payload and envelope hashes upon validating intoto proposed entries #967

Merged
merged 2 commits into from Aug 12, 2022

Conversation

bobcallaway
Copy link
Member

This ensures that the server-side values used by IndexKeys() are computed during validation time rather than deferring it to when the indices are requested. This also ensures that client-provided values for these digests are not used when computing the list of indices.

Fixes #854

Previously the digest of the envelope contents was computed before
returning the canonicalized byte stream that is inserted into the log,
but was not stored in the internal object representation so it was not
available when IndexKeys was called. This fixes it to be available, and
also has the benefit of ignoring the client provided value (as we should
be relying only on server side computations for these keys).

Signed-off-by: Bob Callaway <bcallaway@google.com>
Signed-off-by: Bob Callaway <bcallaway@google.com>
@bobcallaway bobcallaway requested a review from asraa August 11, 2022 21:01
@codecov-commenter
Copy link

Codecov Report

Merging #967 (4a93e33) into main (102dc64) will decrease coverage by 0.13%.
The diff coverage is 73.33%.

@@            Coverage Diff             @@
##             main     #967      +/-   ##
==========================================
- Coverage   48.20%   48.06%   -0.14%     
==========================================
  Files          61       61              
  Lines        5383     5413      +30     
==========================================
+ Hits         2595     2602       +7     
- Misses       2506     2528      +22     
- Partials      282      283       +1     
Impacted Files Coverage Δ
pkg/types/intoto/v0.0.1/entry.go 56.22% <73.33%> (+0.12%) ⬆️
pkg/types/alpine/v0.0.1/entry.go 53.52% <0.00%> (-0.68%) ⬇️
pkg/types/rpm/v0.0.1/entry.go 55.59% <0.00%> (-0.66%) ⬇️
pkg/types/helm/v0.0.1/entry.go 48.29% <0.00%> (-0.63%) ⬇️
pkg/types/jar/v0.0.1/entry.go 38.83% <0.00%> (-0.58%) ⬇️
pkg/types/tuf/v0.0.1/entry.go 41.86% <0.00%> (-0.52%) ⬇️
pkg/types/rekord/v0.0.1/entry.go 48.34% <0.00%> (-0.49%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful clean-up too! Thank you so, so much!

@bobcallaway bobcallaway merged commit 5ab865e into sigstore:main Aug 12, 2022
@github-actions github-actions bot added this to the v1.0.0 milestone Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IndexKeys is run on pre-canonicalized entries
4 participants