random-util: use RDRAND for randomness if the kernel doesn't want to give us any
authorLennart Poettering <lennart@poettering.net>
Thu, 26 Jul 2018 08:42:01 +0000 (10:42 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 21 Aug 2018 18:13:32 +0000 (20:13 +0200)
commit97fa202a61c040215b0f9460059d8d5621a5980a
treed96ecb8c07257fc27d52af4cfb0cd8920eff791c
parent66c91c3a23f684482e33e54c7bbaaf69384b7d11
random-util: use RDRAND for randomness if the kernel doesn't want to give us any

Pretty much all intel cpus have had RDRAND in a long time. While
CPU-internal RNG are widely not trusted, for seeding hash tables it's
perfectly OK to use: we don't high quality entropy in that case, hence
let's use it.

This is only hooked up with 'high_quality_required' is false. If we
require high quality entropy the kernel is the only source we should
use.
src/basic/random-util.c
src/basic/random-util.h
src/test/test-random-util.c