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

hashsum: should refuse to run with contradictory bitlengths #6459

Open
BenWiederhake opened this issue Jun 10, 2024 · 0 comments
Open

hashsum: should refuse to run with contradictory bitlengths #6459

BenWiederhake opened this issue Jun 10, 2024 · 0 comments
Assignees

Comments

@BenWiederhake
Copy link
Collaborator

Doesn't work as hashsum

$ cargo run -q hashsum --sha3-512 --bits 256 README.md
5bde479913538c7f932e8521719ab5ffea4e7b12b68905a9c147341090d8f738165f5a30fc5d2c05a320d500dcf912e40c77f78ae3236a9118a1be2e5fe35340  README.md

Doesn't work as sha3sum

Tightly related, perhaps the same bug:

$ cargo build -p uu_hashsum
$ ln -s target/debug/hashsum sha3sum
$ ./sha3sum README.md 
./sha3sum: --bits required for SHA3
[$? = 1]
$ ./sha3sum --bits 256 README.md 
./sha3sum: --bits required for SHA3
[$? = 1]
$ ./sha3sum --bits 256 --bits 256 README.md 
./sha3sum: --bits required for SHA3
[$? = 1]

Doesn't work as sha3-384sum

$ cargo build -p uu_hashsum
$ ln -s target/debug/hashsum sha3-384sum
$ ./sha3-384sum README.md 
./sha3-384sum: --bits required for SHA3
[$? = 1]
$ ./sha3-384sum --bits 256 README.md 
error: unexpected argument '--bits' found

  tip: to pass '--bits' as a value, use '-- --bits'

Usage: ./sha3-384sum [OPTIONS] [FILE]...

For more information, try '--help'.
[$? = 1]

Found while reading #6431, still applies to current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants