From f70f6695368444d8058305ab696e5e5a1bace18c Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 9 Oct 2015 11:33:13 +0900 Subject: 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. --- agent/command-ssh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'agent/command-ssh.c') diff --git a/agent/command-ssh.c b/agent/command-ssh.c index 0aa0098f2..6144ae1a8 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -3040,14 +3040,14 @@ ssh_key_to_protected_buffer (gcry_sexp_t key, const char *passphrase, /* 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); } @@ -3133,7 +3133,7 @@ ssh_identity_register (ctrl_t ctrl, ssh_key_type_spec_t *spec, if (*pi->pin && !pi->repeat_okay) { err = agent_askpin (ctrl, description2, 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 = L_("does not match - try again"); -- cgit v1.2.3