summaryrefslogtreecommitdiff
path: root/security/keys/proc.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-09-16 16:36:02 (GMT)
committerDavid Howells <dhowells@redhat.com>2014-09-16 16:36:02 (GMT)
commit462919591a1791e76042dc5c1e0148715df59beb (patch)
tree44a60ee5f08eab18b1a69f98d993f9a47a45fece /security/keys/proc.c
parent53d91c5ce0cb8945b55e8bb54e551cabc51eb28d (diff)
downloadlinux-462919591a1791e76042dc5c1e0148715df59beb.tar.xz
KEYS: Preparse match data
Preparse the match data. This provides several advantages: (1) The preparser can reject invalid criteria up front. (2) The preparser can convert the criteria to binary data if necessary (the asymmetric key type really wants to do binary comparison of the key IDs). (3) The preparser can set the type of search to be performed. This means that it's not then a one-off setting in the key type. (4) The preparser can set an appropriate comparator function. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
Diffstat (limited to 'security/keys/proc.c')
-rw-r--r--security/keys/proc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/security/keys/proc.c b/security/keys/proc.c
index d3f6f2f..972eeb3 100644
--- a/security/keys/proc.c
+++ b/security/keys/proc.c
@@ -194,10 +194,10 @@ static int proc_keys_show(struct seq_file *m, void *v)
.index_key.type = key->type,
.index_key.description = key->description,
.cred = current_cred(),
- .match = lookup_user_key_possessed,
- .match_data = key,
- .flags = (KEYRING_SEARCH_NO_STATE_CHECK |
- KEYRING_SEARCH_LOOKUP_DIRECT),
+ .match_data.cmp = lookup_user_key_possessed,
+ .match_data.raw_data = key,
+ .match_data.lookup_type = KEYRING_SEARCH_LOOKUP_DIRECT,
+ .flags = KEYRING_SEARCH_NO_STATE_CHECK,
};
key_ref = make_key_ref(key, 0);