mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-02 08:42:48 +00:00
Provide the infrastructure for sysadmins to select the broad class
of entropy harvesting they wish to perform: "ethernet" (LAN), point-to-point and interrupt.
This commit is contained in:
parent
442aa310e6
commit
14636c3b51
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72667
@ -45,6 +45,9 @@
|
||||
|
||||
static u_int read_random_phony(void *, u_int);
|
||||
|
||||
/* Structure holding the desired entropy sources */
|
||||
struct harvest_select harvest = { 0, 0, 0 };
|
||||
|
||||
/* hold the address of the routine which is actually called if
|
||||
* the randomdev is loaded
|
||||
*/
|
||||
|
@ -81,7 +81,7 @@ static dev_t random_dev;
|
||||
static dev_t urandom_dev; /* XXX Temporary */
|
||||
|
||||
/* To stash the sysctl's until they are removed */
|
||||
static struct sysctl_oid *random_sysctl[10]; /* magic # is sysctl count */
|
||||
static struct sysctl_oid *random_sysctl[12]; /* magic # is sysctl count */
|
||||
static int sysctlcount = 0;
|
||||
|
||||
static int
|
||||
@ -190,6 +190,18 @@ random_modevent(module_t mod, int type, void *data)
|
||||
SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(node1),
|
||||
OID_AUTO, "seeded", CTLFLAG_RW,
|
||||
&random_state.seeded, 0, "Seeded State");
|
||||
random_sysctl[sysctlcount++] =
|
||||
SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(node1),
|
||||
OID_AUTO, "harvest_ethernet", CTLFLAG_RW,
|
||||
&harvest.ethernet, 0, "Harvest NIC entropy");
|
||||
random_sysctl[sysctlcount++] =
|
||||
SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(node1),
|
||||
OID_AUTO, "harvest_point_to_point", CTLFLAG_RW,
|
||||
&harvest.point_to_point, 0, "Harvest serial net entropy");
|
||||
random_sysctl[sysctlcount++] =
|
||||
SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(node1),
|
||||
OID_AUTO, "harvest_interrupt", CTLFLAG_RW,
|
||||
&harvest.interrupt, 0, "Harvest IRQ entropy");
|
||||
random_sysctl[sysctlcount++] = node2 =
|
||||
SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(node_base),
|
||||
OID_AUTO, "yarrow", CTLFLAG_RW, 0,
|
||||
|
@ -37,6 +37,17 @@ enum esource { RANDOM_WRITE, RANDOM_KEYBOARD, RANDOM_MOUSE, RANDOM_NET,
|
||||
RANDOM_INTERRUPT, ENTROPYSOURCE };
|
||||
void random_harvest(void *, u_int, u_int, u_int, enum esource);
|
||||
|
||||
/* Allow the sysadmin to select the broad category of
|
||||
* entropy types to harvest
|
||||
*/
|
||||
struct harvest_select {
|
||||
int ethernet;
|
||||
int point_to_point;
|
||||
int interrupt;
|
||||
};
|
||||
|
||||
extern struct harvest_select harvest;
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _SYS_RANDOM_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user