From 2fa7431c78dc9ba553c9f988cf0ec0c5483c989e Mon Sep 17 00:00:00 2001 From: Moritz Schulte Date: Wed, 27 Apr 2005 19:29:24 +0000 Subject: 2005-04-27 Moritz Schulte * mpiutil.c (gcry_mpi_randomize): Store random data in secure memory if the given MPI is secure - not the other way around (argl). --- mpi/mpiutil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mpi/mpiutil.c') diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c index 8c99bf77..f50268f3 100644 --- a/mpi/mpiutil.c +++ b/mpi/mpiutil.c @@ -410,14 +410,14 @@ gcry_mpi_randomize( gcry_mpi_t w, 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); -- cgit v1.2.1