Skip to content

hashsum: should refuse to run with contradictory bitlengths #6459

Description

@BenWiederhake

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.

Activity

  1. cakebaker commented on Dec 23, 2025

    @cakebaker
    Contributor

    Closing this issue as the --bits functionality has been removed recently with #9773

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions