aboutsummaryrefslogtreecommitdiff
path: root/cmd/fscrypt/keys.go
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2021-04-22 13:53:56 +0200
committerEric Biggers <ebiggers3@gmail.com>2021-04-22 12:27:31 -0700
commitdb79840bc68f803c23477e7c093e3cff2a7633ba (patch)
treea1753ed5d100da641b1e2ddcbdf32e002a6169e7 /cmd/fscrypt/keys.go
parent0821f2a20233e390d89af47c668f9b8f08f088ad (diff)
cmd/fscrypt: use golang.org/x/term
The golang.org/x/crypto/ssh/terminal package is deprecated and merely a wrapper around golang.org/x/term. Thus, use the latter directly.
Diffstat (limited to 'cmd/fscrypt/keys.go')
-rw-r--r--cmd/fscrypt/keys.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/fscrypt/keys.go b/cmd/fscrypt/keys.go
index 33461ec..cb86404 100644
--- a/cmd/fscrypt/keys.go
+++ b/cmd/fscrypt/keys.go
@@ -28,7 +28,7 @@ import (
"os"
"github.com/pkg/errors"
- "golang.org/x/crypto/ssh/terminal"
+ "golang.org/x/term"
"github.com/google/fscrypt/actions"
"github.com/google/fscrypt/crypto"
@@ -88,13 +88,13 @@ func (p passphraseReader) Read(buf []byte) (int, error) {
func getPassphraseKey(prompt string) (*crypto.Key, error) {
// Only disable echo if stdin is actually a terminal.
- if terminal.IsTerminal(stdinFd) {
- state, err := terminal.MakeRaw(stdinFd)
+ if term.IsTerminal(stdinFd) {
+ state, err := term.MakeRaw(stdinFd)
if err != nil {
return nil, err
}
defer func() {
- terminal.Restore(stdinFd, state)
+ term.Restore(stdinFd, state)
fmt.Println() // To align input
}()
}