40 lines
1.7 KiB
Diff
40 lines
1.7 KiB
Diff
|
From c29424f10a0dcbd18ac25607fa1c81c18a960e81 Mon Sep 17 00:00:00 2001
|
||
|
From: Neil Horman <nhorman@tuxdriver.com>
|
||
|
Date: Mon, 16 May 2022 13:38:54 -0400
|
||
|
Subject: [PATCH] Adjust jitterentropy library to timeout/fail on long delay
|
||
|
|
||
|
[Bernd: removed description of unrelated part of the patch]
|
||
|
|
||
|
Also while we're at it, I might have a build solution for the presence
|
||
|
of internal timers. When jitterentropy is built without internal
|
||
|
timers, jent_notime_init is defined publically, but when it is built
|
||
|
with timers, its declared as a static symbol, preenting resolution, so
|
||
|
we can test to see if the function exists. If it does we _don't_ have
|
||
|
notime support. The logic is a bit backwards, but i think it works
|
||
|
|
||
|
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
||
|
[downloaded configure.ac patch from upstream commit
|
||
|
https://github.com/nhorman/rng-tools/commit/57be6d4c90e78ea9ad036a3a6e9b09822ed4d219]
|
||
|
---
|
||
|
configure.ac | 6 ++---
|
||
|
rngd_jitter.c | 62 ++++++++++++++++++++++++++++++++++++++-------------
|
||
|
2 files changed, 49 insertions(+), 19 deletions(-)
|
||
|
|
||
|
diff --git a/configure.ac b/configure.ac
|
||
|
index 52f2bb5..0af64e7 100644
|
||
|
--- a/configure.ac
|
||
|
+++ b/configure.ac
|
||
|
@@ -101,9 +101,9 @@ AS_IF(
|
||
|
AC_SEARCH_LIBS(jent_version,jitterentropy,
|
||
|
[AM_CONDITIONAL([JITTER], [true])
|
||
|
AC_DEFINE([HAVE_JITTER],1,[Enable JITTER])
|
||
|
- AC_CHECK_LIB(jitterentropy, jent_notime_settick,
|
||
|
- [AC_DEFINE([HAVE_JITTER_NOTIME],1,[Enable JITTER_NOTIME])],
|
||
|
- [],-lpthread)],
|
||
|
+ AC_CHECK_LIB(jitterentropy, jent_notime_init,
|
||
|
+ [],
|
||
|
+ [AC_DEFINE([HAVE_JITTER_NOTIME],1, [Enable JITTER_NOTIME])],-lpthread)],
|
||
|
AC_MSG_NOTICE([No Jitterentropy library found]),-lpthread)
|
||
|
], [AC_MSG_NOTICE([Disabling JITTER entropy source])]
|
||
|
)
|