]> git.ipfire.org Git - thirdparty/systemd.git/commit
random-util: use correct minimum pool size constant
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 9 Mar 2022 16:10:05 +0000 (09:10 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 22 Mar 2022 07:46:20 +0000 (08:46 +0100)
commitd328346944ae3f9d10c17959fd37cb151c15bba5
treedfe12eaef4b10a4249b9f946e94844a30b2ed272
parent8bab6193831c58195ad65b227fdd47dbe017137b
random-util: use correct minimum pool size constant

The actual minimum size of the pool across supported kernel versions is
32 bytes. So adjust this minimum.

I've audited every single usage of random_pool_size(), and cannot see
anywhere that this would have any impact at all on anything. We could
actually just not change the constant and everything would be fine, or
we could change it here and that's fine too. From both a functionality
and crypto perspective, it doesn't really seem to make a substantive
difference any which way, so long as the value is ≥32. However, it's
better to be correct and have the function do what it says, so clamp it
to the right minimum.
src/basic/random-util.h