diff options
author | Jakob Unterwurzacher | 2017-05-28 18:09:02 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-05-30 17:04:46 +0200 |
commit | 857507e8b100626ae0471fae793efc52bf552821 (patch) | |
tree | 155ff21467d8b35887e9a7fd984d37e23f7e6e70 /internal/fusefrontend_reverse/rfs.go | |
parent | 4d2cc551cf6fa71e425fad8f397e96d69f016a6b (diff) |
fusefrontend_reverse: move pathiv to its own package
We will also need it in forward mode.
Diffstat (limited to 'internal/fusefrontend_reverse/rfs.go')
-rw-r--r-- | internal/fusefrontend_reverse/rfs.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go index 06bbfe9..63384ac 100644 --- a/internal/fusefrontend_reverse/rfs.go +++ b/internal/fusefrontend_reverse/rfs.go @@ -16,6 +16,7 @@ import ( "github.com/rfjakob/gocryptfs/internal/cryptocore" "github.com/rfjakob/gocryptfs/internal/fusefrontend" "github.com/rfjakob/gocryptfs/internal/nametransform" + "github.com/rfjakob/gocryptfs/internal/pathiv" "github.com/rfjakob/gocryptfs/internal/tlog" ) @@ -263,7 +264,7 @@ func (rfs *ReverseFS) OpenDir(cipherPath string, context *fuse.Context) ([]fuse. nVirtual := 1 // Encrypt names - dirIV := derivePathIV(cipherPath, ivPurposeDirIV) + dirIV := pathiv.Derive(cipherPath, pathiv.PurposeDirIV) for i := range entries { var cName string // ".gocryptfs.reverse.conf" in the root directory is mapped to "gocryptfs.conf" @@ -305,7 +306,7 @@ func (rfs *ReverseFS) Readlink(cipherPath string, context *fuse.Context) (string if rfs.args.PlaintextNames { return plainTarget, fuse.OK } - nonce := derivePathIV(cipherPath, ivPurposeSymlinkIV) + nonce := pathiv.Derive(cipherPath, pathiv.PurposeSymlinkIV) // Symlinks are encrypted like file contents and base64-encoded cBinTarget := rfs.contentEnc.EncryptBlockNonce([]byte(plainTarget), 0, nil, nonce) cTarget := rfs.nameTransform.B64.EncodeToString(cBinTarget) |