LIBGCRYPT-1-2-BRANCH libgcrypt/mpi (ChangeLog mpiutil.c)

cvs user mo cvs at cvs.gnupg.org
Sun May 29 11:11:44 CEST 2005


    Date: Sunday, May 29, 2005 @ 11:32:24
  Author: mo
    Path: /cvs/libgcrypt/libgcrypt/mpi
     Tag: LIBGCRYPT-1-2-BRANCH

Modified: ChangeLog mpiutil.c

2005-05-29  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.89.2.3 libgcrypt/mpi/ChangeLog:1.89.2.4
--- libgcrypt/mpi/ChangeLog:1.89.2.3	Wed Feb 16 20:48:13 2005
+++ libgcrypt/mpi/ChangeLog	Sun May 29 11:32:24 2005
@@ -1,3 +1,8 @@
+2005-05-29  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-02-16  Moritz Schulte  <moritz at g10code.com>
 
 	* mpiutil.c (_gcry_mpi_alloc_limb_space): Rewritten, fixed memory
Index: libgcrypt/mpi/mpiutil.c
diff -u libgcrypt/mpi/mpiutil.c:1.38.2.1 libgcrypt/mpi/mpiutil.c:1.38.2.2
--- libgcrypt/mpi/mpiutil.c:1.38.2.1	Wed Feb 16 20:48:13 2005
+++ libgcrypt/mpi/mpiutil.c	Sun May 29 11:32:24 2005
@@ -382,14 +382,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