diff options
author | Werner Koch <[email protected]> | 2019-09-27 08:05:07 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-09-27 08:05:07 +0000 |
commit | 4be79b5abeae82b9840e6aa93874f743e13c6df7 (patch) | |
tree | 2d9310b43f277203adcd14858cd593f9b7004bd7 /g10/keydb.c | |
parent | kbx: First take on a cache for the keyboxd. (diff) | |
download | gnupg-4be79b5abeae82b9840e6aa93874f743e13c6df7.tar.gz gnupg-4be79b5abeae82b9840e6aa93874f743e13c6df7.zip |
kbx,gpg: Allow lookup using a UBID.
* common/userids.c (classify_user_id): Detect UBIDs.
* kbx/backend-cache.c (blob_table_put): Store the public key type.
(be_cache_search): Add search mode for UBIDs.
* kbx/backend.h (struct db_request_part_s): Add cache.seqno_ubid.
* g10/keydb.c (keydb_search_desc_dump): Fix printing of keygrip. Add
ubid printing.
* g10/call-keyboxd.c (keydb_search): Support search by UBID.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/keydb.c')
-rw-r--r-- | g10/keydb.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/g10/keydb.c b/g10/keydb.c index 6ca239475..39ec5442e 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -456,6 +456,10 @@ keydb_search_desc_dump (struct keydb_search_desc *desc) char b[MAX_FORMATTED_FINGERPRINT_LEN + 1]; char fpr[2 * MAX_FINGERPRINT_LEN + 1]; +#if MAX_FINGERPRINT_LEN < 20 +#error MAX_FINGERPRINT_LEN shorter than GRIP and UBID length/ +#endif + switch (desc->mode) { case KEYDB_SEARCH_MODE_EXACT: @@ -495,7 +499,11 @@ keydb_search_desc_dump (struct keydb_search_desc *desc) case KEYDB_SEARCH_MODE_SUBJECT: return xasprintf ("SUBJECT: '%s'", desc->u.name); case KEYDB_SEARCH_MODE_KEYGRIP: - return xasprintf ("KEYGRIP: %s", desc->u.grip); + bin2hex (desc[0].u.grip, 20, fpr); + return xasprintf ("KEYGRIP: %s", fpr); + case KEYDB_SEARCH_MODE_UBID: + bin2hex (desc[0].u.ubid, 20, fpr); + return xasprintf ("UBID: %s", fpr); case KEYDB_SEARCH_MODE_FIRST: return xasprintf ("FIRST"); case KEYDB_SEARCH_MODE_NEXT: |