Commit Graph

1341 Commits

Author SHA1 Message Date
Jakob Unterwurzacher
37a9b4c3ee Enable openssl in tests to support old Go versions
Go 1.4 and older do not support 128-bit IVs which caused
the tests to panic.
2016-03-03 00:59:58 +01:00
Jakob Unterwurzacher
b5221c9651 Fix Go 1.4 build failure caused by a refactoring oversight 2016-03-03 00:48:32 +01:00
Jakob Unterwurzacher
653d4a619c longnames part II: Rename, Unlink, Rmdir, Mknod, Mkdir + tests 2016-02-07 14:02:09 +01:00
Jakob Unterwurzacher
2a11906963 tests: do not create gocryptfs.diriv if plaintextnames==true 2016-02-07 13:28:55 +01:00
Jakob Unterwurzacher
6b5d977cce Move OpenDir to fs_dir.go 2016-02-07 11:29:54 +01:00
Jakob Unterwurzacher
3a4922b5d7 Add tests for long name creation and renaming (currently failing, obviously) 2016-02-07 10:55:13 +01:00
Jakob Unterwurzacher
e111e20649 longnames part I: Create and OpenDir work with long filenames > 176 bytes
Todo: Rename, Unlink, Rmdir, Mknod, Mkdir
2016-02-06 22:54:14 +01:00
Jakob Unterwurzacher
5abd9cec13 travis: run all tests in "internal" 2016-02-06 22:53:38 +01:00
Jakob Unterwurzacher
6b27b6a1e7 Move dirIVCache to its own file 2016-02-06 20:27:28 +01:00
Jakob Unterwurzacher
9b6894bdbf test.bash: Accept flags 2016-02-06 20:25:18 +01:00
Jakob Unterwurzacher
c74772bc8d Run go fmt 2016-02-06 20:23:36 +01:00
Jakob Unterwurzacher
b0ee5258b1 Fix tests - were broken by the refactoring 2016-02-06 20:22:45 +01:00
Jakob Unterwurzacher
9078a77850 Move pathfs_frontend to internal/fusefrontend
"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-06 19:27:59 +01:00
Jakob Unterwurzacher
2b8cbd9441 Major refactoring: Split up "cryptfs" into several internal packages
"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-06 19:22:35 +01:00
Jakob Unterwurzacher
adcfbd79a8 Rename DirIVCacheEnc to just DirIVCache
...and unexport dirIVCache
2016-02-06 12:27:55 +01:00
Jakob Unterwurzacher
1573efec98 Don't print plain text directory name in "Invalid name" warning 2016-01-31 18:30:39 +01:00
Jakob Unterwurzacher
6454db68d9 Add new "-wpanic" option and enable it for the automated tests 2016-01-31 18:09:39 +01:00
Jakob Unterwurzacher
4c9e249e3a Convert fdLock to an RWMutex and protect the whole transaction
...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-25 00:51:28 +01:00
Jakob Unterwurzacher
4259c8f7eb Only warn once for unsupported fallocate(2) and truncate(2)
Also, print the inode number in Ftruncate warnings.
2016-01-24 19:43:21 +01:00
Jakob Unterwurzacher
8fb32aab68 Downgrade "gocryptfs.diriv not found" warning if the directory was deleted
The directory may have been concurrently deleted or moved. Failure to
read the diriv is not an error in that case.

Downgrading the message to debug.
2016-01-24 19:40:53 +01:00
Jakob Unterwurzacher
65b8d5bc46 Update MANPAGE with new options 2016-01-24 18:20:52 +01:00
Jakob Unterwurzacher
9ecb489c66 Allow "-d" as an alis for "-debug", and "-quiet" as an alias for "-q" 2016-01-24 18:20:04 +01:00
Jakob Unterwurzacher
523e430685 Add "-nosyslog" options
Also, actually redirect Warn and Debug as well.
2016-01-24 18:10:18 +01:00
Jakob Unterwurzacher
2f32114bd3 Add per-inode write mutex
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-24 13:08:08 +01:00
Jakob Unterwurzacher
dac9f71089 tests: more helpful error message when the tmp dir cannot be cleared 2016-01-24 13:07:18 +01:00
Jakob Unterwurzacher
1030522fe6 Suppress password prompt when using -extpass
Also, add color to the error messages.
2016-01-23 20:18:39 +01:00
Jakob Unterwurzacher
e799ae672d Show new benchmark.bash in README
The old benchmark is in benchmark-builtin.bash.

renamed:    benchmarks-builtin.bash -> benchmark-builtin.bash
renamed:    benchmarks-external.bash -> benchmark.bash
2016-01-23 20:18:13 +01:00
Jakob Unterwurzacher
142ed8b2b6 Update README for v0.8 2016-01-23 19:35:51 +01:00
Jakob Unterwurzacher
4a1768a314 Automate standard performance tests 2016-01-23 19:33:03 +01:00
Jakob Unterwurzacher
ea38ff4e0b renamed: benchmark.bash -> benchmarks-builtin.bash 2016-01-23 19:32:47 +01:00
Jakob Unterwurzacher
2e419e635f Remove last SetOutput from generic code 2016-01-22 21:49:56 +01:00
Jakob Unterwurzacher
9f9cf882ad Add missing import for Go 1.4 2016-01-22 21:42:58 +01:00
Jakob Unterwurzacher
df41183e9b Disable syslog in Go 1.4 and lower (method SetOutput does not exist) 2016-01-22 21:41:34 +01:00
Jakob Unterwurzacher
505fef5a3c renamed: cryptfs/gcm_go14.go -> cryptfs/gcm_go1.4.go
renamed:    cryptfs/gcm_go15.go -> cryptfs/gcm_go1.5.go
2016-01-22 21:39:16 +01:00
Jakob Unterwurzacher
cec2da3e33 Add "-memprofile" option 2016-01-21 23:55:37 +01:00
Jakob Unterwurzacher
d163169655 Wrap Logger to make disabling output more efficient
Instead of using SetOutput(ioutil.Discard), which means
that Printf is still called for every debug message,
use a simple and fast boolean check.

Streaming write performance improves from 86 to 93 MB/s.
2016-01-21 22:59:11 +01:00
Jakob Unterwurzacher
9bab220a1b Switch to syslog when running in the background 2016-01-20 22:31:15 +01:00
Jakob Unterwurzacher
17f0eb1339 Convert logging to standard Go log.Logger
This is in preparation of logging to syslog.
2016-01-20 20:57:00 +01:00
Jakob Unterwurzacher
b9dd9e9a1c Typo in README 2016-01-19 23:08:10 +01:00
Jakob Unterwurzacher
8432382244 Update README for v0.7.2 2016-01-19 23:01:21 +01:00
Jakob Unterwurzacher
b3c9a275c7 package.bash: Encode host distribution into tar filename 2016-01-09 15:47:29 +01:00
Jakob Unterwurzacher
ecdc58baa3 Update README for v0.7.1 2016-01-09 15:31:58 +01:00
Jakob Unterwurzacher
f5fe140d5b build.bash: copy binary to $GOPATH/bin 2016-01-09 15:31:34 +01:00
Jakob Unterwurzacher
f01f599d74 Make test.bash work when called from outside the gocryptfs directory
Also, get rid of useless intermediate build step
2016-01-09 14:27:04 +01:00
Jakob Unterwurzacher
236970adee OSX: Fix build failure caused by syntax errors 2016-01-09 13:04:48 +01:00
Jakob Unterwurzacher
f93729f20d Disable fallocate on OSX (not available and causes a build failure) 2016-01-07 21:39:41 +01:00
Jakob Unterwurzacher
6a9da0db10 Add EXAMPLES to manpage 2016-01-06 16:55:38 +01:00
Jakob Unterwurzacher
6443691c7e Delete old logo 2016-01-05 21:24:28 +01:00
rfjakob
6356c559b1 README: Uppercase MIT license badge 2016-01-05 21:18:04 +01:00
rfjakob
e17282b205 README: Change to new two-color logo 2016-01-05 21:04:18 +01:00