gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_11_6-132-g786d


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_11_6-132-g786d7ec
Date: Thu, 24 Feb 2011 16:23:28 +0000

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 "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=786d7ec0a1c0967a671c5f9415f5a07c0cc6d787

The branch, gnutls_2_12_x has been updated
       via  786d7ec0a1c0967a671c5f9415f5a07c0cc6d787 (commit)
      from  2fa2546be742aebfd97d039cabd86d941d7bc04f (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 786d7ec0a1c0967a671c5f9415f5a07c0cc6d787
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Feb 24 17:19:29 2011 +0100

    Detect fork() in the random number generator and reseed.

-----------------------------------------------------------------------

Summary of changes:
 lib/nettle/rnd.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/lib/nettle/rnd.c b/lib/nettle/rnd.c
index e623c90..9ccb398 100644
--- a/lib/nettle/rnd.c
+++ b/lib/nettle/rnd.c
@@ -155,6 +155,7 @@ wrap_nettle_rnd_deinit (void *ctx)
 #include <sys/time.h>
 #include <fcntl.h>
 #include <locks.h>
+#include <unistd.h> /* getpid */
 #ifdef HAVE_GETRUSAGE
 #include <sys/resource.h>
 #endif
@@ -346,6 +347,7 @@ do_device_source_egd (int init)
 static int
 do_device_source (int init)
 {
+  static pid_t pid; /* detect fork() */
   int ret;
   static int (*do_source) (int init) = NULL;
 /* using static var here is ok since we are
@@ -354,6 +356,8 @@ do_device_source (int init)
 
   if (init == 1)
     {
+      pid = getpid();
+
       do_source = do_device_source_urandom;
       ret = do_source (init);
       if (ret < 0)
@@ -372,6 +376,12 @@ do_device_source (int init)
     }
   else
     {
+      if (getpid() != pid) 
+        { /* fork() detected */
+          device_last_read = 0;
+          pid = getpid();
+        }
+    
       return do_source (init);
     }
 }


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]