aboutsummaryrefslogtreecommitdiff
path: root/internal
AgeCommit message (Collapse)Author
2017-03-07Report correct symbolic link dentry sizesM. Vefa Bicakci
Prior to this commit, gocryptfs's reverse mode did not report correct directory entry sizes for symbolic links, where the dentry size needs to be the same as the length of a string containing the target path. This commit corrects this issue and adds a test case to verify the correctness of the implementation. This issue was discovered during the use of a strict file copying program on a reverse-mounted gocryptfs file system.
2017-03-05tests: configfile: fix spurious test failure IIJakob Unterwurzacher
internal/configfile/config_test.go:67: c declared and not used
2017-03-05tests: configfile: fix spurious test failureJakob Unterwurzacher
This test fails because Raw64 has been disabled for now.
2017-03-05configfile: disable Raw64 for nowJakob Unterwurzacher
Raw64 is supported (but was disabled by default) since gocryptfs v1.2. However, the implementation was buggy because it forgot about long names and symlinks. Disable it for now by default and enable it later, together with HKDF.
2017-03-05nametransform: fix Raw64 not affecting symlink targetsJakob Unterwurzacher
The symlink functions incorrectly hardcoded the padded base64 variant.
2017-03-05nametransform: fix Raw64 not affecting longnamesJakob Unterwurzacher
HashLongName() incorrectly hardcoded the call to base64.URLEncoding.
2017-03-05full stack: implement HKDF supportJakob Unterwurzacher
...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.
2017-03-05configfile: reject the "HKDF" flag for nowJakob Unterwurzacher
This will be re-enabled once it is implemented.
2017-03-05configfile: switch on Raw64 by defaultJakob Unterwurzacher
As we have dropped Go 1.4 compatibility already, and will add a new feature flag for gocryptfs v1.3 anyway, this is a good time to enable Raw64 as well.
2017-03-05configfile: switch to 128-bit IVs for master key encryptionJakob Unterwurzacher
There is no security reason for doing this, but it will allow to consolidate the code once we drop compatibility with gocryptfs v1.2 (and earlier) filesystems.
2017-03-05Drop Go 1.4 compatability code everywhereJakob Unterwurzacher
Yields a nice reduction in code size.
2017-03-05cryptocore: rename "BackendTypeEnum" -> "AEADTypeEnum"Jakob Unterwurzacher
There are two independent backends, one for name encryption, the other one, AEAD, for file content. "BackendTypeEnum" only applies to AEAD (file content), so make that clear in the name.
2017-03-05cryptocore: use eme v1.1 interfaceJakob Unterwurzacher
Version 1.1 of the EME package (github.com/rfjakob/eme) added a more convenient interface. Use it. Note that you have to upgrade your EME package (go get -u)!
2017-03-05configfile: define HKDF flagJakob Unterwurzacher
2017-03-02fusefrontend: when chown'ing a directory, also chown its dirivJakob Unterwurzacher
When filename encryption is active, every directory contains a "gocryptfs.diriv" file. This file should also change the owner. Fixes https://github.com/rfjakob/gocryptfs/issues/86
2017-02-26exitcodes: define code 12 for "password incorrect"Jakob Unterwurzacher
2017-02-25configfile: rename "kdf.go" -> "scrypt.go"Jakob Unterwurzacher
This really only handles scrypt and no other key-derivation functions. Renaming the files prevents confusion once we introduce HKDF. renamed: internal/configfile/kdf.go -> internal/configfile/scrypt.go renamed: internal/configfile/kdf_test.go -> internal/configfile/scrypt_test.go
2017-02-24stupidgcm: drop only external dependecyJakob Unterwurzacher
This makes it easier to use the package in external projects. See https://github.com/rfjakob/gocryptfs/issues/79
2017-02-24speed: add benchmark.bash helperJakob Unterwurzacher
2017-02-23speed: fix build for Go 1.4 and lowerJakob Unterwurzacher
Old Go versions miss cipher.NewGCMWithNonceSize, which causes: internal/speed/speed.go:95: undefined: cipher.NewGCMWithNonceSize
2017-02-22Implement "gocryptfs -speed"Jakob Unterwurzacher
A crypto benchmark mode like "openssl speed". Example run: $ ./gocryptfs -speed AES-GCM-256-OpenSSL 180.89 MB/s (selected in auto mode) AES-GCM-256-Go 48.19 MB/s AES-SIV-512-Go 37.40 MB/s
2017-02-16tests: reverse: check Access() callJakob Unterwurzacher
2017-02-16fusefrontend_reverse: handle .name files in Access()Jakob Unterwurzacher
These were currently passed to decryptPath() were it caused a warning.
2017-02-16tests: configfile: add missing newlines in verbose outputJakob Unterwurzacher
2017-02-16syscallcompat: OSX compat: fix variable warningsJakob Unterwurzacher
As suggested by https://github.com/rfjakob/gocryptfs/issues/15#issuecomment-279130217
2017-02-13readpassword: limit password length to 1000 bytesJakob Unterwurzacher
This used to hang at 100% CPU: cat /dev/zero | gocryptfs -init a ...and would ultimately send the box into out-of-memory. The number 1000 is chosen arbitrarily and seems big enough given that the password must be one line. Suggested by @mhogomchungu in https://github.com/rfjakob/gocryptfs/issues/77 .
2017-02-12Check for trailing garbage after the passwordJakob Unterwurzacher
From the comment: // CheckTrailingGarbage tries to read one byte from stdin and exits with a // fatal error if the read returns any data. // This is meant to be called after reading the password, when there is no more // data expected. This helps to catch problems with third-party tools that // interface with gocryptfs.
2017-02-12readpassword: improve comment on readPasswordStdinJakob Unterwurzacher
2017-02-05ctlsock: handle non-canonical empty pathsJakob Unterwurzacher
We have to check if the input path is empty AFTER canonicalizing it, too!
2017-02-05ctlsock: sanitize: handle multiple leading slashesJakob Unterwurzacher
2017-01-29golint comment fixJakob Unterwurzacher
internal/ctlsock/ctlsock_serve.go:73:1: comment on exported const ReadBufSize should be of the form "ReadBufSize ..."
2017-01-29ctlsock: better error message for forward mode path decryptionJakob Unterwurzacher
2017-01-29ctlsock: abort message processing on JSON errorJakob Unterwurzacher
The code was missing a "continue" in that branch. Also improve the error messages a bit.
2017-01-29ctlsock: interpret paths that point above CWD as ""Jakob Unterwurzacher
Paths that start with ".." were previously accepted as-is.
2017-01-29readpassword: support spaces in "-passfile" filenameJakob Unterwurzacher
...and while we are at it, also filenames starting with "-".
2017-01-26main: make sure the ctlsock file is deleted on incorrect passwordJakob Unterwurzacher
Otherwise the next try to mount ends in "ctlsock: listen unix ctl.sock: bind: address already in use"
2017-01-26fusefrontend: fix hard-linking with long nameJakob Unterwurzacher
This used to incorrectly try to link twice and return EEXIST.
2017-01-26tlog: better comment for the terminal colorsJakob Unterwurzacher
2017-01-03reverse: add single-entry path cacheJakob Unterwurzacher
Speeds up the "ls -lR" benchmark from 2.6 seconds to 2.0.
2017-01-03reverse: factor out rDecryptNameJakob Unterwurzacher
This prepares the code for the introduction of a path cache.
2016-12-10prefer_openssl: default to Go GCM on OSXJakob Unterwurzacher
2016-12-10ctlsock: abort the connection if the request is too bigJakob Unterwurzacher
Reading partial JSON would cause a mess. Just kill the connection. Also, stop using syscall.PathMax that is not defined on Darwin ( https://github.com/rfjakob/gocryptfs/issues/15#issuecomment-264253024 )
2016-12-10ctlsock: add a note about Accept() throwing errors on Close()Jakob Unterwurzacher
2016-12-10ctlsock: exit early if socket cannot be created; delete on exitJakob Unterwurzacher
Both are achieved by opening the socket from main and passing it to the ctlsock package instead of passing the path.
2016-12-10stupidgcm: Fix without_openssl build failureJakob Unterwurzacher
Also, always call build-without-openssl.bash from test.bash. Failure was: internal/stupidgcm/without_openssl.go:29: missing return at end of function
2016-12-10ctlsock: sanitize paths before passing them to the backendJakob Unterwurzacher
You used to be able to crash gocryptfs by passing "/foo" of "foo/" to the ctlsock. Fixes https://github.com/rfjakob/gocryptfs/issues/66
2016-12-10Replace all calls to naked panic() with log.Panic()Jakob Unterwurzacher
We want all panics to show up in the syslog.
2016-11-28fusefrontend: preserve owner for symlinksJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/64
2016-11-28fusefronted: preserve owner for device nodes and socketsJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/64
2016-11-28fusefrontend: use Lchown when preserving ownerJakob Unterwurzacher
This prevents (unlikely) symlink race attacks