cryptdecode: use Cipher instead of NewFs (#2087)

* crypt: extract NewCipher out of NewFs
* cryptdecode: make use of crypt.NewCipher

Fixes #2075
This commit is contained in:
Fabian Möller 2018-02-25 12:57:14 +01:00 committed by GitHub
parent aeefa34f62
commit 00adf40f9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 40 deletions

View file

@ -91,6 +91,8 @@ type Cipher interface {
EncryptedSize(int64) int64
// DecryptedSize calculates the size of the data when decrypted
DecryptedSize(int64) (int64, error)
// NameEncryptionMode returns the used mode for name handling
NameEncryptionMode() NameEncryptionMode
}
// NameEncryptionMode is the type of file name encryption in use
@ -547,6 +549,10 @@ func (c *cipher) DecryptDirName(in string) (string, error) {
return c.decryptFileName(in)
}
func (c *cipher) NameEncryptionMode() NameEncryptionMode {
return c.mode
}
// nonce is an NACL secretbox nonce
type nonce [fileNonceSize]byte