random-util: optionally allow randomness to be generated via RDRAND

We only use this when we don't require the best randomness. The primary
usecase for this is UUID generation, as this means we don't drain
randomness from the kernel pool for them. Since UUIDs are usually not
secrets RDRAND should be goot enough for them to avoid real-life
collisions.
This commit is contained in:
Lennart Poettering
2018-11-08 09:44:27 +01:00
parent 6fb6f13896
commit cc83d5197c
4 changed files with 53 additions and 28 deletions
+1
View File
@@ -57,6 +57,7 @@ int main(int argc, char **argv) {
test_genuine_random_bytes(RANDOM_EXTEND_WITH_PSEUDO);
test_genuine_random_bytes(0);
test_genuine_random_bytes(RANDOM_BLOCK);
test_genuine_random_bytes(RANDOM_ALLOW_RDRAND);
test_pseudo_random_bytes();