Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- rngd.c.orig 2016-06-26 09:20:49.794710463 -0500
- +++ rngd.c 2016-06-26 09:45:25.960046722 -0500
- @@ -57,6 +57,8 @@
- * Globals
- */
- +#define KERNEL_INPUT_BYTES 8192
- +
- /* Background/daemon mode */
- bool am_daemon; /* True if we went daemon */
- @@ -90,10 +92,10 @@ static struct argp_option options[] = {
- "File used for recording daemon PID, and multiple exclusion (default: /var/run/rngd.pid)" },
- { "random-step", 's', "nnn", 0,
- - "Number of bytes written to random-device at a time (default: 64)" },
- + "Number of bytes written to random-device at a time (default: 64, 0 <= n <= 8192)" },
- { "fill-watermark", 'W', "n", 0,
- - "Do not stop feeding entropy to random-device until at least n bits of entropy are available in the pool (default: 2048), 0 <= n <= 4096" },
- + "Do not stop feeding entropy to random-device until at least n bits of entropy are available in the pool (default: 2048), 0 <= n <= 65536" },
- { "quiet", 'q', 0, 0, "Suppress error messages" },
- @@ -167,7 +169,7 @@ static error_t parse_opt (int key, char
- break;
- case 'W': {
- int n;
- - if ((sscanf(arg, "%i", &n) == 0) || (n < 0) || (n > 4096))
- + if ((sscanf(arg, "%i", &n) == 0) || (n < 0) || (n > 65536))
- argp_usage(state);
- else
- arguments->fill_watermark = n;
- @@ -216,7 +218,7 @@ static int update_kernel_random(int rand
- if (fips)
- return 1;
- - for (p = buf; p + random_step <= &buf[FIPS_RNG_BUFFER_SIZE];
- + for (p = buf; p + random_step <= &buf[KERNEL_INPUT_BYTES];
- p += random_step) {
- random_add_entropy(p, random_step);
- random_sleep();
- @@ -226,7 +228,7 @@ static int update_kernel_random(int rand
- static void do_loop(int random_step)
- {
- - unsigned char buf[FIPS_RNG_BUFFER_SIZE];
- + unsigned char buf[KERNEL_INPUT_BYTES];
- int retval = 0;
- int no_work = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement