summaryrefslogtreecommitdiff
path: root/pathfs_frontend
AgeCommit message (Collapse)Author
2016-02-06Move pathfs_frontend to internal/fusefrontendJakob Unterwurzacher
"git status" for reference: renamed: pathfs_frontend/args.go -> internal/fusefrontend/args.go renamed: pathfs_frontend/compat_darwin.go -> internal/fusefrontend/compat_darwin.go renamed: pathfs_frontend/compat_linux.go -> internal/fusefrontend/compat_linux.go renamed: pathfs_frontend/file.go -> internal/fusefrontend/file.go renamed: pathfs_frontend/file_holes.go -> internal/fusefrontend/file_holes.go renamed: pathfs_frontend/fs.go -> internal/fusefrontend/fs.go renamed: pathfs_frontend/fs_dir.go -> internal/fusefrontend/fs_dir.go renamed: pathfs_frontend/names.go -> internal/fusefrontend/names.go renamed: pathfs_frontend/write_lock.go -> internal/fusefrontend/write_lock.go modified: main.go
2016-02-06Major refactoring: Split up "cryptfs" into several internal packagesJakob Unterwurzacher
"git status" for reference: deleted: cryptfs/cryptfs.go deleted: cryptfs/names_core.go modified: integration_tests/cli_test.go modified: integration_tests/helpers.go renamed: cryptfs/config_file.go -> internal/configfile/config_file.go renamed: cryptfs/config_test.go -> internal/configfile/config_test.go renamed: cryptfs/config_test/.gitignore -> internal/configfile/config_test/.gitignore renamed: cryptfs/config_test/PlaintextNames.conf -> internal/configfile/config_test/PlaintextNames.conf renamed: cryptfs/config_test/StrangeFeature.conf -> internal/configfile/config_test/StrangeFeature.conf renamed: cryptfs/config_test/v1.conf -> internal/configfile/config_test/v1.conf renamed: cryptfs/config_test/v2.conf -> internal/configfile/config_test/v2.conf renamed: cryptfs/kdf.go -> internal/configfile/kdf.go renamed: cryptfs/kdf_test.go -> internal/configfile/kdf_test.go renamed: cryptfs/cryptfs_content.go -> internal/contentenc/content.go new file: internal/contentenc/content_api.go renamed: cryptfs/content_test.go -> internal/contentenc/content_test.go renamed: cryptfs/file_header.go -> internal/contentenc/file_header.go renamed: cryptfs/intrablock.go -> internal/contentenc/intrablock.go renamed: cryptfs/address_translation.go -> internal/contentenc/offsets.go new file: internal/cryptocore/crypto_api.go renamed: cryptfs/gcm_go1.4.go -> internal/cryptocore/gcm_go1.4.go renamed: cryptfs/gcm_go1.5.go -> internal/cryptocore/gcm_go1.5.go renamed: cryptfs/nonce.go -> internal/cryptocore/nonce.go renamed: cryptfs/openssl_aead.go -> internal/cryptocore/openssl_aead.go renamed: cryptfs/openssl_benchmark.bash -> internal/cryptocore/openssl_benchmark.bash renamed: cryptfs/openssl_test.go -> internal/cryptocore/openssl_test.go new file: internal/nametransform/name_api.go new file: internal/nametransform/names_core.go renamed: cryptfs/names_diriv.go -> internal/nametransform/names_diriv.go renamed: cryptfs/names_noiv.go -> internal/nametransform/names_noiv.go renamed: cryptfs/names_test.go -> internal/nametransform/names_test.go new file: internal/nametransform/pad16.go renamed: cryptfs/log.go -> internal/toggledlog/log.go renamed: cryptfs/log_go1.4.go -> internal/toggledlog/log_go1.4.go renamed: cryptfs/log_go1.5.go -> internal/toggledlog/log_go1.5.go modified: main.go modified: masterkey.go modified: pathfs_frontend/file.go modified: pathfs_frontend/file_holes.go modified: pathfs_frontend/fs.go modified: pathfs_frontend/fs_dir.go modified: pathfs_frontend/names.go modified: test.bash
2016-02-06Rename DirIVCacheEnc to just DirIVCacheJakob Unterwurzacher
...and unexport dirIVCache
2016-01-31Don't print plain text directory name in "Invalid name" warningJakob Unterwurzacher
2016-01-31Add new "-wpanic" option and enable it for the automated testsJakob Unterwurzacher
2016-01-25Convert fdLock to an RWMutex and protect the whole transactionJakob Unterwurzacher
...against concurrent closes. The testcase (set -e; while true; do truncate -s $RANDOM b; done) & (set -e; while true; do truncate -s $RANDOM b; done) & uncovered lots of unnecessary RMW failures that were the result of concurrent closes. With this patch, the only remaining error is "Truncate on forgotten file" that is probably caused by a problem in the go-fuse lib ( https://github.com/hanwen/go-fuse/issues/95 )
2016-01-24Only warn once for unsupported fallocate(2) and truncate(2)Jakob Unterwurzacher
Also, print the inode number in Ftruncate warnings.
2016-01-24Add per-inode write mutexJakob Unterwurzacher
At the moment, FUSE writes to a single file are serialized by the kernel. However, it is unclear if this is guaranteed behaviour or may change in the future. This patch adds our own per-inode write lock to rule out races regardless of kernel behavoir.
2016-01-20Convert logging to standard Go log.LoggerJakob Unterwurzacher
This is in preparation of logging to syslog.
2016-01-09OSX: Fix build failure caused by syntax errorsJakob Unterwurzacher
2016-01-07Disable fallocate on OSX (not available and causes a build failure)Jakob Unterwurzacher
2015-12-19Increase GCM IV size from 96 to 128 bitsJakob Unterwurzacher
This pushes back the birthday bound for collisions to make it virtually irrelevant.
2015-12-19diriv: handle directory rename over directoryJakob Unterwurzacher
If an empty directory is overwritten we will always get ENOTEMPTY as the "empty" directory will still contain gocryptfs.diriv. Handle that case by removing the target directory and trying again. Fixes issue #10
2015-12-13go fmtJakob Unterwurzacher
...and minimal comment changes.
2015-12-13Handle EINTR returned by FallocateJakob Unterwurzacher
Fallocate can return EINTR (interrupted system call) and does so quite often when cpu profiling is enabled.
2015-12-11Rmdir: handle creating and removing unreadable directoriesJakob Unterwurzacher
This patch also splits off Mkdir and Rmdir into its own file. Fixes issue #8, thanks to @diseq for the bug report.
2015-12-10Add missing PlaintextNames checks in OpenDir, Mkdir, Rmdir, initDirJakob Unterwurzacher
Plaintextnames support has bitrotted during the DirIV additions, this needs test cases. Will be added in a future patch. Fixes issue #9.
2015-12-08Add EME filename encryption & enable it by defaultJakob Unterwurzacher
2015-12-08go fmtJakob Unterwurzacher
2015-12-06fallocate the space needed for the file header beforehandJakob Unterwurzacher
This makes sure writing to a file fails early if the underlying filesystem does not support fallocate. It also prevents partial header write due to ENOSPC.
2015-12-06Fix rename, was broken broken by DirIV introductionJakob Unterwurzacher
As it was, CIPHERDIR was prepended twice, causing every rename to fail with ENOENT.
2015-11-29Run go fmtJakob Unterwurzacher
2015-11-29Add single-element cache for DirIV lookupJakob Unterwurzacher
Another 3x performance boost for applications that walk the directory tree. Excerpt from performance.txt: VERSION UNTAR LS RM v0.4 48 1.5 5 v0.5-rc1 56 7 19 v0.5-rc1-1 54 4.1 9 v0.5-rc1-2 45 1.7 3.4 <---- THIS VERSION
2015-11-29OpenDir performance: Read DirIV once and reuse it for all namesJakob Unterwurzacher
Formerly, we called decryptPath for every name. That resulted in a directory walk that reads in all diriv files on the way. Massive improvement for RM and LS (check performance.txt for details) VERSION UNTAR RM LS v0.4 48 5 1.5 v0.5-rc1 56 19 7 v0.5-rc1-1 54 9 4.1 <---- THIS VERSION
2015-11-28diriv: also support old CBC symlinkJakob Unterwurzacher
2015-11-28diriv: fix Symlink() and Readlink()Jakob Unterwurzacher
Both were missing adaptions for diriv usage resulting in broken functionality
2015-11-28diriv: fix readdirJakob Unterwurzacher
It decrypted all file names using the root directory iv
2015-11-28diriv: use "DirIV" flag to discern and support mounting old filesystemsJakob Unterwurzacher
2015-11-27Run go fmtJakob Unterwurzacher
2015-11-27diriv: Move WriteDirIV() to cryptfs; add locking to Mkdir, RmdirJakob Unterwurzacher
2015-11-27diriv: Convert filename encryption users to dirivJakob Unterwurzacher
2015-11-25diriv: Transactionally delete gocryptfs.diriv in RmdirJakob Unterwurzacher
2015-11-25diriv: Create gocryptfs.diriv in every directoryJakob Unterwurzacher
2015-11-14Run go fmt and go vetJakob Unterwurzacher
2015-11-09Add "-q" (quiet) flagJakob Unterwurzacher
2015-11-08Handle ENOSPC errors better by preallocating the space before writingJakob Unterwurzacher
Prevent the case that we run out of space in the middle of writing a block - that would leave a corrupt block behind.
2015-11-03Centralize path filter decision in CryptFS.IsFiltered()Jakob Unterwurzacher
2015-11-03Implement PlainTextNames modeJakob Unterwurzacher
Also, forbid access to "gocryptfs.conf" in the root dir.
2015-11-01Remove code detected by "deadcode"Jakob Unterwurzacher
go get github.com/remyoudompheng/go-misc/deadcode
2015-11-01Refactor ciphertext <-> plaintext offset translation functionsJakob Unterwurzacher
Move all the intelligence into the new file address_translation.go. That the calculations were spread out too much became apparent when adding the file header. This should make the code much easier to modify in the future.
2015-11-01Add file header (on-disk-format change)Jakob Unterwurzacher
Format: [ "Version" uint16 big endian ] [ "Id" 16 random bytes ] Quoting SECURITY.md: * Every file has a header that contains a 16-byte random *file id* * Each block uses the file id and its block number as GCM *authentication data* * This means the position of the blocks is protected as well. The blocks can not be reordered or copied between different files without causing an decryption error.
2015-10-06Use block number as authentication dataJakob Unterwurzacher
2015-10-04Utimens: Use UtimesNano instead of FutimesJakob Unterwurzacher
Futimes() only takes microsecond resolution while the FUSE call Utimens() wants nanosecond precision. This is why UTIME_OMIT did not work - this change fixes the xfstests generic/258 test failure. The go library does not provide a FutimesNano() function which is why I use UtimesNano() on /proc/self/fd/n. This is what the Go library does in Futimes().
2015-10-04fallocate: return ENOSYSJakob Unterwurzacher
The implementation was incomplete, disable fallocate completely for now. See https://github.com/rfjakob/gocryptfs/issues/1 Fixes xfstests generic/075
2015-10-04truncate: Fix bug that caused xfstests generic/030 to failJakob Unterwurzacher
The bug was caused by using cipherOff where plainOff should have been used. Renamed the symbols for less confusion.
2015-10-04Truncate: Logging improvements, show number of blocks as floatJakob Unterwurzacher
2015-10-04Fix Trucate() bug causing files to be too smallJakob Unterwurzacher
Uncovered by running xfstests generic/014 several times
2015-10-04Run go fmtJakob Unterwurzacher
2015-10-04intraBlock: Rename Offset to SkipJakob Unterwurzacher
"Offset" is unclear whether it is an offset from the start of file or start of block. "Skip" seems much better.
2015-10-04Utilize file hole passtrough capability in Truncate()Jakob Unterwurzacher
Cuts down the runtime of xfstests generic/014 from 1822 seconds to 36 seconds