From 2bdf7d5172d3540606f098030e8ede7a3ad1dfdd Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 8 Sep 2018 12:40:29 +0200 Subject: configfile: add LoadAndDecrypt wrapper Callers that do not want to decrypt the masterkey should call plain Load(). https://github.com/rfjakob/gocryptfs/issues/258 --- tests/cli/cli_test.go | 6 +++--- tests/plaintextnames/plaintextnames_test.go | 2 +- tests/trezor/trezor_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go index 3b53181..eaa92b6 100644 --- a/tests/cli/cli_test.go +++ b/tests/cli/cli_test.go @@ -34,7 +34,7 @@ func TestMain(m *testing.M) { // Test -init flag func TestInit(t *testing.T) { dir := test_helpers.InitFS(t) - _, c, err := configfile.Load(dir+"/"+configfile.ConfDefaultName, testPw) + _, c, err := configfile.LoadAndDecrypt(dir+"/"+configfile.ConfDefaultName, testPw) if err != nil { t.Fatal(err) } @@ -51,7 +51,7 @@ func TestInitDevRandom(t *testing.T) { // Test -init with -aessiv func TestInitAessiv(t *testing.T) { dir := test_helpers.InitFS(t, "-aessiv") - _, c, err := configfile.Load(dir+"/"+configfile.ConfDefaultName, testPw) + _, c, err := configfile.LoadAndDecrypt(dir+"/"+configfile.ConfDefaultName, testPw) if err != nil { t.Fatal(err) } @@ -63,7 +63,7 @@ func TestInitAessiv(t *testing.T) { // Test -init with -reverse func TestInitReverse(t *testing.T) { dir := test_helpers.InitFS(t, "-reverse") - _, c, err := configfile.Load(dir+"/"+configfile.ConfReverseName, testPw) + _, c, err := configfile.LoadAndDecrypt(dir+"/"+configfile.ConfReverseName, testPw) if err != nil { t.Fatal(err) } diff --git a/tests/plaintextnames/plaintextnames_test.go b/tests/plaintextnames/plaintextnames_test.go index 121a4a0..cce25b6 100644 --- a/tests/plaintextnames/plaintextnames_test.go +++ b/tests/plaintextnames/plaintextnames_test.go @@ -29,7 +29,7 @@ func TestMain(m *testing.M) { // Only the PlaintextNames feature flag should be set func TestFlags(t *testing.T) { - _, cf, err := configfile.Load(cDir+"/gocryptfs.conf", testPw) + _, cf, err := configfile.LoadAndDecrypt(cDir+"/gocryptfs.conf", testPw) if err != nil { t.Fatal(err) } diff --git a/tests/trezor/trezor_test.go b/tests/trezor/trezor_test.go index 59e10cb..5e071fc 100644 --- a/tests/trezor/trezor_test.go +++ b/tests/trezor/trezor_test.go @@ -35,7 +35,7 @@ func TestInitTrezor(t *testing.T) { // vvvvvvvvvvvvv disable -extpass dir := test_helpers.InitFS(t, "-trezor", "-extpass", "") // The freshly created config file should have the Trezor feature flag set. - _, c, err := configfile.Load(dir+"/"+configfile.ConfDefaultName, nil) + c, err := configfile.Load(dir + "/" + configfile.ConfDefaultName) if err != nil { t.Fatal(err) } -- cgit v1.2.3