Repository navigation
fix(yubihsm): refuse a secp256k1 priv_validator key instead of panicking - #12
Merged
Merged
Conversation
aeddi
force-pushed
the
yubihsm-import-rejects-secp256k1
branch
from
November 4, 2026 11:35
fd0b80b to
891734d
Compare
aeddi
marked this pull request as ready for review
November 4, 2026 11:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tmkms yubihsm keys importcrashed when a priv_validator key file held a secp256k1 key —with
-t json, or with no-twhen the file is namedpriv_validator_key.json, since bothtake the same path. The file parses fine, since
PrivValidatorKeyaccepts both key types, andthe command then reached an
unreachable!()and exited 101 with "entered unreachablecode". It now exits with an error that names the file and says an Ed25519 consensus key is
required — the same wording the softsign provider uses when it loads such a file as a
consensus key (FORK.md entry 10).
Changes
2e7d3792e7d379,b2d5ca0,fd0b80b72e33ca4537133Testing
code". After, it exits 1, and the error names the file and asks for an Ed25519 key.
the secret. Parsing accepts any key that can be a consensus key, and secp256k1 can, so the
command reaches the branch under test.
cargo clippy --all-featuresis clean.