From 8adfbf2dc34560df7436c89b59a9749d2dd3b78e Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 12 Feb 2017 15:35:50 +0100 Subject: 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. --- init_dir.go | 1 + 1 file changed, 1 insertion(+) (limited to 'init_dir.go') 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 { -- cgit v1.2.3