aboutsummaryrefslogtreecommitdiffstats
path: root/g10/call-keyboxd.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-09-27 08:05:07 +0000
committerWerner Koch <[email protected]>2019-09-27 08:05:07 +0000
commit4be79b5abeae82b9840e6aa93874f743e13c6df7 (patch)
tree2d9310b43f277203adcd14858cd593f9b7004bd7 /g10/call-keyboxd.c
parentkbx: First take on a cache for the keyboxd. (diff)
downloadgnupg-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/call-keyboxd.c')
-rw-r--r--g10/call-keyboxd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/g10/call-keyboxd.c b/g10/call-keyboxd.c
index 97f84c03d..88ad07817 100644
--- a/g10/call-keyboxd.c
+++ b/g10/call-keyboxd.c
@@ -1017,6 +1017,14 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
}
break;
+ case KEYDB_SEARCH_MODE_UBID:
+ {
+ unsigned char hexubid[20 * 2 + 1];
+ bin2hex (desc[0].u.grip, 20, hexubid);
+ snprintf (line, sizeof line, "SEARCH ^%s", hexubid);
+ }
+ break;
+
case KEYDB_SEARCH_MODE_FIRST:
snprintf (line, sizeof line, "SEARCH");
break;