aboutsummaryrefslogtreecommitdiffstats
path: root/agent/genkey.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2010-10-01 20:33:53 +0000
committerWerner Koch <[email protected]>2010-10-01 20:33:53 +0000
commitbfbd80feb95fba36292cd9dab43016f17b1e6972 (patch)
tree9afbfd29e8aeb78fa34a1a49d8b8071554d4f593 /agent/genkey.c
parent* options.skel: Make the example for force-v3-sigs match reality (it (diff)
downloadgnupg-bfbd80feb95fba36292cd9dab43016f17b1e6972.tar.gz
gnupg-bfbd80feb95fba36292cd9dab43016f17b1e6972.zip
Exporting secret keys via gpg-agent is now basically supported.
A couple of forward ported changes. Doc updates.
Diffstat (limited to '')
-rw-r--r--agent/genkey.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/agent/genkey.c b/agent/genkey.c
index 0a35643e5..c26785204 100644
--- a/agent/genkey.c
+++ b/agent/genkey.c
@@ -290,10 +290,12 @@ reenter_compare_cb (struct pin_entry_info_s *pi)
function returns 0 and store the passphrase at R_PASSPHRASE; if the
user opted not to use a passphrase NULL will be stored there. The
user needs to free the returned string. In case of an error and
- error code is returned and NULL stored at R_PASSPHRASE. */
+ error code is returned and NULL stored at R_PASSPHRASE. If
+ R_CANCEL_ALL is not NULL and the user canceled by directly closing
+ the window true will be stored at this address. */
gpg_error_t
agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt,
- char **r_passphrase)
+ char **r_passphrase, int *r_cancel_all)
{
gpg_error_t err;
const char *text1 = prompt;
@@ -314,7 +316,7 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt,
pi2->check_cb_arg = pi->pin;
next_try:
- err = agent_askpin (ctrl, text1, NULL, initial_errtext, pi);
+ err = agent_askpin (ctrl, text1, NULL, initial_errtext, pi, r_cancel_all);
initial_errtext = NULL;
if (!err)
{
@@ -327,7 +329,7 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt,
/* Unless the passphrase is empty, ask to confirm it. */
if (pi->pin && *pi->pin)
{
- err = agent_askpin (ctrl, text2, NULL, NULL, pi2);
+ err = agent_askpin (ctrl, text2, NULL, NULL, pi2, NULL);
if (err == -1)
{ /* The re-entered one did not match and the user did not
hit cancel. */
@@ -379,7 +381,7 @@ agent_genkey (ctrl_t ctrl, const char *cache_nonce,
rc = agent_ask_new_passphrase (ctrl,
_("Please enter the passphrase to%0A"
"to protect your new key"),
- &passphrase);
+ &passphrase, NULL);
if (rc)
return rc;
@@ -471,7 +473,7 @@ agent_protect_and_store (ctrl_t ctrl, gcry_sexp_t s_skey)
rc = agent_ask_new_passphrase (ctrl,
_("Please enter the new passphrase"),
- &passphrase);
+ &passphrase, NULL);
if (!rc)
{
rc = store_key (s_skey, passphrase, 1);