Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Use cfg(fuzzing) instead of a fuzztarget feature and don't allow 0-hashes. #111

Merged
merged 3 commits into from
Mar 12, 2021

Conversation

TheBlueMatt
Copy link
Member

rust-bitcoin/rust-secp256k1#264 starts enforcing that 32 bytes of 0s is an invalid private key in fuzzing, which breaks downstream applications which don't bother to check for the sha256-is-broken case. rust-bitcoin/rust-secp256k1#282 keeps that behavior, so best to no longer return 0 hashes from sha256 at all. We also update to use the new fuzzing cfg which is nicer anyway.

Its harder to misuse an explicit cfg flag than a feature flag, and
the rust-fuzzing ecosystem already sets the `fuzzing` cfg for us.
This prevents downstream software that wishes to use SHA256 output
as private keys from needing to handle the 0-hash case explicitly.
Copy link
Contributor

@sgeisler sgeisler left a comment

Choose a reason for hiding this comment

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

utACK a786fd3

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ack a786fd3

@apoelstra apoelstra merged commit d780cb0 into rust-bitcoin:master Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants