diff --git a/cmd/login.go b/cmd/login.go index a46a0715..898464ff 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -20,10 +20,10 @@ import ( "path/filepath" "strings" - "github.com/howeyc/gopass" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "golang.org/x/term" "github.com/mendersoftware/mender-cli/client/useradm" "github.com/mendersoftware/mender-cli/log" @@ -146,7 +146,7 @@ func (c *LoginCmd) maybeGetPassword() error { if c.password == "" { fmt.Printf("Password: ") - p, err := gopass.GetPasswdMasked() + p, err := term.ReadPassword(int(os.Stdin.Fd())) if err != nil { return err } diff --git a/go.mod b/go.mod index 7ef09840..ef69a54a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/cheggaaa/pb/v3 v3.1.7 github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.3 - github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef github.com/mendersoftware/go-lib-micro v0.0.0-20221025103319-e1f941fb3145 github.com/mendersoftware/mender-artifact v0.0.0-20250529094801-7264a90f1074 github.com/pkg/errors v0.9.1 @@ -44,7 +43,6 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/ulikunitz/xz v0.5.14 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.35.0 // indirect golang.org/x/text v0.28.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/protobuf v1.36.6 // indirect diff --git a/go.sum b/go.sum index a86c5f67..f5c363fc 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,6 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb28sjiS3i7tcKCkflWFEkHfuAgM= -github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= @@ -97,8 +95,6 @@ go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= diff --git a/licenses.csv b/licenses.csv index c190f853..cb6d0d95 100644 --- a/licenses.csv +++ b/licenses.csv @@ -5,7 +5,6 @@ github.com/fsnotify/fsnotify,BSD-3-Clause github.com/go-viper/mapstructure/v2,MIT github.com/google/uuid,BSD-3-Clause github.com/gorilla/websocket,BSD-2-Clause -github.com/howeyc/gopass,ISC github.com/klauspost/compress,Apache-2.0 github.com/klauspost/compress/internal/snapref,BSD-3-Clause github.com/klauspost/compress/zstd/internal/xxhash,MIT @@ -29,7 +28,6 @@ github.com/subosito/gotenv,MIT github.com/ulikunitz/xz,BSD-3-Clause github.com/vmihailenco/msgpack,BSD-2-Clause go.yaml.in/yaml/v3,MIT -golang.org/x/crypto/ssh/terminal,BSD-3-Clause golang.org/x/sys/unix,BSD-3-Clause golang.org/x/term,BSD-3-Clause golang.org/x/text,BSD-3-Clause diff --git a/tests/acceptance/tests/cli.py b/tests/acceptance/tests/cli.py index 0598a27e..69c72ea1 100644 --- a/tests/acceptance/tests/cli.py +++ b/tests/acceptance/tests/cli.py @@ -31,7 +31,11 @@ def run_and_enter_password(self, *argv, password=""): """Returns a CompletedProcess wrapped in CliResult""" args = [self.path] + list(argv) p = subprocess.Popen( - args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE + args, + shell=True, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, ) stdout, stderr = p.communicate(input=password.encode() + b"\n") return CliResult(p, stdout=stdout, stderr=stderr)