mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
g10: Remove subcommand checkbkupkey for --key-edit.
* g10/keyedit.c (keyedit_menu): Remove cmdCHECKBKUPKEY support. -- GnuPG-bug-id: 2169 It was introduced by the commit 9e834047 in 2009. Then, we moved private key handling to gpg-agent which broke this subcommand. Note: This subcommand was not supported in 1.4 and 2.0.
This commit is contained in:
parent
ee433d2b00
commit
44aee35e69
@ -1352,7 +1352,7 @@ enum cmdids
|
|||||||
#endif /*!NO_TRUST_MODELS*/
|
#endif /*!NO_TRUST_MODELS*/
|
||||||
cmdSHOWPREF,
|
cmdSHOWPREF,
|
||||||
cmdSETPREF, cmdPREFKS, cmdNOTATION, cmdINVCMD, cmdSHOWPHOTO, cmdUPDTRUST,
|
cmdSETPREF, cmdPREFKS, cmdNOTATION, cmdINVCMD, cmdSHOWPHOTO, cmdUPDTRUST,
|
||||||
cmdCHKTRUST, cmdADDCARDKEY, cmdKEYTOCARD, cmdBKUPTOCARD, cmdCHECKBKUPKEY,
|
cmdCHKTRUST, cmdADDCARDKEY, cmdKEYTOCARD, cmdBKUPTOCARD,
|
||||||
cmdCLEAN, cmdMINIMIZE, cmdGRIP, cmdNOP
|
cmdCLEAN, cmdMINIMIZE, cmdGRIP, cmdNOP
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1404,7 +1404,6 @@ static struct
|
|||||||
N_("move a key to a smartcard")},
|
N_("move a key to a smartcard")},
|
||||||
{ "bkuptocard", cmdBKUPTOCARD, KEYEDIT_NEED_SK | KEYEDIT_ONLY_SK,
|
{ "bkuptocard", cmdBKUPTOCARD, KEYEDIT_NEED_SK | KEYEDIT_ONLY_SK,
|
||||||
N_("move a backup key to a smartcard")},
|
N_("move a backup key to a smartcard")},
|
||||||
{ "checkbkupkey", cmdCHECKBKUPKEY, KEYEDIT_NEED_SK | KEYEDIT_ONLY_SK, NULL},
|
|
||||||
#endif /*ENABLE_CARD_SUPPORT */
|
#endif /*ENABLE_CARD_SUPPORT */
|
||||||
{ "delkey", cmdDELKEY, KEYEDIT_NOT_SK, N_("delete selected subkeys")},
|
{ "delkey", cmdDELKEY, KEYEDIT_NOT_SK, N_("delete selected subkeys")},
|
||||||
{ "addrevoker", cmdADDREVOKER, KEYEDIT_NOT_SK | KEYEDIT_NEED_SK,
|
{ "addrevoker", cmdADDREVOKER, KEYEDIT_NOT_SK | KEYEDIT_NEED_SK,
|
||||||
@ -1921,7 +1920,6 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case cmdBKUPTOCARD:
|
case cmdBKUPTOCARD:
|
||||||
case cmdCHECKBKUPKEY:
|
|
||||||
{
|
{
|
||||||
/* Ask for a filename, check whether this is really a
|
/* Ask for a filename, check whether this is really a
|
||||||
backup key as generated by the card generation, parse
|
backup key as generated by the card generation, parse
|
||||||
@ -1982,47 +1980,21 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
|
|||||||
xfree (fname);
|
xfree (fname);
|
||||||
node = new_kbnode (pkt);
|
node = new_kbnode (pkt);
|
||||||
|
|
||||||
if (cmd == cmdCHECKBKUPKEY)
|
/* Transfer it to gpg-agent which handles secret keys. */
|
||||||
{
|
err = transfer_secret_keys (ctrl, NULL, node, 1);
|
||||||
log_debug ("FIXME: This needs to be changed\n");
|
|
||||||
/* PKT_public_key *sk = node->pkt->pkt.secret_key; */
|
/* Treat the pkt as a public key. */
|
||||||
/* switch (is_secret_key_protected (sk)) */
|
pkt->pkttype = PKT_PUBLIC_KEY;
|
||||||
/* { */
|
|
||||||
/* case 0: /\* Not protected. *\/ */
|
/* Ask gpg-agent to store the secret key to card. */
|
||||||
/* tty_printf (_("This key is not protected.\n")); */
|
if (card_store_subkey (node, 0))
|
||||||
/* break; */
|
|
||||||
/* case -1: */
|
|
||||||
/* log_error (_("unknown key protection algorithm\n")); */
|
|
||||||
/* break; */
|
|
||||||
/* default: */
|
|
||||||
/* if (sk->protect.s2k.mode == 1001) */
|
|
||||||
/* tty_printf (_("Secret parts of key" */
|
|
||||||
/* " are not available.\n")); */
|
|
||||||
/* if (sk->protect.s2k.mode == 1002) */
|
|
||||||
/* tty_printf (_("Secret parts of key" */
|
|
||||||
/* " are stored on-card.\n")); */
|
|
||||||
/* else */
|
|
||||||
/* check_secret_key (sk, 0); */
|
|
||||||
/* } */
|
|
||||||
}
|
|
||||||
else /* Store it. */
|
|
||||||
{
|
{
|
||||||
/* We need to transfer it to gpg-agent. */
|
redisplay = 1;
|
||||||
err = transfer_secret_keys (ctrl, NULL, node, 1);
|
sec_shadowing = 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);
|
release_kbnode (node);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#endif /* ENABLE_CARD_SUPPORT */
|
#endif /* ENABLE_CARD_SUPPORT */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user