aboutsummaryrefslogtreecommitdiff
path: root/internal/readpassword/extpass_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-02-18 14:26:54 +0100
committerJakob Unterwurzacher2018-02-18 14:26:54 +0100
commit3b8f5cbb17c964224456bb36b096feafb0e24f44 (patch)
tree1caae8dbf736510b971790b94c1975b325dfe377 /internal/readpassword/extpass_test.go
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 'internal/readpassword/extpass_test.go')
-rw-r--r--internal/readpassword/extpass_test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/readpassword/extpass_test.go b/internal/readpassword/extpass_test.go
index 4af775a..cdfea4e 100644
--- a/internal/readpassword/extpass_test.go
+++ b/internal/readpassword/extpass_test.go
@@ -8,6 +8,8 @@ import (
"github.com/rfjakob/gocryptfs/internal/tlog"
)
+var testPw = []byte("test")
+
func TestMain(m *testing.M) {
// Shut up info output
tlog.Info.Enabled = false
@@ -16,7 +18,7 @@ func TestMain(m *testing.M) {
func TestExtpass(t *testing.T) {
p1 := "ads2q4tw41reg52"
- p2 := readPasswordExtpass("echo " + p1)
+ p2 := string(readPasswordExtpass("echo " + p1))
if p1 != p2 {
t.Errorf("p1=%q != p2=%q", p1, p2)
}
@@ -24,7 +26,7 @@ func TestExtpass(t *testing.T) {
func TestOnceExtpass(t *testing.T) {
p1 := "lkadsf0923rdfi48rqwhdsf"
- p2 := Once("echo " + p1)
+ p2 := string(Once("echo " + p1))
if p1 != p2 {
t.Errorf("p1=%q != p2=%q", p1, p2)
}
@@ -32,7 +34,7 @@ func TestOnceExtpass(t *testing.T) {
func TestTwiceExtpass(t *testing.T) {
p1 := "w5w44t3wfe45srz434"
- p2 := Once("echo " + p1)
+ p2 := string(Once("echo " + p1))
if p1 != p2 {
t.Errorf("p1=%q != p2=%q", p1, p2)
}