diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-06-06 17:53:42 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-06-12 06:14:56 +0000 |
commit | 629f3c0277632b9e799b30f4dccbbe41ec211eef (patch) | |
tree | 553510a7676b6f3a60cd3662fd6320d6c819689e /src/tools/uic/uic.h | |
parent | ec63fcb314c7f83d9504297c69483f944d5ee29b (diff) |
QRandomGenerator: improve the fallback seeding in emergencies
If we've never read any samples from hardware RNG or from /dev/urandom,
then there are no stored samples for us to seed the Mersenne Twister. In
that case, attempt to obtain an emergency sample that consists of some
random bits from the variable addresses (ASLR should help) and from the
clock (using nanosecond quality, instead of seconds).
There's still the possibility that we'll get poor entropy: very close to
boot, if the kernel entropy pool is empty, ASLR could be poor and the
monotonic clock value could be consistent from boot to boot. There's
nothing we can do about that.
Change-Id: Ia3e896da908f42939148fffd14c5b0c7b608371b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/tools/uic/uic.h')
0 files changed, 0 insertions, 0 deletions