Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #113 from tendermint/112_fix_yubihsm_import
Browse files Browse the repository at this point in the history
import 32-byte seed instead of 64-byte key-pair
  • Loading branch information
liamsi authored Nov 23, 2018
2 parents fbb8483 + bb50a35 commit 5de45fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/yubihsm/keys/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ impl Callable for ImportCommand {
process::exit(1);
});

let key = base64::decode(s).unwrap_or_else(|e| {
let key_pair = base64::decode(s).unwrap_or_else(|e| {
status_err!("couldn't decode validator private key from config: {}", e);
process::exit(1);
});
Seed::from_keypair(&key).unwrap_or_else(|e| {
let seed = Seed::from_keypair(&key_pair).unwrap_or_else(|e| {
status_err!("invalid key in validator config: {}", e);
process::exit(1);
});
let key = seed.as_secret_slice();
let label =
yubihsm::ObjectLabel::from(self.label.as_ref().map(|l| l.as_ref()).unwrap_or(""));

Expand Down

0 comments on commit 5de45fb

Please sign in to comment.