summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-05-28 17:43:09 +0200
committerJakob Unterwurzacher2017-05-28 17:43:09 +0200
commitd59e7da6a6ee9883d61958ccd3ed3acb7c6ba8dc (patch)
tree3eb12e468ec99d3b47664ae7cc8e4b227799392d
parent7f5ae5f8436442c1243609d0de7fd9678f9c33d5 (diff)
gocryptfs-xray: dumpmasterkey: disable "Reading password from stdin"
...and also exit with the proper exit code when we get an error.
-rw-r--r--gocryptfs-xray/xray_main.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/gocryptfs-xray/xray_main.go b/gocryptfs-xray/xray_main.go
index 6cce1c6..85470ec 100644
--- a/gocryptfs-xray/xray_main.go
+++ b/gocryptfs-xray/xray_main.go
@@ -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))
}