[git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-135-g3028a22
by NIIBE Yutaka
cvs at cvs.gnupg.org
Wed Dec 19 02:33:17 CET 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, master has been updated
via 3028a221d39c1b593ea0c1bcbfccd33959769692 (commit)
from 876f7280e8604bc99ddda0526339ec5ec6b23c4b (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 3028a221d39c1b593ea0c1bcbfccd33959769692
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Wed Dec 19 10:28:32 2018 +0900
random: Add finalizer for rndjent.
* random/rand-internal.h (_gcry_rndjent_fini): New.
* random/rndjent.c (_gcry_rndjent_fini): New.
* random/rndlinux.c (_gcry_rndlinux_gather_random): Call the finalizer
when GCRYCTL_CLOSE_RANDOM_DEVICE.
--
GnuPG-bug-id: 3731
Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
diff --git a/random/rand-internal.h b/random/rand-internal.h
index 2bc05f4..d99c667 100644
--- a/random/rand-internal.h
+++ b/random/rand-internal.h
@@ -132,6 +132,7 @@ size_t _gcry_rndjent_poll (void (*add)(const void*,
enum random_origins origin,
size_t length);
void _gcry_rndjent_dump_stats (void);
+void _gcry_rndjent_fini (void);
/*-- rndhw.c --*/
int _gcry_rndhw_failed_p (void);
diff --git a/random/rndjent.c b/random/rndjent.c
index 3740ddd..3d01290 100644
--- a/random/rndjent.c
+++ b/random/rndjent.c
@@ -370,3 +370,20 @@ _gcry_rndjent_dump_stats (void)
}
#endif /*USE_JENT*/
}
+
+
+void
+_gcry_rndjent_fini (void)
+{
+#ifdef USE_JENT
+ lock_rng ();
+
+ if (jent_rng_is_initialized)
+ {
+ jent_entropy_collector_free (jent_rng_collector);
+ jent_rng_collector = NULL;
+ }
+
+ unlock_rng ();
+#endif
+}
diff --git a/random/rndlinux.c b/random/rndlinux.c
index fefc3c3..3d41cd3 100644
--- a/random/rndlinux.c
+++ b/random/rndlinux.c
@@ -156,6 +156,8 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t,
close (fd_urandom);
fd_urandom = -1;
}
+
+ _gcry_rndjent_fini ();
return 0;
}
-----------------------------------------------------------------------
Summary of changes:
random/rand-internal.h | 1 +
random/rndjent.c | 17 +++++++++++++++++
random/rndlinux.c | 2 ++
3 files changed, 20 insertions(+)
hooks/post-receive
--
The GNU crypto library
http://git.gnupg.org
_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits
More information about the Gcrypt-devel
mailing list