summaryrefslogtreecommitdiffstats
path: root/src/basic/random-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-07-19 19:34:10 +0200
committerLennart Poettering <lennart@poettering.net>2019-07-25 18:16:46 +0200
commit3e155eba4363ce3f7953e5b69db526ab47bf165d (patch)
tree6f17e77f061e2b82295206f5391a5a30b290edf6 /src/basic/random-util.h
parentcore: take random seed from boot loader and credit it to kernel entropy pool (diff)
downloadsystemd-3e155eba4363ce3f7953e5b69db526ab47bf165d.tar.xz
systemd-3e155eba4363ce3f7953e5b69db526ab47bf165d.zip
random-seed: move pool size determination to random-util.[ch]
That way we can reuse it elsewhere.
Diffstat (limited to 'src/basic/random-util.h')
-rw-r--r--src/basic/random-util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/basic/random-util.h b/src/basic/random-util.h
index 148b6c7813..facc11b976 100644
--- a/src/basic/random-util.h
+++ b/src/basic/random-util.h
@@ -31,3 +31,9 @@ static inline uint32_t random_u32(void) {
}
int rdrand(unsigned long *ret);
+
+/* Some limits on the pool sizes when we deal with the kernel random pool */
+#define RANDOM_POOL_SIZE_MIN 512U
+#define RANDOM_POOL_SIZE_MAX (10U*1024U*1024U)
+
+size_t random_pool_size(void);