diff options
author | Jakob Unterwurzacher | 2019-05-13 23:01:44 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2019-05-13 23:01:44 +0200 |
commit | 991adfc934d714897e3c0ad39d37fca3edf59bcb (patch) | |
tree | 6c63f27a46ea35d6244d3b5cd125e883bff05d5a /tests/cli | |
parent | 2cb0e8a1aeb42920f965956995d99cd2c8dbaa67 (diff) |
-passwd now takes a passed -scryptn flag into account
https://github.com/rfjakob/gocryptfs/issues/400
Diffstat (limited to 'tests/cli')
-rw-r--r-- | tests/cli/cli_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go index 7b6736a..da9d508 100644 --- a/tests/cli/cli_test.go +++ b/tests/cli/cli_test.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "os" "os/exec" + "strconv" "syscall" "testing" "time" @@ -92,6 +93,9 @@ func TestInitReverse(t *testing.T) { } } +// testPasswd changes the password from "test" to "test" using +// the -extpass method, then from "test" to "newpasswd" using the +// stdin method. func testPasswd(t *testing.T, dir string, extraArgs ...string) { // Change password using "-extpass" args := []string{"-q", "-passwd", "-extpass", "echo test"} @@ -225,6 +229,23 @@ func TestPasswdReverse(t *testing.T) { testPasswd(t, dir, "-reverse") } +// Test -passwd with -scryptn +func TestPasswdScryptn(t *testing.T) { + dir := test_helpers.InitFS(t) + cf, err := configfile.Load(dir + "/gocryptfs.conf") + if err != nil { + t.Fatal(err) + } + testPasswd(t, dir, "-scryptn", strconv.Itoa(cf.ScryptObject.LogN()+1)) + cf2, err := configfile.Load(dir + "/gocryptfs.conf") + if err != nil { + t.Fatal(err) + } + if cf2.ScryptObject.LogN() != cf.ScryptObject.LogN()+1 { + t.Errorf("wrong logN value %d", cf2.ScryptObject.LogN()) + } +} + // Test -init & -config flag func TestInitConfig(t *testing.T) { config := test_helpers.TmpDir + "/TestInitConfig.conf" |