It is often useful to run use haveged directly for creating secure cryptographic keys or passwords, no matter whether the program is also running as a daemon at the same time.
in order to create a password equivalent to a key strength of 256 bit.
Unfortunately, this fails if a daemon (or just another instance of the program as a regular user application) is running at the same time.
The enclosed patch fixes the problem.
Without this patch, the application tries to create the command
socket, even when running as a regular user application for
harvesting entropy independent of any daemon.
This will fail if another instance of haveged is already running,
no matter whether that other instance is a daemon or not.
This patch will make the application ignore the socket when run
as a regular user application, thus avoiding the problem.
(Patch created 2021-11-03 by Guenther Brunthaler.)
Index: haveged-1.9.14/src/haveged.c
===================================================================
--- haveged-1.9.14.orig/src/haveged.c
+++ haveged-1.9.14/src/haveged.c
@@ -429,7 +429,7 @@ int main(int argc, char **argv)
close(socket_fd);
return ret;
}
- else {
+ else if (!(params->setup & RUN_AS_APP)){
socket_fd = cmd_listen(params);
if (socket_fd >= 0)
fprintf(stderr, "%s: command socket is listening at fd %d\n", params->daemon, socket_fd);
It is often useful to run use haveged directly for creating secure cryptographic keys or passwords, no matter whether the program is also running as a daemon at the same time.
For instance, I frequently use
in order to create a password equivalent to a key strength of 256 bit.
Unfortunately, this fails if a daemon (or just another instance of the program as a regular user application) is running at the same time.
The enclosed patch fixes the problem.