diff --git a/cmd/ssh-chat/key.go b/cmd/ssh-chat/key.go index 470efa4..534879e 100644 --- a/cmd/ssh-chat/key.go +++ b/cmd/ssh-chat/key.go @@ -4,9 +4,10 @@ import ( "fmt" "io/ioutil" "os" + "syscall" - "github.com/howeyc/gopass" "golang.org/x/crypto/ssh" + "golang.org/x/term" ) // ReadPrivateKey attempts to read your private key and possibly decrypt it if it @@ -24,8 +25,8 @@ func ReadPrivateKey(path string) (ssh.Signer, error) { } else if _, ok := err.(*ssh.PassphraseMissingError); ok { passphrase := []byte(os.Getenv("IDENTITY_PASSPHRASE")) if len(passphrase) == 0 { - fmt.Print("Enter passphrase: ") - passphrase, err = gopass.GetPasswd() + fmt.Println("Enter passphrase to unlock identity private key:", path) + passphrase, err = term.ReadPassword(int(syscall.Stdin)) if err != nil { return nil, fmt.Errorf("couldn't read passphrase: %v", err) }