summaryrefslogtreecommitdiffstats
path: root/g10/keyedit.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2015-12-24 03:37:42 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2015-12-24 03:48:47 +0100
commit44aee35e69540510617aea4b886ef845590960fe (patch)
tree404143796bd88f2f53a0802fadc8bc6b0261bbc5 /g10/keyedit.c
parentg10: Allow relative path for specifying the file for bkuptocard. (diff)
downloadgnupg2-44aee35e69540510617aea4b886ef845590960fe.tar.xz
gnupg2-44aee35e69540510617aea4b886ef845590960fe.zip
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.
Diffstat (limited to '')
-rw-r--r--g10/keyedit.c52
1 files changed, 12 insertions, 40 deletions
diff --git a/g10/keyedit.c b/g10/keyedit.c
index cfbbed7c9..0553208c3 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -1352,7 +1352,7 @@ enum cmdids
#endif /*!NO_TRUST_MODELS*/
cmdSHOWPREF,
cmdSETPREF, cmdPREFKS, cmdNOTATION, cmdINVCMD, cmdSHOWPHOTO, cmdUPDTRUST,
- cmdCHKTRUST, cmdADDCARDKEY, cmdKEYTOCARD, cmdBKUPTOCARD, cmdCHECKBKUPKEY,
+ cmdCHKTRUST, cmdADDCARDKEY, cmdKEYTOCARD, cmdBKUPTOCARD,
cmdCLEAN, cmdMINIMIZE, cmdGRIP, cmdNOP
};
@@ -1404,7 +1404,6 @@ static struct
N_("move a key to a smartcard")},
{ "bkuptocard", cmdBKUPTOCARD, KEYEDIT_NEED_SK | KEYEDIT_ONLY_SK,
N_("move a backup key to a smartcard")},
- { "checkbkupkey", cmdCHECKBKUPKEY, KEYEDIT_NEED_SK | KEYEDIT_ONLY_SK, NULL},
#endif /*ENABLE_CARD_SUPPORT */
{ "delkey", cmdDELKEY, KEYEDIT_NOT_SK, N_("delete selected subkeys")},
{ "addrevoker", cmdADDREVOKER, KEYEDIT_NOT_SK | KEYEDIT_NEED_SK,
@@ -1921,7 +1920,6 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
break;
case cmdBKUPTOCARD:
- case cmdCHECKBKUPKEY:
{
/* Ask for a filename, check whether this is really a
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);
node = new_kbnode (pkt);
- 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)) */
- /* { */
- /* case 0: /\* Not protected. *\/ */
- /* tty_printf (_("This key is not protected.\n")); */
- /* 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. */
- err = transfer_secret_keys (ctrl, NULL, node, 1);
+ /* Transfer it to gpg-agent which handles secret keys. */
+ 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;
+ /* Treat the pkt as a public key. */
+ pkt->pkttype = PKT_PUBLIC_KEY;
- if (card_store_subkey (node, 0))
- {
- redisplay = 1;
- sec_shadowing = 1;
- }
+ /* Ask gpg-agent to store the secret key to card. */
+ if (card_store_subkey (node, 0))
+ {
+ redisplay = 1;
+ sec_shadowing = 1;
}
release_kbnode (node);
- }
- break;
+ }
+ break;
#endif /* ENABLE_CARD_SUPPORT */