diff options
author | NIIBE Yutaka <[email protected]> | 2015-10-09 02:33:13 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2015-10-09 02:33:13 +0000 |
commit | f70f6695368444d8058305ab696e5e5a1bace18c (patch) | |
tree | d1797577da4a8b2702dafe1d68b2a4787764c134 /agent/genkey.c | |
parent | dirmngr: Default to http protocol for http-proxy (diff) | |
download | gnupg-f70f6695368444d8058305ab696e5e5a1bace18c.tar.gz gnupg-f70f6695368444d8058305ab696e5e5a1bace18c.zip |
agent: Fix function return type for check_cb and agent_askpin.
* agent/call-pinentry.c (unlock_pinentry): Return gpg_error_t.
(start_pinentry, setup_qualitybar): Likewise.
(agent_askpin): Fix return value check of check_cb.
* agent/command-ssh.c (reenter_compare_cb): Return gpg_error_t.
(ssh_identity_register): Fix return value check of agent_askpin.
* agent/cvt-openpgp.c (try_do_unprotect_cb): Return gpg_error_t.
* agent/findkey.c (try_unprotect_cb): Likewise.
* agent/genkey.c (reenter_compare_cb): Return gpg_error_t.
(agent_ask_new_passphrase): Fix return value check of agent_askpin.
Diffstat (limited to '')
-rw-r--r-- | agent/genkey.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/agent/genkey.c b/agent/genkey.c index e8195c200..b780c5049 100644 --- a/agent/genkey.c +++ b/agent/genkey.c @@ -326,14 +326,14 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw, /* Callback function to compare the first entered PIN with the one currently being entered. */ -static int +static gpg_error_t reenter_compare_cb (struct pin_entry_info_s *pi) { const char *pin1 = pi->check_cb_arg; if (!strcmp (pin1, pi->pin)) return 0; /* okay */ - return -1; + return gpg_error (GPG_ERR_BAD_PASSPHRASE); } @@ -410,7 +410,7 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt, if (*pi->pin && !pi->repeat_okay) { err = agent_askpin (ctrl, text2, NULL, NULL, pi2, NULL, 0); - if (err == -1) + if (gpg_err_code (err) == GPG_ERR_BAD_PASSPHRASE) { /* The re-entered one did not match and the user did not hit cancel. */ initial_errtext = xtrystrdup (L_("does not match - try again")); |