gcrypt: prefer the OS RNG

by default, gcrypt defaults to an userspace RNG, this is
the wrong thing (tm) to do on linux.

Switch to the SYSTEM rng instead.
This commit is contained in:
Cristian Rodríguez 2022-07-26 18:24:12 +00:00 committed by Lennart Poettering
parent c15d1ac2c4
commit 80f967311a

View file

@ -15,6 +15,8 @@ void initialize_libgcrypt(bool secmem) {
* feature should initialize the library manually */
if (!secmem)
gcry_control(GCRYCTL_DISABLE_SECMEM);
gcry_control(GCRYCTL_SET_PREFERRED_RNG_TYPE, GCRY_RNG_TYPE_SYSTEM);
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
}