summaryrefslogtreecommitdiff
path: root/internal/configfile
diff options
context:
space:
mode:
Diffstat (limited to 'internal/configfile')
-rw-r--r--internal/configfile/config_file.go6
-rw-r--r--internal/configfile/config_test.go16
2 files changed, 12 insertions, 10 deletions
diff --git a/internal/configfile/config_file.go b/internal/configfile/config_file.go
index 7a94fcb..c769b99 100644
--- a/internal/configfile/config_file.go
+++ b/internal/configfile/config_file.go
@@ -64,10 +64,8 @@ func CreateConfFile(filename string, password string, plaintextNames bool, logN
cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagDirIV])
cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagEMENames])
cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagLongNames])
- // TODO enable these and release as v1.3-beta1 once we have enough test
- // coverage. Also enable the Raw64 check in TestCreateConfFile()!
- //cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagRaw64])
- //cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagHKDF])
+ cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagRaw64])
+ cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagHKDF])
}
if aessiv {
cf.FeatureFlags = append(cf.FeatureFlags, knownFlags[FlagAESSIV])
diff --git a/internal/configfile/config_test.go b/internal/configfile/config_test.go
index 3b72536..42a0f2f 100644
--- a/internal/configfile/config_test.go
+++ b/internal/configfile/config_test.go
@@ -64,16 +64,20 @@ func TestCreateConfFile(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- _, _, err = LoadConfFile("config_test/tmp.conf", "test")
+ _, c, err := LoadConfFile("config_test/tmp.conf", "test")
if err != nil {
t.Fatal(err)
}
- // Raw64 is set by default since gocryptfs v1.3
- /*
- if !c.IsFeatureFlagSet(FlagRaw64) {
- t.Error("FlagRaw64 flag should be set but is not")
+ // Check that all expected feature flags are set
+ want := []flagIota{
+ FlagGCMIV128, FlagDirIV, FlagEMENames, FlagLongNames,
+ FlagRaw64, FlagHKDF,
+ }
+ for _, f := range want {
+ if !c.IsFeatureFlagSet(f) {
+ t.Errorf("Feature flag %q should be set but is not", knownFlags[f])
}
- */
+ }
}
func TestCreateConfFileAESSIV(t *testing.T) {