Skip to content

Commit

Permalink
gcrypt: prefer the OS RNG
Browse files Browse the repository at this point in the history
by default, gcrypt defaults to an userspace RNG, this is
the wrong thing (tm) to do on linux.

Switch to the SYSTEM rng instead.

(cherry picked from commit 80f9673)
  • Loading branch information
crrodriguez authored and keszybz committed Aug 8, 2022
1 parent e7d635f commit ca0ed3a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/basic/gcrypt-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit ca0ed3a

Please sign in to comment.