aboutsummaryrefslogtreecommitdiff
path: root/internal/readpassword
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-02-18 15:33:35 +0100
committerJakob Unterwurzacher2018-02-18 15:36:14 +0100
commitadf7d75d31889e2dbd52c15efdecf3a8304c0bc1 (patch)
tree98d42397b506c5d05bdfd1bb4155b3907f45c40a /internal/readpassword
parent2cf050d69e9cab45015619e48ea96993129bab44 (diff)
main: changePassword: zero masterkey
Overwrite the masterkey with zeros once we have encrypted it, and let it run out of scope. Also get rid of the password duplicate in readpassword.Twice.
Diffstat (limited to 'internal/readpassword')
-rw-r--r--internal/readpassword/read.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/readpassword/read.go b/internal/readpassword/read.go
index 047eba9..e2fce8a 100644
--- a/internal/readpassword/read.go
+++ b/internal/readpassword/read.go
@@ -49,6 +49,10 @@ func Twice(extpass string) []byte {
tlog.Fatal.Println("Passwords do not match")
os.Exit(exitcodes.ReadPassword)
}
+ // Wipe the password duplicate from memory
+ for i := range p2 {
+ p2[i] = 0
+ }
return p1
}