aboutsummaryrefslogtreecommitdiff
path: root/main.go
AgeCommit message (Collapse)Author
2022-01-03readpassword: bubble up errors instead of exiting the processJakob Unterwurzacher
This allows cleanups to happen in the caller, like removing the control socket. Fixes https://github.com/rfjakob/gocryptfs/issues/634
2021-08-30Unbreak hyperlinks broken by go mod v2 conversionJakob Unterwurzacher
Commit 69d88505fd7f4cb0d9e4f1918de296342fe05858 go mod: declare module version v2 translated all instances of "github.com/rfjakob/gocryptfs/" to "github.com/rfjakob/gocryptfs/v2/". Unfortunately, this included hyperlinks. Unbreak the hyperlinks like this: find . -name \*.go | xargs sed -i s%https://github.com/rfjakob/gocryptfs/v2/%https://github.com/rfjakob/gocryptfs/v2/%
2021-08-23go mod: declare module version v2Jakob Unterwurzacher
Our git version is v2+ for some time now, but go.mod still declared v1. Hopefully making both match makes https://pkg.go.dev/github.com/rfjakob/gocryptfs/v2 work. All the import paths have been fixed like this: find . -name \*.go | xargs sed -i s%github.com/rfjakob/gocryptfs/%github.com/rfjakob/gocryptfs/v2/%
2021-08-10main: add testcases for convertToDoubleDash & parseCliOptsJakob Unterwurzacher
2021-06-21Improve startup debug outputJakob Unterwurzacher
The startup debug output was very verbose but still missing some effective crypto settings.
2020-10-17fsck: make sure we unmount in all casesJakob Unterwurzacher
2020-10-14main: show microseconds in go-fuse logsJakob Unterwurzacher
Suppress the date but show microseconds in fuse debug logs (-fusedebug) and go-fuse warnings.
2020-09-12Add support for FIDO2 tokensPavol Rusnak
2020-07-18v2api: make fsck compile againJakob Unterwurzacher
Horribly broken, but it compiles. .../tests/fsck$ ./run_fsck.bash Reading password from extpass program "echo", arguments: ["test"] Decrypting master key OpenDir ".": invalid entry "invalid_file_name.3": illegal base64 data at input byte 17 OpenDir ".": invalid entry "invalid_file_name_2": bad message fsck: corrupt entry in dir "": "invalid_file_name.3" fsck: corrupt entry in dir "": "invalid_file_name_2" OpenDir ".": invalid entry "invalid_file_name____1": bad message fsck: corrupt entry in dir "": "invalid_file_name____1" fsck: error stating file ".go-fuse.5577006791947779410/deleted": no such file or directory fsck: error listing xattrs on ".go-fuse.13260572831089785859/deleted": no such file or directory fsck: error opening dir "i10488239 (dir): ": no such file or directory fsck: error reading symlink ".go-fuse.10667007354186551956/deleted": no such file or directory fsck: error listing xattrs on ".go-fuse.11998794077335055257/deleted": no such file or directory [...]
2020-06-21v2api (go-fuse v2 api): initial noop implementationJakob Unterwurzacher
Compiles and mounts but does nothing useful.
2020-05-17main: accept multiple -passfile optionsJakob Unterwurzacher
Each file will be read and then concatenated for the effictive password. This can be used as a kind of multi-factor authenticiton. Fixes https://github.com/rfjakob/gocryptfs/issues/288
2020-05-17Update go-fuse import path to github.com/hanwen/go-fuse/v2Jakob Unterwurzacher
We need https://github.com/hanwen/go-fuse/commit/fd7328faf9fdf75709f7ba7df7072aaf4eeb18b3 to fix a crash reported in https://github.com/rfjakob/gocryptfs/issues/430 : 2019/10/30 17:14:16 Unknown opcode 2016 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x508d38] This patch is only in the v2.x.x branch. Upgrade to v2, as the old API is also supported there. Running git grep hanwen/go-fuse | grep -v hanwen/go-fuse/v2 to check for forgotten references comes back clean.
2020-05-10Fix spelling mistakes found by misspellJakob Unterwurzacher
https://github.com/client9/misspell
2020-05-09main: add "go doc" package commentJakob Unterwurzacher
Should show up on https://pkg.go.dev/github.com/rfjakob/gocryptfs?tab=doc which currently reads "No documentation available for this package!"
2020-05-09main: untangle `-masterkey` handling and config loadingJakob Unterwurzacher
This was handled both in getMasterKey(). Split it apart.
2020-05-09main: rename parseMasterKey() -> unhexMasterKey()Jakob Unterwurzacher
Make it clear that function does NOT parse the "-masterkey" command line argument, it just unhexes the payload.
2020-04-13speed: show gocryptfs versionJakob Unterwurzacher
Output now looks like this $ gocryptfs -speed gocryptfs v1.7.1-38-gbe3b9df-dirty; go-fuse v2.0.2-57-gd1cfa17; 2020-04-13 go1.13.6 linux/amd64 AES-GCM-256-OpenSSL 607.90 MB/s AES-GCM-256-Go 920.75 MB/s (selected in auto mode) AES-SIV-512-Go 169.85 MB/s XChaCha20-Poly1305-Go 794.30 MB/s and has go version and arch information, which is important when comparing results.
2020-02-15main: respect GOMAXPROCS environment variableJakob Unterwurzacher
If the user sets GOMAXPROCS explicitely, we should respect it.
2019-12-28remove Trezor supportPavol Rusnak
2019-05-13-passwd now takes a passed -scryptn flag into accountJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/400
2019-05-12gocryptfs -version: show architectureJakob Unterwurzacher
Show the GOOS/GOARCH tuple as displayed by "go version".
2019-04-08readpassword: delete CheckTrailingGarbageJakob Unterwurzacher
CheckTrailingGarbage was called even when "-passfile" was used, which is stupid, and causes false positives: https://github.com/rfjakob/gocryptfs/issues/391 (false error "Received trailing garbage after the password" when using -passfile in .bash_profile) Instead of trying to improve the logic to handle that case and make everything even more complicated, delete the function. It is unclear if actually helps in some cases, and it definitely harms as shown by the above bug report.
2019-03-03Allow multiple -extpass argumentsJakob Unterwurzacher
To support arguments containing spaces, -extpass can now be passed multiple times. https://github.com/rfjakob/gocryptfs/issues/289
2019-01-05main: Run 'ensure fds' code early during the program startup.Sebastian Lackner
The files are apparently processed in alphabetic order, so cli_args.go is processed before main.go. In order to run before the go-fuse imports, put the 'ensure fds' code in a separate package. Debug messages are omitted to avoid additional imports (that might contain other code messing up our file descriptors).
2019-01-05main: ensure fds 0,1,2 are always openJakob Unterwurzacher
The Go stdlib, as well as the gocryptfs code, relies on the fact that fds 0,1,2 are always open. See https://github.com/rfjakob/gocryptfs/issues/320 for details.
2018-12-30main: Remove a duplicate word in a comment.Sebastian Lackner
2018-12-15passfile: directly read file instead of invoking catJakob Unterwurzacher
Allows better error handling, gets rid of the call to an external program, and fixes https://github.com/rfjakob/gocryptfs/issues/278 .
2018-09-08main: don't read the config file twice (fix pipe bug)Jakob Unterwurzacher
Instead, first Load() the file, then DecryptMasterKey(). Fixes https://github.com/rfjakob/gocryptfs/issues/258
2018-09-08configfile: add LoadAndDecrypt wrapperJakob Unterwurzacher
Callers that do not want to decrypt the masterkey should call plain Load(). https://github.com/rfjakob/gocryptfs/issues/258
2018-08-15trezor: show support in version stringJakob Unterwurzacher
Show enable_trezor in the version string if we were compiled with `-tags enable_trezor`. And hide the `-trezor` flag from the help output if we were not.
2018-08-11reverse mode: add --exclude optionJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/235
2018-07-01main: replace naked panic with log.PanicJakob Unterwurzacher
Fix the check that failed to find the case as well.
2018-07-01trezor: reject password change on Trezor-enabled fsJakob Unterwurzacher
This is not supported (yet? does it make sense?).
2018-07-01trezor: add TrezorPayloadJakob Unterwurzacher
TrezorPayload stores 32 random bytes used for unlocking the master key using a Trezor security module. The randomness makes sure that a unique unlock value is used for each gocryptfs filesystem.
2018-07-01configfile: reduce function name stutterJakob Unterwurzacher
configfile.LoadConfFile() -> configfile.Load() configfile.CreateConfFile() -> configfile.Create()
2018-07-01trezor: add skeleton for Trezor supportJakob Unterwurzacher
readpassword.Trezor() is not implemented yet and returns a hardcoded dummy key.
2018-06-07Set a default PATH if PATH is empty or unsetJulian Orth
mount(1) unsets PATH before calling mount.fuse. Therefore it's not set in gocrpytfs either and daemonization fails if gocryptfs was not executed via an absolute path. mount.fuse handles this by leaving the execution of the helper to /bin/sh. /bin/sh handles an empty PATH by searching a few default locations. This patch sets the PATH to a sane default if it's empty or unset.
2018-04-02fsck: add initial implementationJakob Unterwurzacher
Most corruption cases except xattr should be covered. With test filesystem. The output is still pretty ugly. xattr support will be added in the next commits.
2018-04-01main: add "-fsck" flagJakob Unterwurzacher
The fsck operation is not yet implemented, this commits just adds the flag and improves cli flag handling.
2018-04-01main: move and rename checkDir*() helperJakob Unterwurzacher
To avoid confusion with fsck, rename to isDir*() and move the functions into init_dir.go.
2018-04-01main: pull regular exits into main functionJakob Unterwurzacher
The replaces the "does not return" comments with an explicit os.Exit, which is unambigous.
2018-03-22Add `-masterkey=stdin` functionalityJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/218
2018-02-18main: changePassword: zero masterkeyJakob Unterwurzacher
Overwrite the masterkey with zeros once we have encrypted it, and let it run out of scope. Also get rid of the password duplicate in readpassword.Twice.
2018-02-18main: zero password once we are done with itJakob Unterwurzacher
Overwrite the password we have got from the user with zeros once we don't need it anymore, and make sure the variable runs out of scope.
2018-02-18readpassword: convert from string to []byteJakob Unterwurzacher
This will allows us to overwrite the password with zeros once we are done with it. https://github.com/rfjakob/gocryptfs/issues/211
2018-02-18main: doMount: use a deferred function for wipeKeysJakob Unterwurzacher
Also drop the unused int return.
2018-02-18cryptocore, main: add two commentsJakob Unterwurzacher
While reading the code, I had to think about what it does, so add a comment that explains it.
2018-02-04Fix spelling (#205)Felix Lechner
2017-11-15main: print clear error message if CIPHERDIR is missingJakob Unterwurzacher
Getting just the help text in response to gocryptfs -info -config external.config is confusing: https://github.com/rfjakob/gocryptfs/issues/157
2017-09-06build.bash: make reproduceable builds easierJakob Unterwurzacher
* Reduce the build time precision from seconds to days * Allow to specify an arbitrary build date through an env variable