[svn] gcry - r1398 - in branches/LIBGCRYPT-1-4-BRANCH: random src

svn author wk cvs at cvs.gnupg.org
Thu Jul 2 15:56:40 CEST 2009


Author: wk
Date: 2009-07-02 15:56:40 +0200 (Thu, 02 Jul 2009)
New Revision: 1398

Modified:
   branches/LIBGCRYPT-1-4-BRANCH/random/ChangeLog
   branches/LIBGCRYPT-1-4-BRANCH/random/rndhw.c
   branches/LIBGCRYPT-1-4-BRANCH/src/ChangeLog
   branches/LIBGCRYPT-1-4-BRANCH/src/fips.c
Log:
Small changes to reflect what fedora is doing.


Modified: branches/LIBGCRYPT-1-4-BRANCH/random/ChangeLog
===================================================================
--- branches/LIBGCRYPT-1-4-BRANCH/random/ChangeLog	2009-07-02 13:40:15 UTC (rev 1397)
+++ branches/LIBGCRYPT-1-4-BRANCH/random/ChangeLog	2009-07-02 13:56:40 UTC (rev 1398)
@@ -1,3 +1,7 @@
+2009-06-24  Werner Koch  <wk at g10code.com>
+
+	* rndhw.c (poll_padlock): Asm change from Fedora.
+
 2009-01-22  Werner Koch  <wk at g10code.com>
 
 	* random.c (_gcry_random_deinit_external_test): Do not return a

Modified: branches/LIBGCRYPT-1-4-BRANCH/src/ChangeLog
===================================================================
--- branches/LIBGCRYPT-1-4-BRANCH/src/ChangeLog	2009-07-02 13:40:15 UTC (rev 1397)
+++ branches/LIBGCRYPT-1-4-BRANCH/src/ChangeLog	2009-07-02 13:56:40 UTC (rev 1398)
@@ -1,3 +1,8 @@
+2009-06-24  Werner Koch  <wk at g10code.com>
+
+	* fips.c (_gcry_initialize_fips_mode): No FIPS mode if
+	/proc/version has insufficient permissions.
+
 2009-02-02  Werner Koch  <wk at g10code.com>
 
 	* ath.h: Include sys/time.h.  Fixes bug#993.

Modified: branches/LIBGCRYPT-1-4-BRANCH/random/rndhw.c
===================================================================
--- branches/LIBGCRYPT-1-4-BRANCH/random/rndhw.c	2009-07-02 13:40:15 UTC (rev 1397)
+++ branches/LIBGCRYPT-1-4-BRANCH/random/rndhw.c	2009-07-02 13:56:40 UTC (rev 1398)
@@ -41,8 +41,8 @@
 poll_padlock (void (*add)(const void*, size_t, enum random_origins),
               enum random_origins origin, int fast)
 {
-  char buffer[64+8] __attribute__ ((aligned (8)));
-  char *p;
+  volatile char buffer[64+8] __attribute__ ((aligned (8)));
+  volatile char *p;
   unsigned int nbytes, status;
   
   /* Peter Gutmann's cryptlib tests again whether the RNG is enabled
@@ -59,8 +59,7 @@
         ("movl %1, %%edi\n\t"         /* Set buffer.  */
          "xorl %%edx, %%edx\n\t"      /* Request up to 8 bytes.  */
          ".byte 0x0f, 0xa7, 0xc0\n\t" /* XSTORE RNG. */
-         "movl %%eax, %0\n"           /* Return the status.  */
-         : "=g" (status)
+         : "=a" (status)
          : "g" (p)
          : "%edx", "%edi", "cc"
          );
@@ -88,7 +87,7 @@
 
   if (nbytes)
     {
-      (*add) (buffer, nbytes, origin);
+      (*add) ((void*)buffer, nbytes, origin);
       wipememory (buffer, nbytes);
     }
   return nbytes;

Modified: branches/LIBGCRYPT-1-4-BRANCH/src/fips.c
===================================================================
--- branches/LIBGCRYPT-1-4-BRANCH/src/fips.c	2009-07-02 13:40:15 UTC (rev 1397)
+++ branches/LIBGCRYPT-1-4-BRANCH/src/fips.c	2009-07-02 13:56:40 UTC (rev 1398)
@@ -155,6 +155,7 @@
         fclose (fp);
       }
     else if ((saved_errno = errno) != ENOENT
+             && saved_errno != EACCES
              && !access ("/proc/version", F_OK) )
       {
         /* Problem reading the fips file despite that we have the proc




More information about the Gnupg-commits mailing list