]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/cypherpunks.ru/govpn/verifier.go
Use stderr for passphrase prompt, to prevent newclient.sh from catching it
[govpn.git] / src / cypherpunks.ru / govpn / verifier.go
index 0dc9388188ad0e1f0c29eec611e7218cae32b687..a452a50a84737231a2e0e3d28701dee10138bf23 100644 (file)
@@ -25,6 +25,7 @@ import (
        "fmt"
        "io/ioutil"
        "log"
+       "os"
        "strings"
 
        "github.com/agl/ed25519"
@@ -125,9 +126,9 @@ func KeyRead(path string) (string, error) {
        var err error
        var pass string
        if path == "" {
-               fmt.Print("Passphrase:")
+               os.Stderr.Write([]byte("Passphrase:"))
                p, err = terminal.ReadPassword(0)
-               fmt.Print("\n")
+               os.Stderr.Write([]byte("\n"))
                pass = string(p)
        } else {
                p, err = ioutil.ReadFile(path)