mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Implement --keyid-format=none.
* g10/gpg.c (main): Add option "none" to --keyid-format. * g10/options.h (KF_NONE): New. * g10/keyid.c (format_keyid): Implement that. (keystr): Use format "long" is KF_NONE is in use. (keystr_with_sub): Ditto. * g10/keylist.c (list_keyblock_print): Adjust indentaion for KF_NONE. Factor some code out to ... (print_key_line): new. (print_fingerprint): Add mode 20. * g10/mainproc.c (list_node): Use print_key_line. Replace MAINKEY by flags.primary in the PK. Fix putting a " revoked..." string into the colons format. * g10/pkclist.c (do_edit_ownertrust): Use print_key_line. This slightly changes the putput format. * g10/revoke.c (gen_standard_revoke): Use print_key_line. This may also put "expires: " into the output. -- Due to user experience problems with the keyid and we better allow to show the fingerprint instead. Note that we do not support v3 keys anymore and thus there is no technical need for a user to know the keyid. GnuPG-bug-id: 2379 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
e792eb1bb4
commit
b047388d57
9 changed files with 153 additions and 143 deletions
14
g10/revoke.c
14
g10/revoke.c
|
@ -530,7 +530,7 @@ gen_standard_revoke (PKT_public_key *psk, const char *cache_nonce)
|
|||
void *leadin;
|
||||
size_t len;
|
||||
u32 keyid[2];
|
||||
char pkstrbuf[PUBKEY_STRING_SIZE];
|
||||
int kl;
|
||||
char *orig_codeset;
|
||||
|
||||
dir = get_openpgp_revocdir (opt.homedir);
|
||||
|
@ -550,16 +550,16 @@ gen_standard_revoke (PKT_public_key *psk, const char *cache_nonce)
|
|||
es_fprintf (memfp, "%s\n\n",
|
||||
_("This is a revocation certificate for the OpenPGP key:"));
|
||||
|
||||
es_fprintf (memfp, "pub %s/%s %s\n",
|
||||
pubkey_string (psk, pkstrbuf, sizeof pkstrbuf),
|
||||
keystr (keyid),
|
||||
datestr_from_pk (psk));
|
||||
print_key_line (memfp, psk, 0);
|
||||
|
||||
print_fingerprint (memfp, psk, 3);
|
||||
if (opt.keyid_format != KF_NONE)
|
||||
print_fingerprint (memfp, psk, 3);
|
||||
|
||||
kl = opt.keyid_format == KF_NONE? 0 : keystrlen ();
|
||||
|
||||
tmpstr = get_user_id (keyid, &len);
|
||||
es_fprintf (memfp, "uid%*s%.*s\n\n",
|
||||
(int)keystrlen () + 10, "",
|
||||
kl + 10, "",
|
||||
(int)len, tmpstr);
|
||||
xfree (tmpstr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue