aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-09-08 12:40:29 +0200
committerJakob Unterwurzacher2018-09-08 12:40:29 +0200
commit2bdf7d5172d3540606f098030e8ede7a3ad1dfdd (patch)
treea32afb70805dbc0c4915d0b800016ea3f31214b0 /main.go
parent09d28c293e2f4142cda8dbfee0741aee7213748d (diff)
configfile: add LoadAndDecrypt wrapper
Callers that do not want to decrypt the masterkey should call plain Load(). https://github.com/rfjakob/gocryptfs/issues/258
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.go b/main.go
index 26d09f5..ac12d2e 100644
--- a/main.go
+++ b/main.go
@@ -36,7 +36,7 @@ var raceDetector bool
func loadConfig(args *argContainer) (masterkey []byte, confFile *configfile.ConfFile, err error) {
// First check if the file can be read at all, and find out if a Trezor should
// be used instead of a password.
- _, cf1, err := configfile.Load(args.config, nil)
+ cf1, err := configfile.Load(args.config)
if err != nil {
tlog.Fatal.Printf("Cannot open config file: %v", err)
return nil, nil, err
@@ -56,7 +56,7 @@ func loadConfig(args *argContainer) (masterkey []byte, confFile *configfile.Conf
pw = readpassword.Once(args.extpass, "")
}
tlog.Info.Println("Decrypting master key")
- masterkey, confFile, err = configfile.Load(args.config, pw)
+ masterkey, confFile, err = configfile.LoadAndDecrypt(args.config, pw)
for i := range pw {
pw[i] = 0
}
@@ -73,7 +73,7 @@ func loadConfig(args *argContainer) (masterkey []byte, confFile *configfile.Conf
func changePassword(args *argContainer) {
// Parse the config file, but do not unlock the master key. We only want to
// know if the Trezor flag is set.
- _, cf1, err := configfile.Load(args.config, nil)
+ cf1, err := configfile.Load(args.config)
if err != nil {
tlog.Fatal.Printf("Cannot open config file: %v", err)
os.Exit(exitcodes.LoadConf)