aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2012-08-01 14:31:40 -0700
committerJeff Garzik <jgarzik@redhat.com>2012-08-02 00:19:07 -0400
commit0044517d087c442225891dd9a26ff52a602a295b (patch)
tree51b78d66568ac359db8fb2e556c85f9f98ff5e52
parentdb508e37fe83b720c45ce7f2cd180dade5e58f3a (diff)
downloadrng-tools-0044517d087c442225891dd9a26ff52a602a295b.tar.gz
rng-tools-0044517d087c442225891dd9a26ff52a602a295b.tar.xz
rng-tools-0044517d087c442225891dd9a26ff52a602a295b.zip
rngd: Initialize RNGs in order of preference
The DRNG entropy source, if present, is going to be orders of magnitudes faster than most other sources, so initialize it first so that it shows up first in the list. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--rngd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rngd.c b/rngd.c
index d7cd1b2..7fe3398 100644
--- a/rngd.c
+++ b/rngd.c
@@ -302,9 +302,9 @@ int main(int argc, char **argv)
argp_parse(&argp, argc, argv, 0, 0, arguments);
/* Init entropy sources, and open TRNG device */
- rc_rng = init_entropy_source(&rng_default);
if (arguments->enable_drng)
rc_drng = init_drng_entropy_source(&rng_drng);
+ rc_rng = init_entropy_source(&rng_default);
if (arguments->enable_tpm && rc_rng)
rc_tpm = init_tpm_entropy_source(&rng_tpm);