diff options
author | Jakob Unterwurzacher | 2017-02-12 15:35:50 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-02-12 17:59:09 +0100 |
commit | 8adfbf2dc34560df7436c89b59a9749d2dd3b78e (patch) | |
tree | b1f7a10f654a6c2e35fdc60f53770d83bff1267c /init_dir.go | |
parent | 2dd90ac19ce97544c412d90a24df0f68e66311db (diff) |
Check for trailing garbage after the password
From the comment:
// CheckTrailingGarbage tries to read one byte from stdin and exits with a
// fatal error if the read returns any data.
// This is meant to be called after reading the password, when there is no more
// data expected. This helps to catch problems with third-party tools that
// interface with gocryptfs.
Diffstat (limited to 'init_dir.go')
-rw-r--r-- | init_dir.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/init_dir.go b/init_dir.go index 89af495..bf6740e 100644 --- a/init_dir.go +++ b/init_dir.go @@ -36,6 +36,7 @@ func initDir(args *argContainer) { tlog.Info.Printf("Choose a password for protecting your files.") } password := readpassword.Twice(args.extpass) + readpassword.CheckTrailingGarbage() creator := tlog.ProgramName + " " + GitVersion err = configfile.CreateConfFile(args.config, password, args.plaintextnames, args.scryptn, creator, args.aessiv, args.raw64) if err != nil { |