diff options
author | Jakob Unterwurzacher | 2015-11-25 19:30:32 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2015-11-25 20:57:16 +0100 |
commit | 4d466c3412918346144dff609d8f706c6f002581 (patch) | |
tree | 2624a1b9573295e6f70df6eb74be5d0f241436e7 /cryptfs | |
parent | d8bf6e7836a22c755fa0881f89d482b5e8f47e29 (diff) |
diriv: Create gocryptfs.diriv in every directory
Diffstat (limited to 'cryptfs')
-rw-r--r-- | cryptfs/cryptfs.go | 2 | ||||
-rw-r--r-- | cryptfs/cryptfs_names.go | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/cryptfs/cryptfs.go b/cryptfs/cryptfs.go index 783bfb8..63febc3 100644 --- a/cryptfs/cryptfs.go +++ b/cryptfs/cryptfs.go @@ -14,6 +14,8 @@ const ( NONCE_LEN = 12 AUTH_TAG_LEN = 16 BLOCK_OVERHEAD = NONCE_LEN + AUTH_TAG_LEN + DIRIV_LEN = 16 // identical to AES block size + DIRIV_FILENAME = "gocryptfs.diriv" ) type CryptFS struct { diff --git a/cryptfs/cryptfs_names.go b/cryptfs/cryptfs_names.go index a7a9a8c..1282f53 100644 --- a/cryptfs/cryptfs_names.go +++ b/cryptfs/cryptfs_names.go @@ -31,7 +31,7 @@ func (be *CryptFS) decryptName(cipherName string) (string, error) { } if len(bin)%aes.BlockSize != 0 { - return "", errors.New(fmt.Sprintf("Name len=%d is not a multiple of 16", len(bin))) + return "", fmt.Errorf("Decoded length %d is not a multiple of the AES block size", len(bin)) } iv := make([]byte, aes.BlockSize) // TODO ? |