summaryrefslogtreecommitdiff
path: root/src/basic/random-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-11-07 19:04:04 +0100
committerLennart Poettering <lennart@poettering.net>2018-11-08 09:44:27 +0100
commit68534345b8af31e8df3d45cf21a832a42af52996 (patch)
tree5cf5830af039c20b6ab7869410dd93754e996478 /src/basic/random-util.h
parent94d457e8d936555b3b1ae25592d0624746994166 (diff)
downloadsystemd-68534345b8af31e8df3d45cf21a832a42af52996.tar.gz
random-util: optionally enable blocking getrandom() behaviour
When generating the salt for the firstboot password logic, let's use getrandom() blocking mode, and insist in the very best entropy.
Diffstat (limited to 'src/basic/random-util.h')
-rw-r--r--src/basic/random-util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/random-util.h b/src/basic/random-util.h
index 6328f661d2..0813314a05 100644
--- a/src/basic/random-util.h
+++ b/src/basic/random-util.h
@@ -7,6 +7,7 @@
typedef enum RandomFlags {
RANDOM_EXTEND_WITH_PSEUDO = 1 << 0, /* If we can't get enough genuine randomness, but some, fill up the rest with pseudo-randomness */
+ RANDOM_BLOCK = 1 << 1, /* Rather block than return crap randomness (only if the kernel supports that) */
} RandomFlags;
int genuine_random_bytes(void *p, size_t n, RandomFlags flags); /* returns "genuine" randomness, optionally filled upwith pseudo random, if not enough is available */