mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
gcrypt: switch to system rng before gcry_check_version (#24162)
Current docs claim this must be done before gcry_check_version.
(cherry picked from commit 91375fb9cf
)
This commit is contained in:
parent
79de67e2df
commit
695eb67322
@ -9,6 +9,7 @@ void initialize_libgcrypt(bool secmem) {
|
|||||||
if (gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P))
|
if (gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
gcry_control(GCRYCTL_SET_PREFERRED_RNG_TYPE, GCRY_RNG_TYPE_SYSTEM);
|
||||||
assert_se(gcry_check_version("1.4.5"));
|
assert_se(gcry_check_version("1.4.5"));
|
||||||
|
|
||||||
/* Turn off "secmem". Clients which wish to make use of this
|
/* Turn off "secmem". Clients which wish to make use of this
|
||||||
@ -16,7 +17,6 @@ void initialize_libgcrypt(bool secmem) {
|
|||||||
if (!secmem)
|
if (!secmem)
|
||||||
gcry_control(GCRYCTL_DISABLE_SECMEM);
|
gcry_control(GCRYCTL_DISABLE_SECMEM);
|
||||||
|
|
||||||
gcry_control(GCRYCTL_SET_PREFERRED_RNG_TYPE, GCRY_RNG_TYPE_SYSTEM);
|
|
||||||
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
|
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user