aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keydb.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-02-12 18:43:44 +0000
committerDavid Shaw <[email protected]>2003-02-12 18:43:44 +0000
commitd691cf8d107a3940fed78a799ccb50db114d0651 (patch)
tree0670b14ba2bf27a839ed28a90db3ed21feb24b1f /g10/keydb.c
parent* exec.c (set_exec_path): Add debugging line. (diff)
downloadgnupg-d691cf8d107a3940fed78a799ccb50db114d0651.tar.gz
gnupg-d691cf8d107a3940fed78a799ccb50db114d0651.zip
* keydb.h, getkey.c (classify_user_id, classify_user_id2): Make 'exact' a
per-desc item. Merge into one function since 'force_exact' is no longer needed. (key_byname): Use new classify_user_id function, and new exact flag in KEYDB_SEARCH_DESC. * keyring.h, keyring.c (keyring_search): Return an optional index to show which KEYDB_SEARCH_DESC was the matching one. * keydb.h, keydb.c (keydb_search): Rename to keydb_search2, and pass the optional index to keyring_search. Add a macro version of keydb_search that calls this new function. * export.c (do_export_stream): If the keyid! syntax is used, export only that specified key. If the key in question is a subkey, export the primary plus that subkey only.
Diffstat (limited to '')
-rw-r--r--g10/keydb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/g10/keydb.c b/g10/keydb.c
index d2b0cea9c..19b5c1ab8 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -653,7 +653,8 @@ keydb_search_reset (KEYDB_HANDLE hd)
* for a keyblock which contains one of the keys described in the DESC array.
*/
int
-keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc)
+keydb_search2 (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
+ size_t ndesc, size_t *descindex)
{
int rc = -1;
@@ -666,7 +667,8 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc)
BUG(); /* we should never see it here */
break;
case KEYDB_RESOURCE_TYPE_KEYRING:
- rc = keyring_search (hd->active[hd->current].u.kr, desc, ndesc);
+ rc = keyring_search (hd->active[hd->current].u.kr, desc,
+ ndesc, descindex);
break;
}
if (rc == -1) /* EOF -> switch to next resource */
@@ -678,7 +680,6 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc)
return rc;
}
-
int
keydb_search_first (KEYDB_HANDLE hd)
{