summaryrefslogtreecommitdiff
path: root/gocryptfs-xray/xray_main.go
diff options
context:
space:
mode:
Diffstat (limited to 'gocryptfs-xray/xray_main.go')
-rw-r--r--gocryptfs-xray/xray_main.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/gocryptfs-xray/xray_main.go b/gocryptfs-xray/xray_main.go
index b99268b..e68e463 100644
--- a/gocryptfs-xray/xray_main.go
+++ b/gocryptfs-xray/xray_main.go
@@ -154,10 +154,19 @@ func dumpMasterKey(fn string, fido2Path string) {
pw = readpassword.Once(nil, nil, "")
}
masterkey, err := cf.DecryptMasterKey(pw)
- fmt.Println(hex.EncodeToString(masterkey))
+ // Purge password from memory
for i := range pw {
pw[i] = 0
}
+ if err != nil {
+ tlog.Fatal.Println(err)
+ os.Exit(exitcodes.LoadConf)
+ }
+ fmt.Println(hex.EncodeToString(masterkey))
+ // Purge masterkey from memory
+ for i := range masterkey {
+ masterkey[i] = 0
+ }
}
func inspectCiphertext(fd *os.File, aessiv bool) {