Message ID | 00a3c4d681d3fa8ebfd15446df08643de5eb1adf.1579615562.git.cristian.ciocaltea@gmail.com |
---|---|
State | Accepted |
Delegated to: | Petr Štetiar |
Headers | show |
Series | [OpenWrt-Devel] urngd: Fix entropy provider daemon | expand |
Cristian Ciocaltea <cristian.ciocaltea@gmail.com> [2020-01-21 16:43:24]: Hi, > This patch brings the following fixes: > - poll /dev/random for unblocking write operations, instead of read > - register the low entropy callback after uloop initialization, not > before nice find, thanks! I'm going to push urngd 1.0.2 with your fixes soon. -- ynezz
diff --git a/urngd.c b/urngd.c index d8ed159..91dc72c 100644 --- a/urngd.c +++ b/urngd.c @@ -180,7 +180,7 @@ static bool urngd_init(struct urngd *u) return false; } - uloop_fd_add(&u->rnd_fd, ULOOP_READ); + uloop_fd_add(&u->rnd_fd, ULOOP_WRITE); return true; } @@ -227,6 +227,7 @@ int main(int argc, char **argv) ulog_open(ulog_channels, LOG_DAEMON, "urngd"); + uloop_init(); if (!urngd_init(&urngd_service)) return -1; @@ -234,7 +235,6 @@ int main(int argc, char **argv) gather_entropy(&urngd_service); - uloop_init(); uloop_run(); uloop_done();