Skip to content

Commit

Permalink
fix: Ask user to confirm generated passphrase before invocing pinentry
Browse files Browse the repository at this point in the history
This is to avoid users not seeing their generated password if using e.g.
pinentry curses UI.

Fixes #3030

Signed-off-by: Dominik Schulz <[email protected]>
  • Loading branch information
dominikschulz committed Jan 12, 2025
1 parent b6140bc commit 528aeef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/action/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ func (s *Action) initGenerateIdentity(ctx context.Context, crypto backend.Crypto
if pwGenerated {
out.Printf(ctx, color.MagentaString("Passphrase: ")+passphrase)
out.Noticef(ctx, "You need to remember this very well!")

// Prompt to confirm that the user noted their passphrase
if want, err := termio.AskForBool(ctx, "Did you save your passphrase?", true); err != nil || !want {
return fmt.Errorf("user did not confirm saving the passphrase: %w", err)
}
}

out.Notice(ctx, "🔐 We need to unlock your newly created private key now! Please enter the passphrase you just generated.")
Expand Down

0 comments on commit 528aeef

Please sign in to comment.