diff options
author | Werner Koch <wk@gnupg.org> | 2019-05-21 12:54:47 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2019-05-21 13:02:32 +0200 |
commit | 126caa34bbdb36f40514643b9d6f5ead3240c735 (patch) | |
tree | e1e5d503bb731e773dfd19543c732b3704ef874f /g10/revoke.c | |
parent | scd: Fix for SCARD_IO_REQUEST structure. (diff) | |
download | gnupg2-126caa34bbdb36f40514643b9d6f5ead3240c735.tar.xz gnupg2-126caa34bbdb36f40514643b9d6f5ead3240c735.zip |
gpg: Unify the the use of the print_pubkey_info functions.
* g10/keylist.c (format_seckey_info): Remove.
(print_pubkey_info, print_seckey_info): Remove.
(format_key_info): New.
(print_key_info): New.
(print_key_info_log): New.
* g10/card-util.c (current_card_status): Use print_key_info and remove
the useless condition on KEYBLOCK.
* g10/delkey.c (do_delete_key): Replace print_pubkey_info and
print_seckey_info by print_key_info.
* g10/keyedit.c (menu_addrevoker): Replace print_pubkey_info by
print_key_info.
* g10/pkclist.c (do_we_trust_pre): Ditto.
* g10/revoke.c (gen_desig_revoke): Ditto.
(gen_revoke): Ditto. Also use print_key_info_log instead of separate
functions.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/revoke.c')
-rw-r--r-- | g10/revoke.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/g10/revoke.c b/g10/revoke.c index e63060cb9..0a93c31f9 100644 --- a/g10/revoke.c +++ b/g10/revoke.c @@ -305,11 +305,11 @@ gen_desig_revoke (ctrl_t ctrl, const char *uname, strlist_t locusr) any = 1; - print_pubkey_info (ctrl, NULL, pk); + print_key_info (ctrl, NULL, 0, pk, 0); tty_printf ("\n"); tty_printf (_("To be revoked by:\n")); - print_seckey_info (ctrl, pk2); + print_key_info (ctrl, NULL, 0, pk2, 1); if(pk->revkey[i].class&0x40) tty_printf(_("(This is a sensitive revocation key)\n")); @@ -669,30 +669,26 @@ gen_revoke (ctrl_t ctrl, const char *uname) rc = keydb_search (kdbhd, &desc, 1, NULL); if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND) - /* Not ambiguous. */ { + /* Not ambiguous. */ } else if (rc == 0) - /* Ambiguous. */ { - char *info; - + /* Ambiguous. */ /* TRANSLATORS: The %s prints a key specification which for example has been given at the command line. Several lines lines with secret key infos are printed after this message. */ log_error (_("'%s' matches multiple secret keys:\n"), uname); - info = format_seckey_info (ctrl, keyblock->pkt->pkt.public_key); - log_error (" %s\n", info); - xfree (info); + print_key_info_log (ctrl, GPGRT_LOGLVL_ERROR, 2, + keyblock->pkt->pkt.public_key, 1); release_kbnode (keyblock); rc = keydb_get_keyblock (kdbhd, &keyblock); while (! rc) { - info = format_seckey_info (ctrl, keyblock->pkt->pkt.public_key); - log_info (" %s\n", info); - xfree (info); + print_key_info_log (ctrl, GPGRT_LOGLVL_INFO, 2, + keyblock->pkt->pkt.public_key, 1); release_kbnode (keyblock); keyblock = NULL; @@ -726,7 +722,7 @@ gen_revoke (ctrl_t ctrl, const char *uname) } keyid_from_pk (psk, keyid ); - print_seckey_info (ctrl, psk); + print_key_info (ctrl, NULL, 0, psk, 1); tty_printf("\n"); if (!cpr_get_answer_is_yes ("gen_revoke.okay", |