aboutsummaryrefslogtreecommitdiff
path: root/cryptfs
diff options
context:
space:
mode:
Diffstat (limited to 'cryptfs')
-rw-r--r--cryptfs/cryptfs_names.go4
-rw-r--r--cryptfs/names_diriv.go12
2 files changed, 8 insertions, 8 deletions
diff --git a/cryptfs/cryptfs_names.go b/cryptfs/cryptfs_names.go
index 2a5f158..8f8486b 100644
--- a/cryptfs/cryptfs_names.go
+++ b/cryptfs/cryptfs_names.go
@@ -17,7 +17,7 @@ const (
)
// DecryptName - decrypt base64-encoded encrypted filename "cipherName"
-func (be *CryptFS) decryptName(cipherName string, iv []byte) (string, error) {
+func (be *CryptFS) DecryptName(cipherName string, iv []byte) (string, error) {
// Make sure relative symlinks still work after encryption
// by passing these through unchanged
@@ -91,7 +91,7 @@ func (be *CryptFS) TranslatePathZeroIV(path string, op int) (string, error) {
if op == OpEncrypt {
newPart = be.encryptName(part, zeroIV)
} else {
- newPart, err = be.decryptName(part, zeroIV)
+ newPart, err = be.DecryptName(part, zeroIV)
if err != nil {
return "", err
}
diff --git a/cryptfs/names_diriv.go b/cryptfs/names_diriv.go
index be7a2b1..ae8545b 100644
--- a/cryptfs/names_diriv.go
+++ b/cryptfs/names_diriv.go
@@ -7,8 +7,8 @@ import (
"strings"
)
-// readDirIV - read the "gocryptfs.diriv" file from "dir" (absolute path)
-func (be *CryptFS) readDirIV(dir string) (iv []byte, err error) {
+// readDirIV - read the "gocryptfs.diriv" file from "dir" (absolute ciphertext path)
+func (be *CryptFS) ReadDirIV(dir string) (iv []byte, err error) {
ivfile := filepath.Join(dir, DIRIV_FILENAME)
Debug.Printf("readDirIV: reading %s\n", ivfile)
iv, err = ioutil.ReadFile(ivfile)
@@ -22,7 +22,7 @@ func (be *CryptFS) readDirIV(dir string) (iv []byte, err error) {
return iv, nil
}
-// WriteDirIV - create diriv file inside "dir" (absolute path)
+// WriteDirIV - create diriv file inside "dir" (absolute ciphertext path)
// This function is exported because it is used from pathfs_frontend, main,
// and also the automated tests.
func WriteDirIV(dir string) error {
@@ -45,7 +45,7 @@ func (be *CryptFS) EncryptPathDirIV(plainPath string, rootDir string) (string, e
var encryptedNames []string
plainNames := strings.Split(plainPath, "/")
for _, plainName := range plainNames {
- iv, err := be.readDirIV(wd)
+ iv, err := be.ReadDirIV(wd)
if err != nil {
return "", err
}
@@ -66,11 +66,11 @@ func (be *CryptFS) DecryptPathDirIV(encryptedPath string, rootDir string) (strin
encryptedNames := strings.Split(encryptedPath, "/")
Debug.Printf("DecryptPathDirIV: decrypting %v\n", encryptedNames)
for _, encryptedName := range encryptedNames {
- iv, err := be.readDirIV(wd)
+ iv, err := be.ReadDirIV(wd)
if err != nil {
return "", err
}
- plainName, err := be.decryptName(encryptedName, iv)
+ plainName, err := be.DecryptName(encryptedName, iv)
if err != nil {
return "", err
}