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

fix: Redirect passphrase output to Standard error #343

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/tuf/main.go
Expand Up @@ -145,9 +145,9 @@ func getPassphrase(role string, confirm bool, change bool) ([]byte, error) {
// No environment variable set, so proceed prompting for new passphrase
role = fmt.Sprintf("new %s", role)
}
fmt.Printf("Enter %s keys passphrase: ", role)
fmt.Fprintf(os.Stderr, "Enter %s keys passphrase: ", role)
passphrase, err := term.ReadPassword(int(syscall.Stdin))
fmt.Println()
fmt.Fprintln(os.Stderr)
if err != nil {
return nil, err
}
Expand All @@ -156,9 +156,9 @@ func getPassphrase(role string, confirm bool, change bool) ([]byte, error) {
return passphrase, nil
}

fmt.Printf("Repeat %s keys passphrase: ", role)
fmt.Fprintf(os.Stderr, "Repeat %s keys passphrase: ", role)
confirmation, err := term.ReadPassword(int(syscall.Stdin))
fmt.Println()
fmt.Fprintln(os.Stderr)
if err != nil {
return nil, err
}
Expand Down