summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-01-03 18:11:32 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2022-01-04 22:47:56 +0000
commitda2862ef06f22fc8d31dafced6d2d6dc14f2ee0b (patch)
tree7c8ed56621f2a844eb3346882cc3c2e516dbdd78 /tools
parent948d085e899273f3a34376665414d1ecd1858978 (diff)
downloadsystemd-da2862ef06f22fc8d31dafced6d2d6dc14f2ee0b.tar.gz
random-seed: hash together old seed and new seed before writing out file
If we're consuming an on-disk seed, we usually write out a new one after consuming it. In that case, we might be at early boot and the randomness could be rather poor, and the kernel doesn't guarantee that it'll use the new randomness right away for us. In order to prevent the new entropy from getting any worse, hash together the old seed and the new seed, and replace the final bytes of the new seed with the hash output. This way, entropy strictly increases and never regresses. Fixes: https://github.com/systemd/systemd/issues/21983 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions