random.c (6f98a4bfee72c22f50aedb39fb761567969865fe) random.c (d0efdf35a6a71d307a250199af6fce122a7c7e11)
1// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2/*
3 * Copyright (C) 2017-2022 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
4 * Copyright Matt Mackall <mpm@selenic.com>, 2003, 2004, 2005
5 * Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999. All rights reserved.
6 *
7 * This driver produces cryptographically secure pseudorandom data. It is divided
8 * into roughly six sections, each with a section header:

--- 1567 unchanged lines hidden (view full) ---

1576 * input pool. Always <= poolsize.
1577 *
1578 * - write_wakeup_threshold - the amount of entropy in the input pool
1579 * below which write polls to /dev/random will unblock, requesting
1580 * more entropy, tied to the POOL_MIN_BITS constant. It is writable
1581 * to avoid breaking old userspaces, but writing to it does not
1582 * change any behavior of the RNG.
1583 *
1// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2/*
3 * Copyright (C) 2017-2022 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
4 * Copyright Matt Mackall <mpm@selenic.com>, 2003, 2004, 2005
5 * Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999. All rights reserved.
6 *
7 * This driver produces cryptographically secure pseudorandom data. It is divided
8 * into roughly six sections, each with a section header:

--- 1567 unchanged lines hidden (view full) ---

1576 * input pool. Always <= poolsize.
1577 *
1578 * - write_wakeup_threshold - the amount of entropy in the input pool
1579 * below which write polls to /dev/random will unblock, requesting
1580 * more entropy, tied to the POOL_MIN_BITS constant. It is writable
1581 * to avoid breaking old userspaces, but writing to it does not
1582 * change any behavior of the RNG.
1583 *
1584 * - urandom_min_reseed_secs - fixed to the meaningless value "60".
1584 * - urandom_min_reseed_secs - fixed to the value CRNG_RESEED_INTERVAL.
1585 * It is writable to avoid breaking old userspaces, but writing
1586 * to it does not change any behavior of the RNG.
1587 *
1588 ********************************************************************/
1589
1590#ifdef CONFIG_SYSCTL
1591
1592#include <linux/sysctl.h>
1593
1585 * It is writable to avoid breaking old userspaces, but writing
1586 * to it does not change any behavior of the RNG.
1587 *
1588 ********************************************************************/
1589
1590#ifdef CONFIG_SYSCTL
1591
1592#include <linux/sysctl.h>
1593
1594static int sysctl_random_min_urandom_seed = 60;
1594static int sysctl_random_min_urandom_seed = CRNG_RESEED_INTERVAL / HZ;
1595static int sysctl_random_write_wakeup_bits = POOL_MIN_BITS;
1596static int sysctl_poolsize = POOL_BITS;
1597static u8 sysctl_bootid[UUID_SIZE];
1598
1599/*
1600 * This function is used to return both the bootid UUID, and random
1601 * UUID. The difference is in whether table->data is NULL; if it is,
1602 * then a new UUID is generated and returned to the user.

--- 85 unchanged lines hidden ---
1595static int sysctl_random_write_wakeup_bits = POOL_MIN_BITS;
1596static int sysctl_poolsize = POOL_BITS;
1597static u8 sysctl_bootid[UUID_SIZE];
1598
1599/*
1600 * This function is used to return both the bootid UUID, and random
1601 * UUID. The difference is in whether table->data is NULL; if it is,
1602 * then a new UUID is generated and returned to the user.

--- 85 unchanged lines hidden ---