gocryptfs-xray: dumpmasterkey: disable "Reading password from stdin"

...and also exit with the proper exit code when we get an error.
This commit is contained in:
Jakob Unterwurzacher 2017-05-28 17:43:09 +02:00
parent 7f5ae5f843
commit d59e7da6a6

View File

@ -10,7 +10,9 @@ import (
"github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/readpassword"
"github.com/rfjakob/gocryptfs/internal/tlog"
)
const (
@ -57,10 +59,12 @@ func main() {
}
func dumpMasterKey(fn string) {
tlog.Info.Enabled = false
pw := readpassword.Once("")
masterkey, _, err := configfile.LoadConfFile(fn, pw)
if err != nil {
fmt.Fprintln(os.Stderr, err)
exitcodes.Exit(err)
}
fmt.Println(hex.EncodeToString(masterkey))
}