[Pkg-gnupg-commit] [gnupg2] 71/159: g10: Remove subcommand checkbkupkey for --key-edit.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Jan 27 13:23:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit 44aee35e69540510617aea4b886ef845590960fe
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Dec 24 11:37:42 2015 +0900

    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.
---
 g10/keyedit.c | 52 ++++++++++++----------------------------------------
 1 file changed, 12 insertions(+), 40 deletions(-)

diff --git a/g10/keyedit.c b/g10/keyedit.c
index cfbbed7..0553208 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 */
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list