Page MenuHome GnuPG

getfnc_gather_random() aborts (in library!) if no rng source found
Closed, ResolvedPublic

Description

getfnc_gather_random() does such stupid thing like aborting in middle of
library (!?)

log_fatal (_("no entropy gathering module detected\n"));

return NULL; /*NOTREACHED*/

This happened to me on Linux with apparmor software which prevented libgcrypt
from accessing /dev/random. Unfortunately libgcrypt instead of returning
failure to the caller aborted my entire software disallowing it from failing
gracefuly.

aborts in libraries are evil.

Details

Version
1.4.3

Event Timeline

arekm set Version to 1.4.3.
arekm added a subscriber: arekm.
werner claimed this task.

No they are not. Your system is not operating correctly and thus there is no
other way than to terminate the process immediately. Most applications do not
bother to check return codes and thus Libgcrypt even does not provide a return
code for important operations like getrandom. The application can't resolve
that problem anyway.

No discussions in the bug tracker please. This topic has been discussed often
enough elsewhere.

You are wrong. My system operates correctly. Think chroot() (so no /dev) +
ligcrypt then. But if it was discussed then EOT.