From fe06e9f45646893dc88ebe9e657e2e991f6f5fbb Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 8 Apr 2019 20:18:45 +0200 Subject: readpassword: delete CheckTrailingGarbage CheckTrailingGarbage was called even when "-passfile" was used, which is stupid, and causes false positives: https://github.com/rfjakob/gocryptfs/issues/391 (false error "Received trailing garbage after the password" when using -passfile in .bash_profile) Instead of trying to improve the logic to handle that case and make everything even more complicated, delete the function. It is unclear if actually helps in some cases, and it definitely harms as shown by the above bug report. --- main.go | 1 - 1 file changed, 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 09c8ed7..02cc4ad 100644 --- a/main.go +++ b/main.go @@ -94,7 +94,6 @@ func changePassword(args *argContainer) { } tlog.Info.Println("Please enter your new password.") newPw := readpassword.Twice([]string(args.extpass), args.passfile) - readpassword.CheckTrailingGarbage() confFile.EncryptKey(masterkey, newPw, confFile.ScryptObject.LogN()) for i := range newPw { newPw[i] = 0 -- cgit v1.2.3