diff options
author | Jakob Unterwurzacher | 2018-12-15 17:09:38 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2018-12-15 17:09:38 +0100 |
commit | 295d432175292dbaef572093d784aab55f5c0b8f (patch) | |
tree | d5db468806d211d0ea5bbd589dad3a0a337de714 /main.go | |
parent | b29ee62749244d1985a71f8df37a1582d9e790c9 (diff) |
passfile: directly read file instead of invoking cat
Allows better error handling, gets rid of the call to an
external program, and fixes https://github.com/rfjakob/gocryptfs/issues/278 .
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -53,7 +53,7 @@ func loadConfig(args *argContainer) (masterkey []byte, cf *configfile.ConfFile, pw = readpassword.Trezor(cf.TrezorPayload) } else { // Normal password entry - pw = readpassword.Once(args.extpass, "") + pw = readpassword.Once(args.extpass, args.passfile, "") } tlog.Info.Println("Decrypting master key") masterkey, err = cf.DecryptMasterKey(pw) @@ -93,7 +93,7 @@ func changePassword(args *argContainer) { log.Panic("empty masterkey") } tlog.Info.Println("Please enter your new password.") - newPw := readpassword.Twice(args.extpass) + newPw := readpassword.Twice(args.extpass, args.passfile) readpassword.CheckTrailingGarbage() confFile.EncryptKey(masterkey, newPw, confFile.ScryptObject.LogN()) for i := range newPw { |