libgcrypt/mpi (ChangeLog mpiutil.c)

cvs user mo cvs at cvs.gnupg.org
Wed Apr 27 21:11:46 CEST 2005


    Date: Wednesday, April 27, 2005 @ 21:29:24
  Author: mo
    Path: /cvs/libgcrypt/libgcrypt/mpi

Modified: ChangeLog mpiutil.c

2005-04-27  Moritz Schulte  <moritz at g10code.com>

	* mpiutil.c (gcry_mpi_randomize): Store random data in secure
	memory if the given MPI is secure - not the other way around (argl).


-----------+
 ChangeLog |    5 +++++
 mpiutil.c |    8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)


Index: libgcrypt/mpi/ChangeLog
diff -u libgcrypt/mpi/ChangeLog:1.93 libgcrypt/mpi/ChangeLog:1.94
--- libgcrypt/mpi/ChangeLog:1.93	Sat Apr 23 00:39:43 2005
+++ libgcrypt/mpi/ChangeLog	Wed Apr 27 21:29:24 2005
@@ -1,3 +1,8 @@
+2005-04-27  Moritz Schulte  <moritz at g10code.com>
+
+	* mpiutil.c (gcry_mpi_randomize): Store random data in secure
+	memory if the given MPI is secure - not the other way around (argl).
+
 2005-04-23  Moritz Schulte  <moritz at g10code.com>
 
 	* Makefile.am: Don't assume the compiler will pre-process the .S
Index: libgcrypt/mpi/mpiutil.c
diff -u libgcrypt/mpi/mpiutil.c:1.39 libgcrypt/mpi/mpiutil.c:1.40
--- libgcrypt/mpi/mpiutil.c:1.39	Wed Feb 16 20:48:35 2005
+++ libgcrypt/mpi/mpiutil.c	Wed Apr 27 21:29:24 2005
@@ -410,14 +410,14 @@
   
   if (level == GCRY_WEAK_RANDOM)
     {
-      p = mpi_is_secure(w) ? gcry_xmalloc (nbytes)
-                           : gcry_xmalloc_secure (nbytes);
+      p = mpi_is_secure(w) ? gcry_xmalloc_secure (nbytes)
+                           : gcry_xmalloc (nbytes);
       gcry_create_nonce (p, nbytes);
     }
   else
     {
-      p = mpi_is_secure(w) ? gcry_random_bytes (nbytes, level)
-                           : gcry_random_bytes_secure (nbytes, level);
+      p = mpi_is_secure(w) ? gcry_random_bytes_secure (nbytes, level)
+                           : gcry_random_bytes (nbytes, level);
     }
   _gcry_mpi_set_buffer( w, p, nbytes, 0 );
   gcry_free (p);




More information about the Gnupg-commits mailing list