aboutsummaryrefslogtreecommitdiff
path: root/internal/configfile/config_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-03-07 21:03:05 +0100
committerJakob Unterwurzacher2017-03-07 21:05:45 +0100
commit9a0808b1ee4cca94a3178b14838b558bf03d483b (patch)
tree36f1f9fc4826503cb701a33e5a1339f43cd6be63 /internal/configfile/config_test.go
parent2f953fdb95f44078895fec9bc4d542cd371126be (diff)
configfile: HKDF feature flag should also be set for "-plaintextnames"
Diffstat (limited to 'internal/configfile/config_test.go')
-rw-r--r--internal/configfile/config_test.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/internal/configfile/config_test.go b/internal/configfile/config_test.go
index 42a0f2f..dc796ea 100644
--- a/internal/configfile/config_test.go
+++ b/internal/configfile/config_test.go
@@ -59,7 +59,7 @@ func TestLoadV2StrangeFeature(t *testing.T) {
}
}
-func TestCreateConfFile(t *testing.T) {
+func TestCreateConfDefault(t *testing.T) {
err := CreateConfFile("config_test/tmp.conf", "test", false, 10, "test", false)
if err != nil {
t.Fatal(err)
@@ -80,6 +80,27 @@ func TestCreateConfFile(t *testing.T) {
}
}
+func TestCreateConfPlaintextnames(t *testing.T) {
+ err := CreateConfFile("config_test/tmp.conf", "test", true, 10, "test", false)
+ if err != nil {
+ t.Fatal(err)
+ }
+ _, c, err := LoadConfFile("config_test/tmp.conf", "test")
+ if err != nil {
+ t.Fatal(err)
+ }
+ // Check that all expected feature flags are set
+ want := []flagIota{
+ FlagGCMIV128, FlagHKDF,
+ }
+ for _, f := range want {
+ if !c.IsFeatureFlagSet(f) {
+ t.Errorf("Feature flag %q should be set but is not", knownFlags[f])
+ }
+ }
+}
+
+// Reverse mode uses AESSIV
func TestCreateConfFileAESSIV(t *testing.T) {
err := CreateConfFile("config_test/tmp.conf", "test", false, 10, "test", true)
if err != nil {