aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-06-20 08:46:52 +0000
committerJustus Winter <[email protected]>2017-06-20 08:46:52 +0000
commitbadc1cdae52bd434e5fac2e4275575afeccc2837 (patch)
tree2b8f9b86b150fcc240c315a1d057ad6d290860db
parentgpg,gpgsm: Fix compliance check for DSA and avoid an assert. (diff)
downloadgnupg-badc1cdae52bd434e5fac2e4275575afeccc2837.tar.gz
gnupg-badc1cdae52bd434e5fac2e4275575afeccc2837.zip
gpg: Fix error handling.
* g10/keygen.c (generate_subkeypair): Handle errors from pinentry. -- Previously, when generating a subkey, gpg would ask for the passphrase of the primary key. If that dialog is canceled, gpg would ask a second time for a passphrase to protect the new subkey. Fix this by handling the error. GnuPG-bug-id: 3212 Signed-off-by: Justus Winter <[email protected]>
-rw-r--r--g10/keygen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index 0dfed63a7..bfbed0ebd 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -5041,6 +5041,8 @@ generate_subkeypair (ctrl_t ctrl, kbnode_t keyblock, const char *algostr,
err = agent_passwd (ctrl, hexgrip, desc, 1 /*=verify*/,
&cache_nonce, &passwd_nonce);
xfree (desc);
+ if (err)
+ goto leave;
}
/* Start creation. */