aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse/reverse_diriv.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-09-25 11:20:10 +0200
committerJakob Unterwurzacher2016-09-25 16:43:17 +0200
commit7bbf6ad6eae47974b1162af13915785a541b9bb9 (patch)
tree88371ab9828c0dd415d78db1999267afd5432913 /internal/fusefrontend_reverse/reverse_diriv.go
parent3a9bd92754e3b6984c97f7012fd5f030d7f8e46c (diff)
reverse: derive file ID and block IVs from file paths
Diffstat (limited to 'internal/fusefrontend_reverse/reverse_diriv.go')
-rw-r--r--internal/fusefrontend_reverse/reverse_diriv.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/internal/fusefrontend_reverse/reverse_diriv.go b/internal/fusefrontend_reverse/reverse_diriv.go
index df3a4d1..88d0680 100644
--- a/internal/fusefrontend_reverse/reverse_diriv.go
+++ b/internal/fusefrontend_reverse/reverse_diriv.go
@@ -9,10 +9,9 @@ import (
"github.com/rfjakob/gocryptfs/internal/nametransform"
)
-// deriveDirIV derives the DirIV from the encrypted directory path by
-// hashing it
-func deriveDirIV(dirPath string) []byte {
- hash := sha256.Sum256([]byte(dirPath))
+// derivePathIV derives an IV from an encrypted path by hashing it
+func derivePathIV(path string) []byte {
+ hash := sha256.Sum256([]byte(path))
return hash[:nametransform.DirIVLen]
}
@@ -22,5 +21,5 @@ func (rfs *reverseFS) newDirIVFile(cRelPath string) (nodefs.File, fuse.Status) {
if err != nil {
return nil, fuse.ToStatus(err)
}
- return rfs.NewVirtualFile(deriveDirIV(cDir), absDir)
+ return rfs.NewVirtualFile(derivePathIV(cDir), absDir)
}