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

HASH=$(...) fails silently if the wrong sha3sum is installed #144

Open
kstrauser opened this issue Jul 16, 2024 · 0 comments
Open

HASH=$(...) fails silently if the wrong sha3sum is installed #144

kstrauser opened this issue Jul 16, 2024 · 0 comments

Comments

@kstrauser
Copy link

Suppose you're on a Mac and you've run brew install sha3sum, giving you a sha3sum command that's incompatible with the expected one.

Then this line:

HASH=$(echo -n "$DATA_HEX" | xxd -r -p | (sha3sum -a Keccak256 -t || true) | sed 's/[^[:xdigit:]].*//')

writes

/opt/homebrew/bin/sha3sum: valid arguments for -a are 224 (default), 256, 384, and 512

to stderr and returns an empty value. Later on,

SIGNATURE_HEX=$(echo "$HASH" | xxd -r -p | openssl pkeyutl -sign -inkey "$ETH_KEY" | xxd -p -c 72)

will successfully sign an empty string.

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

No branches or pull requests

1 participant