From 99ff83da740de3de131259dc672d645639e6c965 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Mon, 29 Jul 2013 20:26:27 +0000 Subject: Decouple yarrow from random(4) device. * Make Yarrow an optional kernel component -- enabled by "YARROW_RNG" option. The files sha2.c, hash.c, randomdev_soft.c and yarrow.c comprise yarrow. * random(4) device doesn't really depend on rijndael-*. Yarrow, however, does. * Add random_adaptors.[ch] which is basically a store of random_adaptor's. random_adaptor is basically an adapter that plugs in to random(4). random_adaptor can only be plugged in to random(4) very early in bootup. Unplugging random_adaptor from random(4) is not supported, and is probably a bad idea anyway, due to potential loss of entropy pools. We currently have 3 random_adaptors: + yarrow + rdrand (ivy.c) + nehemeiah * Remove platform dependent logic from probe.c, and move it into corresponding registration routines of each random_adaptor provider. probe.c doesn't do anything other than picking a specific random_adaptor from a list of registered ones. * If the kernel doesn't have any random_adaptor adapters present then the creation of /dev/random is postponed until next random_adaptor is kldload'ed. * Fix randomdev_soft.c to refer to its own random_adaptor, instead of a system wide one. Submitted by: arthurmesh@gmail.com, obrien Obtained from: Juniper Networks Reviewed by: obrien --- sys/dev/random/randomdev.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sys/dev/random/randomdev.h') diff --git a/sys/dev/random/randomdev.h b/sys/dev/random/randomdev.h index deb683192331..75b2c1980901 100644 --- a/sys/dev/random/randomdev.h +++ b/sys/dev/random/randomdev.h @@ -38,7 +38,7 @@ typedef void random_write_func_t(void *, int); typedef int random_poll_func_t(int, struct thread *); typedef void random_reseed_func_t(void); -struct random_systat { +struct random_adaptor { struct selinfo rsel; const char *ident; int seeded; @@ -51,7 +51,5 @@ struct random_systat { random_reseed_func_t *reseed; }; -extern struct random_systat *random_systat; - -extern void random_ident_hardware(struct random_systat **); +extern void random_ident_hardware(struct random_adaptor **); extern void random_null_func(void); -- cgit v1.3