]> Cypherpunks.ru repositories - govpn.git/commitdiff
fix password read on windows, `0` isn't Stdin on windows
authorBruno Clermont <bruno@robotinfra.com>
Wed, 8 Feb 2017 10:32:49 +0000 (18:32 +0800)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 14 Feb 2017 12:00:11 +0000 (15:00 +0300)
src/cypherpunks.ru/govpn/verifier.go

index 168342fe4dbb5649259b0b10dd4ceb0dd23aba66..d5976ec8529aa059222219e809055bb8c2018153 100644 (file)
@@ -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 {