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

Remove trees.Hash. #2456

Merged
merged 1 commit into from
Apr 9, 2021
Merged

Remove trees.Hash. #2456

merged 1 commit into from
Apr 9, 2021

Conversation

pphaneuf
Copy link
Contributor

@pphaneuf pphaneuf commented Apr 8, 2021

Part of #2245.

Checklist

@google-cla google-cla bot added the cla: yes label Apr 8, 2021
@codecov
Copy link

codecov bot commented Apr 8, 2021

Codecov Report

Merging #2456 (6f59d3b) into master (eb97fe2) will decrease coverage by 0.02%.
The diff coverage is 75.00%.

❗ Current head 6f59d3b differs from pull request most recent head 5a0285d. Consider uploading reports for the commit 5a0285d to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2456      +/-   ##
==========================================
- Coverage   66.02%   65.99%   -0.03%     
==========================================
  Files         104      103       -1     
  Lines        7119     7061      -58     
==========================================
- Hits         4700     4660      -40     
+ Misses       1912     1900      -12     
+ Partials      507      501       -6     
Impacted Files Coverage Δ
crypto/signer.go 0.00% <0.00%> (-91.67%) ⬇️
log/sequencer.go 73.78% <ø> (-0.13%) ⬇️
log/sequencer_manager.go 50.00% <100.00%> (-20.97%) ⬇️
storage/tools/dump_tree/dumplib.go 40.78% <100.00%> (-0.16%) ⬇️
client/log_client.go 78.29% <0.00%> (+1.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c69173...5a0285d. Read the comment docs.

@pphaneuf pphaneuf requested review from Martin2112 and pav-kv April 9, 2021 12:37
@pphaneuf pphaneuf marked this pull request as ready for review April 9, 2021 12:38
@pphaneuf pphaneuf requested a review from a team as a code owner April 9, 2021 12:38
return fmt.Errorf("trees.Hash()=%v, want: nil", err)
}
hasher := hasherFn.New()
hasher := crypto.SHA256.New()
Copy link
Contributor

@pav-kv pav-kv Apr 9, 2021

Choose a reason for hiding this comment

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

Should we still verify that tree.HashAlgorithm == sigpb.DigitallySigned_SHA256, or it's done elsewhere? Perhaps in the place where tree is obtained.

Copy link
Contributor

@pav-kv pav-kv Apr 9, 2021

Choose a reason for hiding this comment

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

Ah, no need to do it in the the tests. What about the main code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what I figured (that it was ok in the tests)... At the one "real" call site (Signer, in trees.go), I replaced the call with a check that it is the expected algorithm.

@pphaneuf pphaneuf merged commit 461b11a into google:master Apr 9, 2021
@pphaneuf pphaneuf deleted the no_hash branch April 9, 2021 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants