summaryrefslogtreecommitdiffstats
path: root/g10/revoke.c
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@g10code.com>2015-10-19 15:04:45 +0200
committerNeal H. Walfield <neal@g10code.com>2015-10-19 20:11:03 +0200
commitc37621166e9cc2a818de73bc99287a393dbb5744 (patch)
tree04ea481092fb051584d9c47d01e76af48a31fc6a /g10/revoke.c
parentgpg: Improve function documentation and some comments. (diff)
downloadgnupg2-c37621166e9cc2a818de73bc99287a393dbb5744.tar.xz
gnupg2-c37621166e9cc2a818de73bc99287a393dbb5744.zip
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@g10code.com> Regression-due-to: 8459bcf9
Diffstat (limited to 'g10/revoke.c')
-rw-r--r--g10/revoke.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/g10/revoke.c b/g10/revoke.c
index eb3a989c0..b341ccec1 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"));