summaryrefslogtreecommitdiff
path: root/tests/cli
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-02-18 14:26:54 +0100
committerJakob Unterwurzacher2018-02-18 14:26:54 +0100
commit3b8f5cbb17c964224456bb36b096feafb0e24f44 (patch)
tree1caae8dbf736510b971790b94c1975b325dfe377 /tests/cli
parent14c063428dcded6a1060395bb45bf7bd5d185738 (diff)
readpassword: convert from string to []byte
This will allows us to overwrite the password with zeros once we are done with it. https://github.com/rfjakob/gocryptfs/issues/211
Diffstat (limited to 'tests/cli')
-rw-r--r--tests/cli/cli_test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go
index c7752f2..9eebc5f 100644
--- a/tests/cli/cli_test.go
+++ b/tests/cli/cli_test.go
@@ -16,6 +16,8 @@ import (
"github.com/rfjakob/gocryptfs/tests/test_helpers"
)
+var testPw = []byte("test")
+
func TestMain(m *testing.M) {
test_helpers.ResetTmpDir(false)
r := m.Run()
@@ -25,7 +27,7 @@ func TestMain(m *testing.M) {
// Test -init flag
func TestInit(t *testing.T) {
dir := test_helpers.InitFS(t)
- _, c, err := configfile.LoadConfFile(dir+"/"+configfile.ConfDefaultName, "test")
+ _, c, err := configfile.LoadConfFile(dir+"/"+configfile.ConfDefaultName, testPw)
if err != nil {
t.Fatal(err)
}
@@ -42,7 +44,7 @@ func TestInitDevRandom(t *testing.T) {
// Test -init with -aessiv
func TestInitAessiv(t *testing.T) {
dir := test_helpers.InitFS(t, "-aessiv")
- _, c, err := configfile.LoadConfFile(dir+"/"+configfile.ConfDefaultName, "test")
+ _, c, err := configfile.LoadConfFile(dir+"/"+configfile.ConfDefaultName, testPw)
if err != nil {
t.Fatal(err)
}
@@ -54,7 +56,7 @@ func TestInitAessiv(t *testing.T) {
// Test -init with -reverse
func TestInitReverse(t *testing.T) {
dir := test_helpers.InitFS(t, "-reverse")
- _, c, err := configfile.LoadConfFile(dir+"/"+configfile.ConfReverseName, "test")
+ _, c, err := configfile.LoadConfFile(dir+"/"+configfile.ConfReverseName, testPw)
if err != nil {
t.Fatal(err)
}