From 2cf050d69e9cab45015619e48ea96993129bab44 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 18 Feb 2018 15:22:22 +0100 Subject: main: zero password once we are done with it Overwrite the password we have got from the user with zeros once we don't need it anymore, and make sure the variable runs out of scope. --- gocryptfs-xray/xray_main.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gocryptfs-xray') diff --git a/gocryptfs-xray/xray_main.go b/gocryptfs-xray/xray_main.go index 85470ec..522878a 100644 --- a/gocryptfs-xray/xray_main.go +++ b/gocryptfs-xray/xray_main.go @@ -67,6 +67,9 @@ func dumpMasterKey(fn string) { exitcodes.Exit(err) } fmt.Println(hex.EncodeToString(masterkey)) + for i := range pw { + pw[i] = 0 + } } func inspectCiphertext(fd *os.File) { -- cgit v1.2.3