1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

g10: fix regression of bkuptocard subcommand in --edit-key.

* g10/keyedit.c (keyedit_menu): Call transfer_secret_keys.
* g10/import.c (transfer_secret_keys): Make it global function.
Allow stats==NULL.

--

GnuPG-bug-id: 2169
This commit is contained in:
NIIBE Yutaka 2015-12-24 09:54:23 +09:00
parent e684c634df
commit 40959add1b
3 changed files with 28 additions and 14 deletions

View file

@ -1922,7 +1922,6 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
case cmdBKUPTOCARD:
case cmdCHECKBKUPKEY:
log_debug ("FIXME: This needs to be changed\n");
{
/* Ask for a filename, check whether this is really a
backup key as generated by the card generation, parse
@ -1975,6 +1974,7 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
if (cmd == cmdCHECKBKUPKEY)
{
log_debug ("FIXME: This needs to be changed\n");
/* PKT_public_key *sk = node->pkt->pkt.secret_key; */
/* switch (is_secret_key_protected (sk)) */
/* { */
@ -1996,14 +1996,21 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
/* } */
}
else /* Store it. */
{
if (card_store_subkey (node, 0))
{
redisplay = 1;
sec_shadowing = 1;
}
}
release_kbnode (node);
{
/* We need to transfer it to gpg-agent. */
err = transfer_secret_keys (ctrl, NULL, node, 1);
/* Then, treat the pkt as a public key to call
card_store_subkey. */
pkt->pkttype = PKT_PUBLIC_KEY;
if (card_store_subkey (node, 0))
{
redisplay = 1;
sec_shadowing = 1;
}
}
release_kbnode (node);
}
break;