diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2020-01-17 07:11:02 +0100 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2020-01-17 08:09:01 +0100 |
commit | 853d5b7677ea01f65c9bc5160cd8509b62f486f7 (patch) | |
tree | 848bb0adc423a9abbd67d716a641eb6b7849815f /g10/call-agent.c | |
parent | card: Allow switching of cards and applications. (diff) | |
download | gnupg2-853d5b7677ea01f65c9bc5160cd8509b62f486f7.tar.xz gnupg2-853d5b7677ea01f65c9bc5160cd8509b62f486f7.zip |
gpg: Prepare enhancement of agent_probe_secret_key.
* g10/call-agent.c (agent_probe_secret_key): Change semantics of
return value.
* g10/call-agent.h (agent_probe_secret_key): Change comment.
* g10/delkey.c (do_delete_key): Follow the change.
* g10/getkey.c (get_seckey, parse_def_secret_key): Likewise.
(finish_lookup, have_secret_key_with_kid): Likewise.
* g10/gpgv.c (agent_probe_secret_key): Likewise.
* g10/keyedit.c (keyedit_menu, quick_find_keyblock): Likewise.
(show_key_with_all_names_colon): Likewise.
* g10/revoke.c (gen_desig_revoke, gen_revoke): Likewise
* g10/test-stubs.c (agent_probe_secret_key): Likewise.
--
GnuPG-bug-id: 3416
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r-- | g10/call-agent.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c index c71d50a56..f4ee3cdae 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -1928,8 +1928,8 @@ agent_get_s2k_count (void) /* Ask the agent whether a secret key for the given public key is - available. Returns 0 if available. */ -gpg_error_t + available. Returns 0 if not available. */ +int agent_probe_secret_key (ctrl_t ctrl, PKT_public_key *pk) { gpg_error_t err; @@ -1948,7 +1948,9 @@ agent_probe_secret_key (ctrl_t ctrl, PKT_public_key *pk) xfree (hexgrip); err = assuan_transact (agent_ctx, line, NULL, NULL, NULL, NULL, NULL, NULL); - return err; + if (err) + return 0; + return 1; } /* Ask the agent whether a secret key is available for any of the |