summaryrefslogtreecommitdiff
path: root/internal/readpassword/extpass_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-05-17 19:31:04 +0200
committerJakob Unterwurzacher2020-05-17 19:31:04 +0200
commit416080203b4dd79de857eaf7c7cc97d050e00a9f (patch)
treeed729c4cd365acc803a3d1e339eae8f1e8112f4c /internal/readpassword/extpass_test.go
parentded4bbe6456dcfaa770f2c06df46d578fcbaa97e (diff)
main: accept multiple -passfile options
Each file will be read and then concatenated for the effictive password. This can be used as a kind of multi-factor authenticiton. Fixes https://github.com/rfjakob/gocryptfs/issues/288
Diffstat (limited to 'internal/readpassword/extpass_test.go')
-rw-r--r--internal/readpassword/extpass_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/readpassword/extpass_test.go b/internal/readpassword/extpass_test.go
index b4ca8fa..9a643a5 100644
--- a/internal/readpassword/extpass_test.go
+++ b/internal/readpassword/extpass_test.go
@@ -26,7 +26,7 @@ func TestExtpass(t *testing.T) {
func TestOnceExtpass(t *testing.T) {
p1 := "lkadsf0923rdfi48rqwhdsf"
- p2 := string(Once([]string{"echo " + p1}, "", ""))
+ p2 := string(Once([]string{"echo " + p1}, nil, ""))
if p1 != p2 {
t.Errorf("p1=%q != p2=%q", p1, p2)
}
@@ -35,7 +35,7 @@ func TestOnceExtpass(t *testing.T) {
// extpass with two arguments
func TestOnceExtpass2(t *testing.T) {
p1 := "foo"
- p2 := string(Once([]string{"echo", p1}, "", ""))
+ p2 := string(Once([]string{"echo", p1}, nil, ""))
if p1 != p2 {
t.Errorf("p1=%q != p2=%q", p1, p2)
}
@@ -44,7 +44,7 @@ func TestOnceExtpass2(t *testing.T) {
// extpass with three arguments
func TestOnceExtpass3(t *testing.T) {
p1 := "foo bar baz"
- p2 := string(Once([]string{"echo", "foo", "bar", "baz"}, "", ""))
+ p2 := string(Once([]string{"echo", "foo", "bar", "baz"}, nil, ""))
if p1 != p2 {
t.Errorf("p1=%q != p2=%q", p1, p2)
}
@@ -52,7 +52,7 @@ func TestOnceExtpass3(t *testing.T) {
func TestOnceExtpassSpaces(t *testing.T) {
p1 := "mypassword"
- p2 := string(Once([]string{"cat", "passfile_test_files/file with spaces.txt"}, "", ""))
+ p2 := string(Once([]string{"cat", "passfile_test_files/file with spaces.txt"}, nil, ""))
if p1 != p2 {
t.Errorf("p1=%q != p2=%q", p1, p2)
}
@@ -60,7 +60,7 @@ func TestOnceExtpassSpaces(t *testing.T) {
func TestTwiceExtpass(t *testing.T) {
p1 := "w5w44t3wfe45srz434"
- p2 := string(Once([]string{"echo " + p1}, "", ""))
+ p2 := string(Once([]string{"echo " + p1}, nil, ""))
if p1 != p2 {
t.Errorf("p1=%q != p2=%q", p1, p2)
}