From: Bruno Clermont Date: Wed, 8 Feb 2017 10:32:49 +0000 (+0800) Subject: fix password read on windows, `0` isn't Stdin on windows X-Git-Url: http://www.git.cypherpunks.ru/?p=govpn.git;a=commitdiff_plain;h=3decfef4083189743e1d8aba6dc7c1970d5170a3 fix password read on windows, `0` isn't Stdin on windows --- diff --git a/src/cypherpunks.ru/govpn/verifier.go b/src/cypherpunks.ru/govpn/verifier.go index 168342f..d5976ec 100644 --- a/src/cypherpunks.ru/govpn/verifier.go +++ b/src/cypherpunks.ru/govpn/verifier.go @@ -28,6 +28,7 @@ import ( "log" "os" "strings" + "syscall" "cypherpunks.ru/balloon" "github.com/agl/ed25519" @@ -138,7 +139,7 @@ func KeyRead(path string) (string, error) { var pass string if path == "" { os.Stderr.Write([]byte("Passphrase:")) - p, err = terminal.ReadPassword(0) + p, err = terminal.ReadPassword(int(uintptr(syscall.Stdin))) os.Stderr.Write([]byte("\n")) pass = string(p) } else {