summaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2009-06-24 16:03:09 +0200
committerWerner Koch <wk@gnupg.org>2009-06-24 16:03:09 +0200
commit2e0ce7d97f0de998cdf8e95e17ce169b7cae91cd (patch)
treec4042057b382f755d3bc1799e9c78d3355436fa2 /agent
parentPost release updates (diff)
downloadgnupg2-2e0ce7d97f0de998cdf8e95e17ce169b7cae91cd.tar.xz
gnupg2-2e0ce7d97f0de998cdf8e95e17ce169b7cae91cd.zip
Fixed a bunch of little bugs as reported by Fabian Keil.
Still one problem left; marked with a gcc #warning.
Diffstat (limited to 'agent')
-rw-r--r--agent/ChangeLog6
-rw-r--r--agent/genkey.c2
-rw-r--r--agent/protect.c7
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 <wk@g10code.com>
+
+ * 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 <wk@g10code.com>
* 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)
{