diff options
author | Sebastian Lackner | 2017-11-19 13:30:04 +0100 |
---|---|---|
committer | rfjakob | 2017-11-21 23:37:06 +0100 |
commit | f3c777d5eaa682d878c638192311e52f9c204294 (patch) | |
tree | dc3fcf616371479abec93ab93688f9e2937e7d9d /tests/cli | |
parent | 1b0426bcb23a1850f3a03619a15413281dc733e3 (diff) |
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.
Diffstat (limited to 'tests/cli')
-rw-r--r-- | tests/cli/cli_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go index 97de8da..c7752f2 100644 --- a/tests/cli/cli_test.go +++ b/tests/cli/cli_test.go @@ -34,6 +34,11 @@ func TestInit(t *testing.T) { } } +// Test -init with -devrandom flag +func TestInitDevRandom(t *testing.T) { + test_helpers.InitFS(t, "-devrandom") +} + // Test -init with -aessiv func TestInitAessiv(t *testing.T) { dir := test_helpers.InitFS(t, "-aessiv") |