summaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse/rfs.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/rfs.go
parent3a9bd92754e3b6984c97f7012fd5f030d7f8e46c (diff)
reverse: derive file ID and block IVs from file paths
Diffstat (limited to 'internal/fusefrontend_reverse/rfs.go')
-rw-r--r--internal/fusefrontend_reverse/rfs.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go
index 9ebf91c..6089d41 100644
--- a/internal/fusefrontend_reverse/rfs.go
+++ b/internal/fusefrontend_reverse/rfs.go
@@ -226,15 +226,7 @@ func (rfs *reverseFS) Open(relPath string, flags uint32, context *fuse.Context)
if rfs.isFiltered(relPath) {
return nil, fuse.EPERM
}
- absPath, err := rfs.abs(rfs.decryptPath(relPath))
- if err != nil {
- return nil, fuse.ToStatus(err)
- }
- f, err := os.OpenFile(absPath, int(flags), 0666)
- if err != nil {
- return nil, fuse.ToStatus(err)
- }
- return NewFile(f, rfs.contentEnc)
+ return rfs.NewFile(relPath, flags)
}
// OpenDir - FUSE readdir call
@@ -258,7 +250,7 @@ func (rfs *reverseFS) OpenDir(cipherPath string, context *fuse.Context) ([]fuse.
nVirtual := 1
// Encrypt names
- dirIV := deriveDirIV(cipherPath)
+ dirIV := derivePathIV(cipherPath)
for i := range entries {
var cName string
// ".gocryptfs.reverse.conf" in the root directory is mapped to "gocryptfs.conf"