[\fB\-n\fR, \fB\-\-no-tpm=\fI1|0\fR]
[\fB\-q\fR, \fB\-\-quiet\fR]
[\fB\-v\fR, \fB\-\-verbose\fR]
-[\fB\-t\fR, \fB\-\-timeout=\fInnn\fR]
[\fB\-?\fR, \fB\-\-help\fR]
[\fB\-V\fR, \fB\-\-version\fR]
.RI
\fB\-v\fR, \fB\-\-verbose\fR
Report available entropy sources
.TP
-\fB\-t\fI nnn\fR, \fB\-\-timeout=\fInnn\fR
-Interval written to random-device when the entropy pool is full, in seconds, or 0 to disable (default: 60)
-.TP
\fB\-?\fR, \fB\-\-help\fR
Give a short summary of all program options.
.TP
{ "verbose" ,'v', 0, 0, "Report available entropy sources" },
- { "timeout", 't', "nnn", 0,
- "Interval written to random-device when the entropy pool is full, in seconds, or 0 to disable (default: 60)" },
{ "no-tpm", 'n', "1|0", 0,
"do not use tpm as a source of random number input (default: 0)" },
static struct arguments default_arguments = {
.random_name = "/dev/random",
.pid_file = "/var/run/rngd.pid",
- .poll_timeout = 60,
.random_step = 64,
.fill_watermark = 2048,
.daemon = true,
case 'r':
rng_default.rng_name = arg;
break;
- case 't': {
- float f;
- if (sscanf(arg, "%f", &f) == 0)
- argp_usage(state);
- else
- arguments->poll_timeout = f;
- break;
- }
-
case 'f':
arguments->daemon = false;
break;
static struct argp argp = { options, parse_opt, NULL, doc };
-static int update_kernel_random(int random_step, double poll_timeout,
+static int update_kernel_random(int random_step,
unsigned char *buf, fips_ctx_t *fipsctx_in)
{
unsigned char *p;
for (p = buf; p + random_step <= &buf[FIPS_RNG_BUFFER_SIZE];
p += random_step) {
random_add_entropy(p, random_step);
- random_sleep(poll_timeout);
+ random_sleep();
}
return 0;
}
-static void do_loop(int random_step, double poll_timeout)
+static void do_loop(int random_step)
{
unsigned char buf[FIPS_RNG_BUFFER_SIZE];
int retval = 0;
work_done = true;
rc = update_kernel_random(random_step,
- poll_timeout, buf,
- iter->fipsctx);
+ buf, iter->fipsctx);
if (rc == 0)
continue; /* succeeded, work done */
signal(SIGTERM, term_signal);
}
- do_loop(arguments->random_step,
- arguments->poll_timeout ? : -1.0);
+ do_loop(arguments->random_step);
if (pid_fd >= 0)
unlink(arguments->pid_file);