From d06cba69849c3d2fb6ecdc9733885fc44b3efdb7 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 16 Dec 2003 11:30:38 +0000 Subject: * protect.c (do_encryption): Use gcry_create_nonce instad of the obsolete WEAK_RANDOM. --- agent/protect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'agent/protect.c') diff --git a/agent/protect.c b/agent/protect.c index e438d53b4..df8a9bfe7 100644 --- a/agent/protect.c +++ b/agent/protect.c @@ -168,12 +168,12 @@ do_encryption (const char *protbegin, size_t protlen, rc = out_of_core (); if (!rc) { - /* allocate random bytes to be used as IV, padding and s2k salt*/ - iv = gcry_random_bytes (blklen*2+8, GCRY_WEAK_RANDOM); + /* Allocate random bytes to be used as IV, padding and s2k salt. */ + iv = xtrymalloc (blklen*2+8); if (!iv) rc = gpg_error (GPG_ERR_ENOMEM); - else - rc = gcry_cipher_setiv (hd, iv, blklen); + gcry_create_nonce (iv, blklen*2+8); + rc = gcry_cipher_setiv (hd, iv, blklen); } if (!rc) { -- cgit