Skip to content

Commit

Permalink
More CLI paranoia tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikera committed Jan 30, 2024
1 parent 375ede2 commit 1220124
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions convex-cli/src/main/java/convex/cli/key/KeyGenerate.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,14 @@ private AKeyPair generateKeyPair() {
if (cli().isInteractive()) {
passphrase=new String(cli().readPassword("Enter BIP39 passphrase: "));
} else {
cli().paranoia("Passphrase must be explicity provided");
passphrase="";
}
}
Blob bipseed;
bipseed = BIP39.getSeed(mnemonic, passphrase);
if (passphrase.isBlank()) {
cli().paranoia("Cannot use an empty passphrase for secure key generation");
}
Blob bipseed = BIP39.getSeed(mnemonic, passphrase);
AKeyPair result= BIP39.seedToKeyPair(bipseed);
return result;
} else {
Expand Down

0 comments on commit 1220124

Please sign in to comment.