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:
parent
7f5ae5f843
commit
d59e7da6a6
@ -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))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user