Files
libfaketime/test/getentropy_test.c
Daniel Kahn Gillmor 3db9d20828 Test getentropy
We want to ensure that tools that call getentropy() are also
controlled appropriately.
2021-02-24 16:03:57 -05:00

15 lines
273 B
C

#include <unistd.h>
#include <stdio.h>
int main() {
unsigned char buf[16];
if (getentropy(buf, sizeof(buf))) {
perror("failed to getentropy()");
return 1;
}
for (size_t i = 0; i < sizeof(buf); i++)
printf("%02x", buf[i]);
printf("\n");
return 0;
}