From d0bc7970f721cee607d993406d97d32e2c660abe Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 5 Mar 2017 21:59:55 +0100 Subject: full stack: implement HKDF support ...but keep it disabled by default for new filesystems. We are still missing an example filesystem and CLI arguments to explicitely enable and disable it. --- internal/fusefrontend/args.go | 6 +++++- internal/fusefrontend/fs.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'internal/fusefrontend') diff --git a/internal/fusefrontend/args.go b/internal/fusefrontend/args.go index c111dbf..f76848d 100644 --- a/internal/fusefrontend/args.go +++ b/internal/fusefrontend/args.go @@ -19,8 +19,12 @@ type Args struct { // to "gocryptfs.conf" in the plaintext dir. ConfigCustom bool // Raw64 is true when RawURLEncoding (without padding) should be used for - // file names + // file names. + // Corresponds to the Raw64 feature flag introduced in gocryptfs v1.2. Raw64 bool // NoPrealloc disables automatic preallocation before writing NoPrealloc bool + // Use HKDF key derivation. + // Corresponds to the HKDF feature flag introduced in gocryptfs v1.3. + HKDF bool } diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go index e0fdc48..020032b 100644 --- a/internal/fusefrontend/fs.go +++ b/internal/fusefrontend/fs.go @@ -40,7 +40,7 @@ var _ pathfs.FileSystem = &FS{} // Verify that interface is implemented. // NewFS returns a new encrypted FUSE overlay filesystem. func NewFS(args Args) *FS { - cryptoCore := cryptocore.New(args.Masterkey, args.CryptoBackend, contentenc.DefaultIVBits) + cryptoCore := cryptocore.New(args.Masterkey, args.CryptoBackend, contentenc.DefaultIVBits, args.HKDF) contentEnc := contentenc.New(cryptoCore, contentenc.DefaultBS) nameTransform := nametransform.New(cryptoCore.EMECipher, args.LongNames, args.Raw64) -- cgit v1.2.3