summaryrefslogtreecommitdiffstats
path: root/g10/gpg.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-10-13 14:54:26 +0200
committerWerner Koch <wk@gnupg.org>2014-10-13 14:54:26 +0200
commit21c0ea6bafafbcc4a2e07f0ac76275cc0229e9a0 (patch)
tree8797879b41fb4feb027d8684999060207f83522d /g10/gpg.h
parentgpg: Allow importing keys with duplicated long key ids. (diff)
downloadgnupg2-21c0ea6bafafbcc4a2e07f0ac76275cc0229e9a0.tar.xz
gnupg2-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 <wk@gnupg.org>
Diffstat (limited to 'g10/gpg.h')
-rw-r--r--g10/gpg.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/gpg.h b/g10/gpg.h
index 3251dd00f..ce4d253dc 100644
--- a/g10/gpg.h
+++ b/g10/gpg.h
@@ -37,7 +37,8 @@
/* Number of bits we accept when reading or writing MPIs. */
#define MAX_EXTERN_MPI_BITS 16384
-/* The maximum length of a binary fingerprints. */
+/* The maximum length of a binary fingerprints.
+ Warning: At some places we still use 20 instead of this macro. */
#define MAX_FINGERPRINT_LEN 20