aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/key-type.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-09-24 10:35:15 +0100
committerDavid Howells <dhowells@redhat.com>2013-09-24 10:35:15 +0100
commit4bdf0bc300314141e5475e145acb8b5ad846f00d (patch)
treeecf5a1d74d507410a9defa32edb4ea73edb9d205 /include/linux/key-type.h
parentKEYS: Consolidate the concept of an 'index key' for key access (diff)
downloadwireguard-linux-4bdf0bc300314141e5475e145acb8b5ad846f00d.tar.xz
wireguard-linux-4bdf0bc300314141e5475e145acb8b5ad846f00d.zip
KEYS: Introduce a search context structure
Search functions pass around a bunch of arguments, each of which gets copied with each call. Introduce a search context structure to hold these. Whilst we're at it, create a search flag that indicates whether the search should be directly to the description or whether it should iterate through all keys looking for a non-description match. This will be useful when keyrings use a generic data struct with generic routines to manage their content as the search terms can just be passed through to the iterator callback function. Also, for future use, the data to be supplied to the match function is separated from the description pointer in the search context. This makes it clear which is being supplied. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/linux/key-type.h')
-rw-r--r--include/linux/key-type.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/key-type.h b/include/linux/key-type.h
index 518a53afb9ea..f58737bcb050 100644
--- a/include/linux/key-type.h
+++ b/include/linux/key-type.h
@@ -63,6 +63,11 @@ struct key_type {
*/
size_t def_datalen;
+ /* Default key search algorithm. */
+ unsigned def_lookup_type;
+#define KEYRING_SEARCH_LOOKUP_DIRECT 0x0000 /* Direct lookup by description. */
+#define KEYRING_SEARCH_LOOKUP_ITERATE 0x0001 /* Iterative search. */
+
/* vet a description */
int (*vet_description)(const char *description);