mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
chasquid-util: Update ReadPassword dependency
Today, we use `golang.org/x/crypto/ssh/terminal` to read passwords. That package is obsolete, replaced with `golang.org/x/term`. We couldn't move them because term wasn't compatible with Go 1.11 which was our oldest supported Go version. Now that we moved to Go 1.15 as the oldest supported version, we can do the update.
This commit is contained in:
@@ -21,11 +21,8 @@ import (
|
||||
"blitiri.com.ar/go/chasquid/internal/envelope"
|
||||
"blitiri.com.ar/go/chasquid/internal/normalize"
|
||||
"blitiri.com.ar/go/chasquid/internal/userdb"
|
||||
"golang.org/x/term"
|
||||
"google.golang.org/protobuf/encoding/prototext"
|
||||
|
||||
// TODO: Move to golang.org/x/term once we don't support Go 1.11 anymore,
|
||||
// since this one is deprecated (but still fully functional, so no rush).
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
// Usage to show users on --help or invocation errors.
|
||||
@@ -182,14 +179,14 @@ func getPassword() string {
|
||||
}
|
||||
|
||||
fmt.Printf("Password: ")
|
||||
p1, err := terminal.ReadPassword(syscall.Stdin)
|
||||
p1, err := term.ReadPassword(syscall.Stdin)
|
||||
fmt.Printf("\n")
|
||||
if err != nil {
|
||||
Fatalf("Error reading password: %v\n", err)
|
||||
}
|
||||
|
||||
fmt.Printf("Confirm password: ")
|
||||
p2, err := terminal.ReadPassword(syscall.Stdin)
|
||||
p2, err := term.ReadPassword(syscall.Stdin)
|
||||
fmt.Printf("\n")
|
||||
if err != nil {
|
||||
Fatalf("Error reading password: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user