Home GnuPG
Diffusion GnuPG 21c0ea6bafaf

gpg: Fix informative printing of user ids.
21c0ea6bafafUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

gpg: Fix informative printing of user ids.

* g10/getkey.c (keyid_list): Add field "fpr".
(cache_user_id): Store fpr and check for dups only by fpr.
(get_pubkey_byfpr): New.
(get_user_id_string): Make static and use xasprintf.
(get_long_user_id_string): Use xasprintf.
(get_user_id_byfpr): New.
(get_user_id_byfpr_native): New.
* g10/keyid.c (fingerprint_from_pk): Make arg RET_LEN optional.
* g10/import.c (import_one): Use get_user_id_byfpr_native.

We now cache the userids using the fingerprint. This allows to print
the correct user id for keys with a duplicated key id. We should
eventually start to retire the use of all the old keyid based
functions. However, at some places we only have the keyid and thus
some of them will need to be kept (maybe changed with an indication to
show that more than several user ids are matching).

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Oct 13 2014, 2:54 PM
Parents
rGc60814a5ce13: gpg: Allow importing keys with duplicated long key ids.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rG21c0ea6bafaf: gpg: Fix informative printing of user ids. (authored by Werner Koch <wk@gnupg.org>).Oct 13 2014, 2:54 PM