aboutsummaryrefslogtreecommitdiff
path: root/internal/configfile/config_file.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-08-20 15:57:40 +0200
committerJakob Unterwurzacher2021-08-20 15:57:40 +0200
commit2a9dea2973a6141e8efdf8bd26d8ddb2d2c35fc4 (patch)
tree3af78126e573b5a9963111c1bdea6f8d1100fbd1 /internal/configfile/config_file.go
parent195d9d18a90d88ff2cb0530d832c59d98934fd1f (diff)
-deterministic-names: accept flag on -init
And store it in gocryptfs.conf (=remove DirIV feature flag).
Diffstat (limited to 'internal/configfile/config_file.go')
-rw-r--r--internal/configfile/config_file.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/configfile/config_file.go b/internal/configfile/config_file.go
index 40dda38..b54bd51 100644
--- a/internal/configfile/config_file.go
+++ b/internal/configfile/config_file.go
@@ -80,7 +80,8 @@ func randBytesDevRandom(n int) []byte {
// "password" and write it to "filename".
// Uses scrypt with cost parameter logN.
func Create(filename string, password []byte, plaintextNames bool,
- logN int, creator string, aessiv bool, devrandom bool, fido2CredentialID []byte, fido2HmacSalt []byte) error {
+ logN int, creator string, aessiv bool, devrandom bool,
+ fido2CredentialID []byte, fido2HmacSalt []byte, deterministicNames bool) error {
var cf ConfFile
cf.filename = filename
cf.Creator = creator
@@ -92,7 +93,9 @@ func Create(filename string, password []byte, plaintextNames bool,
if plaintextNames {
cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagPlaintextNames])
} else {
- cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagDirIV])
+ if !deterministicNames {
+ cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagDirIV])
+ }
cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagEMENames])
cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagLongNames])
cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagRaw64])