summaryrefslogtreecommitdiff
path: root/cryptfs/names_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-12-08 16:13:29 +0100
committerJakob Unterwurzacher2015-12-08 16:17:04 +0100
commitc6dacd6f913b4c6eb7a8917af49190dce32db108 (patch)
treec0fd9a08f42c37bd977b95d2bb0a7c96226045c1 /cryptfs/names_test.go
parentff8c81f95b311eb1cd9c822202519f1a90a8cdd4 (diff)
Add EME filename encryption & enable it by default
Diffstat (limited to 'cryptfs/names_test.go')
-rw-r--r--cryptfs/names_test.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/cryptfs/names_test.go b/cryptfs/names_test.go
index 1ad3391..6dffae3 100644
--- a/cryptfs/names_test.go
+++ b/cryptfs/names_test.go
@@ -5,7 +5,7 @@ import (
"testing"
)
-func TestTranslatePath(t *testing.T) {
+func TestEncryptPathNoIV(t *testing.T) {
var s []string
s = append(s, "foo")
s = append(s, "foo12312312312312312313123123123")
@@ -15,15 +15,14 @@ func TestTranslatePath(t *testing.T) {
fs := NewCryptFS(key, true, false)
for _, n := range s {
- c, err := fs.TranslatePathZeroIV(n, OpEncrypt)
- d, err := fs.TranslatePathZeroIV(c, OpDecrypt)
+ c := fs.EncryptPathNoIV(n)
+ d, err := fs.DecryptPathNoIV(c)
if err != nil {
- t.Errorf("Got error from DecryptName: %s", err)
+ t.Errorf("Got error from DecryptPathNoIV: %s", err)
}
if d != n {
- t.Errorf("Content mismatch, n=\"%s\" d=\"%s\"", n, d)
+ t.Errorf("Content mismatch, n != d: n=%s c=%s d=%s", n, c, d)
}
- //fmt.Printf("n=%s c=%s d=%s\n", n, c, d)
}
}