diff options
author | Werner Koch <[email protected]> | 2004-09-20 18:47:11 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2004-09-20 18:47:11 +0000 |
commit | f10040147834bbc5cc75f02b7215f2b45642ecaf (patch) | |
tree | 1619aa4876f59af71818b640b9ce61a0ca84ce46 /g10/keyedit.c | |
parent | Some more new files (diff) | |
download | gnupg-f10040147834bbc5cc75f02b7215f2b45642ecaf.tar.gz gnupg-f10040147834bbc5cc75f02b7215f2b45642ecaf.zip |
(show_key_with_all_names): Print the card S/N.
* app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
not app_number_serialno.
Diffstat (limited to '')
-rw-r--r-- | g10/keyedit.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/g10/keyedit.c b/g10/keyedit.c index 4da174e3c..2f9fccbf5 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -2121,6 +2121,27 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker, datestr_from_sk(sk), expirestr_from_sk(sk) ); tty_printf("\n"); + if (sk->is_protected && sk->protect.s2k.mode == 1002) + { + tty_printf(" "); + tty_printf(_("card-no: ")); + if (sk->protect.ivlen == 16 + && !memcmp (sk->protect.iv, "\xD2\x76\x00\x01\x24\x01", 6)) + { /* This is an OpenPGP card. */ + for (i=8; i < 14; i++) + { + if (i == 10) + tty_printf (" "); + tty_printf ("%02X", sk->protect.iv[i]); + } + } + else + { /* Something is wrong: Print all. */ + for (i=0; i < sk->protect.ivlen; i++) + tty_printf ("%02X", sk->protect.iv[i]); + } + tty_printf ("\n"); + } } else if( with_subkeys && node->pkt->pkttype == PKT_SIGNATURE && node->pkt->pkt.signature->sig_class == 0x28 ) { |