[PATCH v2 3/4] urngd: Add support for read()ing entropy

2020-07-20 Thread nwfilardo
From: Nathaniel Wesley Filardo This allows us to attach a hwrng, for example. At most one sample will be taken every time we also add entropy via the jitter mechanism. We won't try reading if the stream hasn't indicated its readiness, and we'll go back to waiting if ever the stream produces 0 b

[PATCH v2 1/4] urngd: Refactor out persistant rand_pool_info

2020-07-20 Thread nwfilardo
From: Nathaniel Wesley Filardo There's no need to hold one of these structures across invocations of low_entropy_cb. Just put one on the stack and use that. Signed-off-by: Nathaniel Wesley Filardo --- urngd.c | 62 + 1 file changed, 18 i

[PATCH v2 2/4] urngd: Remove some unused #defines

2020-07-20 Thread nwfilardo
From: Nathaniel Wesley Filardo These look like there had been plans to stay asleep if there was "sufficient" entropy in the system, but the code does not do so. Signed-off-by: Nathaniel Wesley Filardo --- urngd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/urngd.c b/urngd.c index f782

[PATCH v2 4/4] urngd: Add source information to log message

2020-07-20 Thread nwfilardo
From: Nathaniel Wesley Filardo Now that entropy can come from two places, indicate which Signed-off-by: Nathaniel Wesley Filardo --- urngd.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/urngd.c b/urngd.c index 1168674..9eedb6b 100644 --- a/urngd.c +++ b/urngd.c

[PATCH 1/4] urngd: Refactor out persistant rand_pool_info

2020-07-13 Thread nwfilardo
From: Nathaniel Wesley Filardo There's no need to hold one of these structures across invocations of low_entropy_cb. Just put one on the stack and use that. Signed-off-by: Nathaniel Wesley Filardo --- urngd.c | 62 + 1 file changed, 18 i

[PATCH 3/4] urngd: Add support for read()ing entropy

2020-07-13 Thread nwfilardo
From: Nathaniel Wesley Filardo This allows us to attach a hwrng, for example. At most one sample will be taken every time we also add entropy via the jitter mechanism. We won't try reading if the stream hasn't indicated its readiness, and we'll go back to waiting if ever the stream produces 0 b

[PATCH 4/4] urngd: Add source information to log message

2020-07-13 Thread nwfilardo
From: Nathaniel Wesley Filardo Now that entropy can come from two places, indicate which Signed-off-by: Nathaniel Wesley Filardo --- urngd.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/urngd.c b/urngd.c index d6c48f8..cc2b85d 100644 --- a/urngd.c +++ b/urngd.

[PATCH 2/4] urngd: Remove some unused #defines

2020-07-13 Thread nwfilardo
From: Nathaniel Wesley Filardo These look like there had been plans to stay asleep if there was "sufficient" entropy in the system, but the code does not do so. Signed-off-by: Nathaniel Wesley Filardo --- urngd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/urngd.c b/urngd.c index f782

[PATCH] urngd: Add support for read()ing entropy

2020-07-12 Thread nwfilardo
From: Nathaniel Wesley Filardo This allows us to attach a hwrng exposed as a character device (e.g.). At most one sample will be taken every time we also add entropy via the jitter mechanism. We won't try reading if the stream hasn't indicated its readiness, and we'll go back to waiting if ever