[git] GCRYPT - branch, LIBGCRYPT-1.8-BRANCH, updated. libgcrypt-1.8.3-2-g20c0348
by Will Dietz
cvs at cvs.gnupg.org
Tue Jun 19 05:16:45 CEST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".
The branch, LIBGCRYPT-1.8-BRANCH has been updated
via 20c034865f2dd15ce2871385b6e29c15d1570539 (commit)
from 6ca6344429e5ee1657e164509c6b50a717ebec68 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 20c034865f2dd15ce2871385b6e29c15d1570539
Author: Will Dietz <w at wdtz.org>
Date: Sun Jun 17 18:53:58 2018 -0500
random: Fix hang of _gcry_rndjent_get_version.
* random/rndjent.c (_gcry_rndjent_get_version): Move locking.
--
cherry-picked from master commit:
355f5b7f69075c010fe33aa5b10ac60c08fae0c7
While the protection for jent_rng_collector is needed,
_gcry_rndjent_poll is also acquiring the lock for the variable.
Thus, it hangs.
This change is sub-optimal, the lock is once released after the call
of _gcry_rndjent_poll. It might be good to modify the API of
_gcry_rndjent_poll to explicitly allow this use case of forcing
initialization keeping the lock.
Comments and change log entry by gniibe.
GnuPG-bug-id: 4034
Fixes-commit: 0de2a22fcf6607d0aecb550feefa414cee3731b2
diff --git a/random/rndjent.c b/random/rndjent.c
index 0c5a820..3740ddd 100644
--- a/random/rndjent.c
+++ b/random/rndjent.c
@@ -334,9 +334,10 @@ _gcry_rndjent_get_version (int *r_active)
{
if (r_active)
{
- lock_rng ();
/* Make sure the RNG is initialized. */
_gcry_rndjent_poll (NULL, 0, 0);
+
+ lock_rng ();
/* To ease debugging we store 2 for a clock_gettime based
* implementation and 1 for a rdtsc based code. */
*r_active = jent_rng_collector? is_rng_available () : 0;
-----------------------------------------------------------------------
Summary of changes:
random/rndjent.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
hooks/post-receive
--
The GNU crypto library
http://git.gnupg.org
More information about the Gnupg-commits
mailing list