mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* protect.c (do_encryption): Use gcry_create_nonce instad of the
obsolete WEAK_RANDOM.
This commit is contained in:
parent
dba63c0a0c
commit
d06cba6984
2 changed files with 9 additions and 4 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue