From fea9d4354c93b662c75febe020fb799ce4f2ec89 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 29 Sep 2015 13:45:20 +0900 Subject: [PATCH] gpg: Improve 'General key info' line of --card-status. * g10/keylist.c (print_pubkey_info): Print either "pub" or "sub". -- This now prints "sub" if the first used card key is actually a subkey. Signed-off-by: Werner Koch GnuPG-bug-id: 2079 (backported from master 874ef16e70ab750db7b153f17a7e859a0db6a2f1) --- g10/keylist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/g10/keylist.c b/g10/keylist.c index 457695b68..8db214718 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -164,12 +164,14 @@ print_pubkey_info (FILE *fp, PKT_public_key *pk) p=get_user_id_native(keyid); if (fp) - fprintf (fp, "pub %4u%c/%s %s %s\n", + fprintf (fp, "%s %4u%c/%s %s %s\n", + pk->is_primary? "pub":"sub", nbits_from_pk (pk), pubkey_letter (pk->pubkey_algo), keystr(keyid), datestr_from_pk (pk), p); else - tty_printf ("\npub %4u%c/%s %s %s\n", + tty_printf ("\n%s %4u%c/%s %s %s\n", + pk->is_primary? "pub":"sub", nbits_from_pk (pk), pubkey_letter (pk->pubkey_algo), keystr(keyid), datestr_from_pk (pk), p);