diff options
author | Jakob Unterwurzacher | 2021-08-25 12:36:38 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2021-08-25 12:39:17 +0200 |
commit | 61ef6b00a675456ee05d40f1ce44d693bc4be350 (patch) | |
tree | 2ce32b48bb31ff728622d75e110075f5a43a7cf4 /cli_args.go | |
parent | b3d26b7264f3c025a48d19cb2784b83fc84a0ee4 (diff) |
-devrandom: make flag a no-op
Commit f3c777d5eaa682d878c638192311e52f9c204294 added the `-devrandom` option:
commit f3c777d5eaa682d878c638192311e52f9c204294
Author: @slackner
Date: Sun Nov 19 13:30:04 2017 +0100
main: Add '-devrandom' commandline option
Allows to use /dev/random for generating the master key instead of the
default Go implementation. When the kernel random generator has been
properly initialized both are considered equally secure, however:
* Versions of Go prior to 1.9 just fall back to /dev/urandom if the
getrandom() syscall would be blocking (Go Bug #19274)
* Kernel versions prior to 3.17 do not support getrandom(), and there
is no check if the random generator has been properly initialized
before reading from /dev/urandom
This is especially useful for embedded hardware with low-entroy. Please
note that generation of the master key might block indefinitely if the
kernel cannot harvest enough entropy.
We now require Go v1.13 and Kernel versions should have also moved on.
Make the flag a no-op.
https://github.com/rfjakob/gocryptfs/issues/596
Diffstat (limited to 'cli_args.go')
-rw-r--r-- | cli_args.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cli_args.go b/cli_args.go index 3eb92b2..0287741 100644 --- a/cli_args.go +++ b/cli_args.go @@ -30,7 +30,7 @@ type argContainer struct { plaintextnames, quiet, nosyslog, wpanic, longnames, allow_other, reverse, aessiv, nonempty, raw64, noprealloc, speed, hkdf, serialize_reads, forcedecode, hh, info, - sharedstorage, devrandom, fsck, one_file_system, deterministic_names, + sharedstorage, fsck, one_file_system, deterministic_names, xchacha bool // Mount options with opposites dev, nodev, suid, nosuid, exec, noexec, rw, ro, kernel_cache, acl bool @@ -177,7 +177,6 @@ func parseCliOpts(osArgs []string) (args argContainer) { flagSet.BoolVar(&args.hh, "hh", false, "Show this long help text") flagSet.BoolVar(&args.info, "info", false, "Display information about CIPHERDIR") flagSet.BoolVar(&args.sharedstorage, "sharedstorage", false, "Make concurrent access to a shared CIPHERDIR safer") - flagSet.BoolVar(&args.devrandom, "devrandom", false, "Use /dev/random for generating master key") flagSet.BoolVar(&args.fsck, "fsck", false, "Run a filesystem check on CIPHERDIR") flagSet.BoolVar(&args.one_file_system, "one-file-system", false, "Don't cross filesystem boundaries") flagSet.BoolVar(&args.deterministic_names, "deterministic-names", false, "Disable diriv file name randomisation") @@ -228,11 +227,16 @@ func parseCliOpts(osArgs []string) (args argContainer) { flagSet.DurationVar(&args.idle, "idle", 0, "Auto-unmount after specified idle duration (ignored in reverse mode). "+ "Durations are specified like \"500s\" or \"2h45m\". 0 means stay mounted indefinitely.") - var nofail bool - flagSet.BoolVar(&nofail, "nofail", false, "Ignored for /etc/fstab compatibility") - var dummyString string flagSet.StringVar(&dummyString, "o", "", "For compatibility with mount(1), options can be also passed as a comma-separated list to -o on the end.") + + // Ignored flags + { + var tmp bool + flagSet.BoolVar(&tmp, "nofail", false, "Ignored for /etc/fstab compatibility") + flagSet.BoolVar(&tmp, "devrandom", false, "Deprecated (ignored for compatibility)") + } + // Actual parsing err = flagSet.Parse(osArgsPreprocessed[1:]) if err == flag.ErrHelp { |