diff options
author | Werner Koch <[email protected]> | 2014-10-13 12:54:26 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-10-13 12:54:26 +0000 |
commit | 21c0ea6bafafbcc4a2e07f0ac76275cc0229e9a0 (patch) | |
tree | 8797879b41fb4feb027d8684999060207f83522d /g10/import.c | |
parent | gpg: Allow importing keys with duplicated long key ids. (diff) | |
download | gnupg-21c0ea6bafafbcc4a2e07f0ac76275cc0229e9a0.tar.gz gnupg-21c0ea6bafafbcc4a2e07f0ac76275cc0229e9a0.zip |
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 <[email protected]>
Diffstat (limited to 'g10/import.c')
-rw-r--r-- | g10/import.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/g10/import.c b/g10/import.c index be2fd6302..8f7595c7f 100644 --- a/g10/import.c +++ b/g10/import.c @@ -1009,9 +1009,9 @@ import_one (ctrl_t ctrl, /* we are ready */ if( !opt.quiet && !silent) { - char *p=get_user_id_native (keyid); - log_info( _("key %s: public key \"%s\" imported\n"), - keystr(keyid),p); + char *p = get_user_id_byfpr_native (fpr2); + log_info (_("key %s: public key \"%s\" imported\n"), + keystr(keyid), p); xfree(p); } if( is_status_enabled() ) @@ -1094,7 +1094,7 @@ import_one (ctrl_t ctrl, /* we are ready */ if( !opt.quiet && !silent) { - char *p=get_user_id_native(keyid); + char *p = get_user_id_byfpr_native (fpr2); if( n_uids == 1 ) log_info( _("key %s: \"%s\" 1 new user ID\n"), keystr(keyid),p); @@ -1145,7 +1145,7 @@ import_one (ctrl_t ctrl, if( !opt.quiet && !silent) { - char *p=get_user_id_native(keyid); + char *p = get_user_id_byfpr_native (fpr2); log_info( _("key %s: \"%s\" not changed\n"),keystr(keyid),p); xfree(p); } |