mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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>
This commit is contained in:
parent
bd85f9232a
commit
853d5b7677
8 changed files with 32 additions and 26 deletions
|
@ -1454,7 +1454,7 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
|
|||
{
|
||||
have_anyseckey = !agent_probe_any_secret_key (ctrl, keyblock);
|
||||
if (have_anyseckey
|
||||
&& !agent_probe_secret_key (ctrl, keyblock->pkt->pkt.public_key))
|
||||
&& agent_probe_secret_key (ctrl, keyblock->pkt->pkt.public_key))
|
||||
{
|
||||
/* The primary key is also available. */
|
||||
have_seckey = 1;
|
||||
|
@ -2324,7 +2324,8 @@ quick_find_keyblock (ctrl_t ctrl, const char *username,
|
|||
/* We require the secret primary key to set the primary UID. */
|
||||
node = find_kbnode (keyblock, PKT_PUBLIC_KEY);
|
||||
log_assert (node);
|
||||
err = agent_probe_secret_key (ctrl, node->pkt->pkt.public_key);
|
||||
if (!agent_probe_secret_key (ctrl, node->pkt->pkt.public_key))
|
||||
err = gpg_error (GPG_ERR_NO_SECKEY);
|
||||
}
|
||||
}
|
||||
else if (gpg_err_code (err) == GPG_ERR_NOT_FOUND)
|
||||
|
@ -3229,7 +3230,7 @@ show_key_with_all_names_colon (ctrl_t ctrl, estream_t fp, kbnode_t keyblock)
|
|||
}
|
||||
|
||||
keyid_from_pk (pk, keyid);
|
||||
have_seckey = !agent_probe_secret_key (ctrl, pk);
|
||||
have_seckey = agent_probe_secret_key (ctrl, pk);
|
||||
|
||||
if (node->pkt->pkttype == PKT_PUBLIC_KEY)
|
||||
es_fputs (have_seckey? "sec:" : "pub:", fp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue