From 6677d8f1d50a2e51947dac137d126d37614a6255 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 28 Aug 2022 12:03:34 +0200 Subject: Replace remaining golang.org/x/crypto/ssh/terminal ref with golang.org/x/term Fixes https://github.com/rfjakob/gocryptfs/issues/681 Fixes 2a25c3a8fda1f0918fd76687561b1a9c615298b9 --- internal/readpassword/read.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal') diff --git a/internal/readpassword/read.go b/internal/readpassword/read.go index 498d09b..3ad3bb4 100644 --- a/internal/readpassword/read.go +++ b/internal/readpassword/read.go @@ -9,7 +9,7 @@ import ( "os/exec" "strings" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) @@ -31,7 +31,7 @@ func Once(extpass []string, passfile []string, prompt string) ([]byte, error) { if prompt == "" { prompt = "Password" } - if !terminal.IsTerminal(int(os.Stdin.Fd())) { + if !term.IsTerminal(int(os.Stdin.Fd())) { return readPasswordStdin(prompt) } return readPasswordTerminal(prompt + ": ") @@ -46,7 +46,7 @@ func Twice(extpass []string, passfile []string) ([]byte, error) { if len(extpass) != 0 { return readPasswordExtpass(extpass) } - if !terminal.IsTerminal(int(os.Stdin.Fd())) { + if !term.IsTerminal(int(os.Stdin.Fd())) { return readPasswordStdin("Password") } p1, err := readPasswordTerminal("Password: ") @@ -72,8 +72,8 @@ func Twice(extpass []string, passfile []string) ([]byte, error) { func readPasswordTerminal(prompt string) ([]byte, error) { fd := int(os.Stdin.Fd()) fmt.Fprintf(os.Stderr, prompt) - // terminal.ReadPassword removes the trailing newline - p, err := terminal.ReadPassword(fd) + // term.ReadPassword removes the trailing newline + p, err := term.ReadPassword(fd) if err != nil { return nil, fmt.Errorf("Could not read password from terminal: %v\n", err) } -- cgit v1.2.3