diff options
Diffstat (limited to 'main/rng-tools/07-use-jent_entropy_init_ex.patch')
-rw-r--r-- | main/rng-tools/07-use-jent_entropy_init_ex.patch | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/main/rng-tools/07-use-jent_entropy_init_ex.patch b/main/rng-tools/07-use-jent_entropy_init_ex.patch deleted file mode 100644 index 3f9126afeec..00000000000 --- a/main/rng-tools/07-use-jent_entropy_init_ex.patch +++ /dev/null @@ -1,70 +0,0 @@ -augment rngd_jitter to use jent_entropy_init_ex if available -A new interface was added to jitter to support autoscaling the entropy -buffer size to optimize entropy size and collection time, if available, -use that api to make jitter more usable on smaller systems with slower -cpus. - -Signed-off-by: Neil Horman <nhorman@tuxdriver.com> - ---- - -diff -aur a/configure.ac b/configure.ac ---- a/configure.ac -+++ b/configure.ac -@@ -96,6 +96,9 @@ - AC_DEFINE([HAVE_JITTER],1,[Enable JITTER]) - AC_CHECK_LIB(jitterentropy, jent_entropy_switch_notime_impl, - [AC_DEFINE([HAVE_JITTER_NOTIME],1,[Enable JITTER_NOTIME])], -+ [],-lpthread) -+ AC_CHECK_LIB(jitterentropy, jent_entropy_init_ex, -+ [AC_DEFINE([HAVE_JENT_INIT_EX],1,[Enable JITTER_INIT_EX])], - [],-lpthread)], - AC_MSG_NOTICE([No Jitterentropy library found]),-lpthread) - ], [AC_MSG_NOTICE([Disabling JITTER entropy source])] -diff -aur a/rngd_jitter.c b/rngd_jitter.c ---- a/rngd_jitter.c -+++ b/rngd_jitter.c -@@ -313,12 +313,17 @@ - - /* We are awake because we need to refil the buffer */ - clock_gettime(CLOCK_REALTIME, &start); -+#ifdef HAVE_JENT_INIT_EX -+ ret = jent_read_entropy_safe(&me->ec, tmpbuf, me->buf_sz); -+#else - ret = jent_read_entropy(me->ec, tmpbuf, me->buf_sz); -+#endif - clock_gettime(CLOCK_REALTIME, &end); - message_entsrc(me->ent_src,LOG_DEBUG|LOG_ERR, "jent_read_entropy time on cpu %d is %.12e sec\n", - me->core_id, elapsed_time(&start, &end)); -- if (ret < 0) -- message_entsrc(me->ent_src,LOG_DAEMON|LOG_DEBUG, "JITTER THREAD_FAILS TO GATHER ENTROPY\n"); -+ if (ret < 0) { -+ message_entsrc(me->ent_src,LOG_DAEMON|LOG_DEBUG, "JITTER THREAD_FAILS TO GATHER ENTROPY, exiting\n"); -+ } - /* Need to hold the mutex to update the sleep time */ - update_sleep_time(me, &start, &end); - -@@ -417,7 +422,11 @@ - entflags |= JENT_FORCE_INTERNAL_TIMER; - #endif - -+#ifdef HAVE_JENT_INIT_EX -+ ret = jent_entropy_init_ex(0, JENT_MAX_MEMSIZE_MAX); -+#else - ret = jent_entropy_init(); -+#endif - if (ret) { - message_entsrc(ent_src,LOG_DAEMON|LOG_WARNING, "JITTER rng fails with code %d\n", ret); - return 1; -@@ -478,7 +487,11 @@ - tdata[i].done = -1; - core_id++; - tdata[i].buf_sz = ent_src->rng_options[JITTER_OPT_BUF_SZ].int_val; -+#ifdef HAVE_JENT_INIT_EX -+ tdata[i].ec = jent_entropy_collector_alloc(0, JENT_MAX_MEMSIZE_MAX); -+#else - tdata[i].ec = jent_entropy_collector_alloc(1, entflags); -+#endif - if (tdata[i].ec == NULL) { - message_entsrc(ent_src,LOG_DAEMON|LOG_WARNING, "Unable to start thread for jitter, likely due to lack of cpu count\n"); - close(pipefds[0]); |