diff options
author | Jakob Unterwurzacher | 2018-02-18 15:22:22 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2018-02-18 15:22:22 +0100 |
commit | 2cf050d69e9cab45015619e48ea96993129bab44 (patch) | |
tree | 097ed3e3da99be30861614804e1e886dff15b76f /init_dir.go | |
parent | 3b8f5cbb17c964224456bb36b096feafb0e24f44 (diff) |
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.
Diffstat (limited to 'init_dir.go')
-rw-r--r-- | init_dir.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/init_dir.go b/init_dir.go index b13f741..ea902ec 100644 --- a/init_dir.go +++ b/init_dir.go @@ -45,8 +45,9 @@ func initDir(args *argContainer) { tlog.Fatal.Println(err) os.Exit(exitcodes.WriteConf) } - // Note: cannot overwrite password because in Go, strings are - // read-only byte slices. + for i := range password { + password[i] = 0 + } // password runs out of scope here } // Forward mode with filename encryption enabled needs a gocryptfs.diriv |