Include a check for getentropy interception

This snippet applies to both the library constructors and variable
data test frameworks.
This commit is contained in:
Daniel Kahn Gillmor
2021-02-25 18:30:36 -05:00
parent 0b0cc29d2e
commit 26b4b395e9
3 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
unsigned int targ;
if (getentropy(&targ, sizeof(targ)) == 0) {
printf("[%s] getentropy() yielded 0x%08x\n", where, targ);
} else {
printf("[%s] getentropy() failed with %d (%s)\n", where, errno, strerror(errno));
}

View File

@@ -0,0 +1 @@
FAKERANDOM_SEED 0x0123456789ABCDEF

View File

@@ -3,3 +3,5 @@
#include <unistd.h>
#include <sys/random.h>
#include <sys/syscall.h>
#include <string.h>
#include <errno.h>