diff options
author | Moritz Schulte <mo@g10code.com> | 2005-04-27 19:29:24 +0000 |
---|---|---|
committer | Moritz Schulte <mo@g10code.com> | 2005-04-27 19:29:24 +0000 |
commit | 2fa7431c78dc9ba553c9f988cf0ec0c5483c989e (patch) | |
tree | e8c81351fbf088b1279c44facf1c60fb154b642e /mpi/mpiutil.c | |
parent | 32bf3f13e8b45497322177645bebf0b5d0c9cb8e (diff) | |
download | libgcrypt-2fa7431c78dc9ba553c9f988cf0ec0c5483c989e.tar.gz |
2005-04-27 Moritz Schulte <moritz@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).
Diffstat (limited to 'mpi/mpiutil.c')
-rw-r--r-- | mpi/mpiutil.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |