[svn] gcry - r1194 - in branches/LIBGCRYPT-1-2-BRANCH: . cipher tests
svn author wk
cvs at cvs.gnupg.org
Mon Dec 18 19:06:39 CET 2006
Author: wk
Date: 2006-12-18 19:06:38 +0100 (Mon, 18 Dec 2006)
New Revision: 1194
Modified:
branches/LIBGCRYPT-1-2-BRANCH/Makefile.am
branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog
branches/LIBGCRYPT-1-2-BRANCH/cipher/rndlinux.c
branches/LIBGCRYPT-1-2-BRANCH/tests/ChangeLog
branches/LIBGCRYPT-1-2-BRANCH/tests/ac.c
Log:
set close-on-exit for the random device.
Modified: branches/LIBGCRYPT-1-2-BRANCH/Makefile.am
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/Makefile.am 2006-11-30 16:42:47 UTC (rev 1193)
+++ branches/LIBGCRYPT-1-2-BRANCH/Makefile.am 2006-12-18 18:06:38 UTC (rev 1194)
@@ -20,7 +20,7 @@
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = dist-bzip2
-DIST_SUBDIRS = mpi cipher src doc tests w32-dll
+DIST_SUBDIRS = m4 mpi cipher src doc tests w32-dll
SUBDIRS = m4 mpi cipher src doc tests
EXTRA_DIST = BUGS autogen.sh README.apichanges README.SVN
DISTCLEANFILES =
Modified: branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog 2006-11-30 16:42:47 UTC (rev 1193)
+++ branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog 2006-12-18 18:06:38 UTC (rev 1194)
@@ -1,3 +1,9 @@
+2006-12-18 Werner Koch <wk at g10code.com>
+
+ * rndlinux.c (set_cloexec_flag): New.
+ (open_device): Set close-on-exit flags. Suggested by Max
+ Kellermann. Fixes Debian#403613.
+
2006-09-11 Werner Koch <wk at g10code.com>
* rndw32.c (slow_gatherer_windowsNT): While adding data use the
Modified: branches/LIBGCRYPT-1-2-BRANCH/cipher/rndlinux.c
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/cipher/rndlinux.c 2006-11-30 16:42:47 UTC (rev 1193)
+++ branches/LIBGCRYPT-1-2-BRANCH/cipher/rndlinux.c 2006-12-18 18:06:38 UTC (rev 1194)
@@ -42,6 +42,19 @@
int requester,
size_t length, int level );
+static int
+set_cloexec_flag (int fd)
+{
+ int oldflags;
+
+ oldflags= fcntl (fd, F_GETFD, 0);
+ if (oldflags < 0)
+ return oldflags;
+ oldflags |= FD_CLOEXEC;
+ return fcntl (fd, F_SETFD, oldflags);
+}
+
+
/*
* Used to open the /dev/random devices (Linux, xBSD, Solaris (if it exists)).
*/
@@ -54,6 +67,10 @@
if( fd == -1 )
log_fatal ("can't open %s: %s\n", name, strerror(errno) );
+ if (set_cloexec_flag (fd))
+ log_error ("error setting FD_CLOEXEC on fd %d: %s\n",
+ fd, strerror (errno));
+
/* We used to do the follwing check, however it turned out that this
is not portable since more OSes provide a random device which is
sometimes implemented as anoteher device type.
Modified: branches/LIBGCRYPT-1-2-BRANCH/tests/ChangeLog
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/tests/ChangeLog 2006-11-30 16:42:47 UTC (rev 1193)
+++ branches/LIBGCRYPT-1-2-BRANCH/tests/ChangeLog 2006-12-18 18:06:38 UTC (rev 1194)
@@ -1,3 +1,7 @@
+2006-11-30 Werner Koch <wk at g10code.com>
+
+ * ac.c (main): Set quick random flag.
+
2006-08-28 Werner Koch <wk at g10code.com>
* t-mpi-bit.c: New. Copied from development branch.
Modified: branches/LIBGCRYPT-1-2-BRANCH/tests/ac.c
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/tests/ac.c 2006-11-30 16:42:47 UTC (rev 1193)
+++ branches/LIBGCRYPT-1-2-BRANCH/tests/ac.c 2006-12-18 18:06:38 UTC (rev 1194)
@@ -149,6 +149,8 @@
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
if (debug)
gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1u , 0);
+ /* No valuable keys are create, so we can speed up our RNG. */
+ gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
for (; i > 0; i--)
check_run ();
More information about the Gnupg-commits
mailing list