aboutsummaryrefslogtreecommitdiff
path: root/internal/configfile/config_file.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-10-16 18:17:28 +0200
committerJakob Unterwurzacher2016-10-16 18:17:28 +0200
commitc487e176bd517d815315583dfc795dc629ffb20a (patch)
tree133948cbad8e84063dd034bf0295934a60424bab /internal/configfile/config_file.go
parentca3cc5eca37617d617c3e0250e3e3aa683fc2b1e (diff)
main: allow password change with -masterkey
Requested at https://github.com/rfjakob/gocryptfs/issues/28
Diffstat (limited to 'internal/configfile/config_file.go')
-rw-r--r--internal/configfile/config_file.go6
1 files changed, 5 insertions, 1 deletions
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)