diff options
author | Werner Koch <wk@gnupg.org> | 2011-03-03 16:16:24 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2011-03-03 16:16:24 +0100 |
commit | 35205e13005248178da145944671f28f600be7be (patch) | |
tree | 3254555c4e6c9d0bc8bfacf5b3f1b0e41fff0562 /g10/card-util.c | |
parent | Minor code cleanups. (diff) | |
download | gnupg2-35205e13005248178da145944671f28f600be7be.tar.xz gnupg2-35205e13005248178da145944671f28f600be7be.zip |
Print the secret keyinfo stuff with --card-status again.
Diffstat (limited to 'g10/card-util.c')
-rw-r--r-- | g10/card-util.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/g10/card-util.c b/g10/card-util.c index 2b7ac7469..0ffb18dd7 100644 --- a/g10/card-util.c +++ b/g10/card-util.c @@ -581,32 +581,34 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen) if ( thefpr && !fpr_is_ff (thefpr) && !get_pubkey_byfprint (pk, thefpr, 20)) { + kbnode_t keyblock = NULL; + print_pubkey_info (fp, pk); #if GNUPG_MAJOR_VERSION == 1 - { - kbnode_t keyblock = NULL; + if ( !get_seckeyblock_byfprint (&keyblock, thefpr, 20) ) + print_card_key_info (fp, keyblock); + else if ( !get_keyblock_byfprint (&keyblock, thefpr, 20) ) + { + release_kbnode (keyblock); + keyblock = NULL; - if ( !get_seckeyblock_byfprint (&keyblock, thefpr, 20) ) - print_card_key_info (fp, keyblock); - else if ( !get_keyblock_byfprint (&keyblock, thefpr, 20) ) - { - release_kbnode (keyblock); - keyblock = NULL; - - if (!auto_create_card_key_stub (info.serialno, - info.fpr1valid? info.fpr1:NULL, - info.fpr2valid? info.fpr2:NULL, - info.fpr3valid? info.fpr3:NULL)) - { - if ( !get_seckeyblock_byfprint (&keyblock, thefpr, 20) ) - print_card_key_info (fp, keyblock); - } - } + if (!auto_create_card_key_stub (info.serialno, + info.fpr1valid? info.fpr1:NULL, + info.fpr2valid? info.fpr2:NULL, + info.fpr3valid? info.fpr3:NULL)) + { + if ( !get_seckeyblock_byfprint (&keyblock, thefpr, 20) ) + print_card_key_info (fp, keyblock); + } + } - release_kbnode (keyblock); - } -#endif /* GNUPG_MAJOR_VERSION == 1 */ +#else /* GNUPG_MAJOR_VERSION != 1 */ + if (!get_keyblock_byfprint (&keyblock, thefpr, 20)) + print_card_key_info (fp, keyblock); +#endif /* GNUPG_MAJOR_VERSION != 1 */ + + release_kbnode (keyblock); } else tty_fprintf (fp, "[none]\n"); |