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 <wk@gnupg.org>

GnuPG-bug-id: 2079

(backported from master 874ef16e70)
This commit is contained in:
NIIBE Yutaka 2015-09-29 13:45:20 +09:00
parent 47a499eaa2
commit fea9d4354c
1 changed files with 4 additions and 2 deletions

View File

@ -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);