From c487e176bd517d815315583dfc795dc629ffb20a Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 16 Oct 2016 18:17:28 +0200 Subject: main: allow password change with -masterkey Requested at https://github.com/rfjakob/gocryptfs/issues/28 --- internal/configfile/config_file.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'internal') diff --git a/internal/configfile/config_file.go b/internal/configfile/config_file.go index 79960e4..97a1f3a 100644 --- a/internal/configfile/config_file.go +++ b/internal/configfile/config_file.go @@ -139,7 +139,11 @@ func LoadConfFile(filename string, password string) ([]byte, *ConfFile, error) { return nil, nil, fmt.Errorf("Deprecated filesystem") } - + if password == "" { + // We have validated the config file, but without a password we cannot + // decrypt the master key. Return only the parsed config. + return nil, &cf, nil + } // Generate derived key from password scryptHash := cf.ScryptObject.DeriveKey(password) -- cgit v1.2.3