diff options
Diffstat (limited to 'agent')
-rw-r--r-- | agent/ChangeLog | 6 | ||||
-rw-r--r-- | agent/genkey.c | 2 | ||||
-rw-r--r-- | agent/protect.c | 7 |
3 files changed, 12 insertions, 3 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog index 329990951..4829ff2d4 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,9 @@ +2009-06-24 Werner Koch <[email protected]> + + * genkey.c (agent_protect_and_store): Return RC and not 0. + * protect.c (do_encryption): Fix ignored error code from malloc. + Reported by Fabian Keil. + 2009-06-17 Werner Koch <[email protected]> * call-pinentry.c (agent_get_confirmation): Add arg WITH_CANCEL. diff --git a/agent/genkey.c b/agent/genkey.c index 4bf0dcdcb..d86296390 100644 --- a/agent/genkey.c +++ b/agent/genkey.c @@ -480,5 +480,5 @@ agent_protect_and_store (ctrl_t ctrl, gcry_sexp_t s_skey) rc = store_key (s_skey, pi? pi->pin:NULL, 1); xfree (pi); - return 0; + return rc; } diff --git a/agent/protect.c b/agent/protect.c index 8b022ecfb..d6457ad2a 100644 --- a/agent/protect.c +++ b/agent/protect.c @@ -176,8 +176,11 @@ do_encryption (const unsigned char *protbegin, size_t protlen, iv = xtrymalloc (blklen*2+8); if (!iv) rc = gpg_error (GPG_ERR_ENOMEM); - gcry_create_nonce (iv, blklen*2+8); - rc = gcry_cipher_setiv (hd, iv, blklen); + else + { + gcry_create_nonce (iv, blklen*2+8); + rc = gcry_cipher_setiv (hd, iv, blklen); + } } if (!rc) { |