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

tendermint: Constant time hash equality #1094

Open
thanethomson opened this issue Feb 15, 2022 · 5 comments
Open

tendermint: Constant time hash equality #1094

thanethomson opened this issue Feb 15, 2022 · 5 comments
Labels
domain-types Anything relating to the creation, modification or removal of domain types enhancement New feature or request security

Comments

@thanethomson
Copy link
Contributor

Version(s) of tendermint-rs: master, v0.23.x

Description

At present we have two Hash types in tendermint-rs: one in the tendermint-rpc crate in abci::transaction::Hash and one in the tendermint crate in the hash module.

I'm currently (in #1092) looking at removing the one in the tendermint-rpc crate and replacing it with the one from the tendermint crate to deduplicate this domain type. The one in the tendermint-rpc crate, however, implements subtle::ConstantTimeEq and the one in tendermint doesn't.

Perhaps @tony-iqlusion or @hdevalence would like to weigh in here, but I'd think that it'd be important to implement subtle::ConstantTimeEq for the tendermint::hash::Hash struct. The fact that we don't implement it for tendermint::hash::Hash may actually be a problem (part of the reason I raised this issue simply being for awareness).

Definition of "done"

When tendermint::hash::Hash implements subtle::ConstantTimeEq.

@thanethomson thanethomson added enhancement New feature or request domain-types Anything relating to the creation, modification or removal of domain types security labels Feb 15, 2022
@tony-iqlusion
Copy link
Collaborator

When does the Hash type represent a secret value? Aren't they always computed over public chain data?

Or in other words: what attack/sidechannel is possible here?

@thanethomson
Copy link
Contributor Author

When does the Hash type represent a secret value? Aren't they always computed over public chain data?

Good question. What was the initial reasoning in having ConstantTimeEq implemented for tendermint_rpc::abci::transaction::Hash? See a6670f0 - do you perhaps remember?

@tony-iqlusion
Copy link
Collaborator

Haha wow, I did that, did I? Retroactively I have no justification for it. I'd probably suggest it's unneeded and just moving to derived Eq/PartialEq.

@thanethomson
Copy link
Contributor Author

No problem 🙂 I'll remove it. We can always add it back in future if it becomes apparent we're hashing sensitive data.

@thanethomson
Copy link
Contributor Author

thanethomson commented Feb 15, 2022

Actually, I'll keep this issue open until I've removed it.

@thanethomson thanethomson reopened this Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain-types Anything relating to the creation, modification or removal of domain types enhancement New feature or request security
Projects
None yet
Development

No branches or pull requests

2 participants