[Pkg-gnupg-commit] [gnupg2] 22/241: gpg: Fix --desig-revoke.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Dec 9 20:31:48 UTC 2015


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

dkg pushed a commit to branch master
in repository gnupg2.

commit c37621166e9cc2a818de73bc99287a393dbb5744
Author: Neal H. Walfield <neal at g10code.com>
Date:   Mon Oct 19 15:04:45 2015 +0200

    gpg: Fix --desig-revoke.
    
    * g10/revoke.c (gen_desig_revoke): Add additional parameter ctrl.
    Check that the secret key is available.  If not, display an error
    message.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>
    Regression-due-to: 8459bcf9
---
 g10/gpg.c    | 10 +++++-----
 g10/main.h   |  2 +-
 g10/revoke.c | 13 ++++++++-----
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/g10/gpg.c b/g10/gpg.c
index cb610a1..794d5ea 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -4179,11 +4179,11 @@ main (int argc, char **argv)
 	break;
 
       case aDesigRevoke:
-	if( argc != 1 )
-	    wrong_args("--desig-revoke user-id");
-	username =  make_username(*argv);
-	gen_desig_revoke( username, locusr );
-	xfree( username );
+	if (argc != 1)
+	    wrong_args ("--desig-revoke user-id");
+	username = make_username (*argv);
+	gen_desig_revoke (ctrl, username, locusr);
+	xfree (username);
 	break;
 
       case aDeArmor:
diff --git a/g10/main.h b/g10/main.h
index 518ec94..a50c85c 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -356,7 +356,7 @@ int enarmor_file( const char *fname );
 struct revocation_reason_info;
 int gen_standard_revoke (PKT_public_key *psk, const char *cache_nonce);
 int gen_revoke( const char *uname );
-int gen_desig_revoke( const char *uname, strlist_t locusr);
+int gen_desig_revoke (ctrl_t ctrl, const char *uname, strlist_t locusr);
 int revocation_reason_build_cb( PKT_signature *sig, void *opaque );
 struct revocation_reason_info *
 		ask_revocation_reason( int key_rev, int cert_rev, int hint );
diff --git a/g10/revoke.c b/g10/revoke.c
index eb3a989..b341cce 100644
--- a/g10/revoke.c
+++ b/g10/revoke.c
@@ -195,7 +195,7 @@ export_minimal_pk(IOBUF out,KBNODE keyblock,
  * Generate a revocation certificate for UNAME via a designated revoker
  */
 int
-gen_desig_revoke( const char *uname, strlist_t locusr )
+gen_desig_revoke (ctrl_t ctrl, const char *uname, strlist_t locusr)
 {
     int rc = 0;
     armor_filter_context_t *afx;
@@ -312,6 +312,13 @@ gen_desig_revoke( const char *uname, strlist_t locusr )
 	      tty_printf(_("(This is a sensitive revocation key)\n"));
 	    tty_printf("\n");
 
+	    rc = agent_probe_secret_key (ctrl, pk2);
+	    if (rc)
+	      {
+		tty_printf (_("Secret key is not available.\n"));
+		continue;
+	      }
+
 	    if( !cpr_get_answer_is_yes("gen_desig_revoke.okay",
          _("Create a designated revocation certificate for this key? (y/N) ")))
 	      continue;
@@ -321,10 +328,6 @@ gen_desig_revoke( const char *uname, strlist_t locusr )
 	    if( !reason )
 	      continue;
 
-	    rc = -1;/*FIXME: check_secret_key (pk2, 0 );*/
-	    if (rc)
-	      continue;
-
 	    if( !opt.armor )
 	      tty_printf(_("ASCII armored output forced.\n"));
 

-- 
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