diff options
author | Werner Koch <[email protected]> | 2024-04-17 10:16:20 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2024-04-17 10:16:20 +0000 |
commit | 7d6ad2866722aaa27b33338d0fbb33c7b6b94808 (patch) | |
tree | 1f49ee3ffc3732fb7872f3a8bae6fd24422b4ba8 /g10/keylist.c | |
parent | gpg: New command --quick-set-ownertrust. (diff) | |
download | gnupg-7d6ad2866722aaa27b33338d0fbb33c7b6b94808.tar.gz gnupg-7d6ad2866722aaa27b33338d0fbb33c7b6b94808.zip |
gpg: Mark disabled keys and add show-ownertrust list option.
* g10/options.h (LIST_SHOW_OWNERTRUST): New.
* g10/keylist.c (print_key_line): Show wonertrust and always show
whether a key is disabled.
* g10/gpg.c (parse_list_options): Add "show-ownertrust".
* g10/gpgv.c (get_ownertrust_string): Add stub.
* g10/test-stubs.c (get_ownertrust_string): Add stub.
--
Note that in a --with-colons listing the ownertrust has always been
emitted and the disabled state is marked in that listing with a
special 'D' usage.
Diffstat (limited to 'g10/keylist.c')
-rw-r--r-- | g10/keylist.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/g10/keylist.c b/g10/keylist.c index 7fb5eff72..7717ca563 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -2600,6 +2600,11 @@ print_key_line (ctrl_t ctrl, estream_t fp, PKT_public_key *pk, int secret) tty_fprintf (fp, " [%s]", usagestr_from_pk (pk, 0)); } + if (pk->flags.primary && (opt.list_options & LIST_SHOW_OWNERTRUST)) + { + tty_fprintf (fp, " [%s]", get_ownertrust_string (ctrl, pk, 0)); + } + if (pk->flags.revoked) { tty_fprintf (fp, " ["); @@ -2619,21 +2624,14 @@ print_key_line (ctrl_t ctrl, estream_t fp, PKT_public_key *pk, int secret) tty_fprintf (fp, "]"); } -#if 0 - /* I need to think about this some more. It's easy enough to - include, but it looks sort of confusing in the listing... */ - if (opt.list_options & LIST_SHOW_VALIDITY) - { - int validity = get_validity (ctrl, pk, NULL, NULL, 0); - tty_fprintf (fp, " [%s]", trust_value_to_string (validity)); - } -#endif - if (pk->pubkey_algo >= 100) tty_fprintf (fp, " [experimental algorithm %d]", pk->pubkey_algo); tty_fprintf (fp, "\n"); + if (pk->flags.primary && pk_is_disabled (pk)) + es_fprintf (es_stdout, " *** %s\n", _("This key has been disabled")); + /* if the user hasn't explicitly asked for human-readable fingerprints, show compact fpr of primary key: */ if (pk->flags.primary && |