aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-09-16 12:36:08 -0400
committerDavid Howells <dhowells@redhat.com>2014-09-16 12:36:08 -0400
commit0c903ab64feb0fe83eac9f67a06e2f5b9508de16 (patch)
tree809464ff50aa99c1caaf650230fea4f30ef8138c /security
parentc06cfb08b88dfbe13be44a69ae2fdc3a7c902d81 (diff)
KEYS: Make the key matching functions return bool
Make the key matching functions pointed to by key_match_data::cmp return bool rather than int. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
Diffstat (limited to 'security')
-rw-r--r--security/keys/internal.h8
-rw-r--r--security/keys/keyring.c4
-rw-r--r--security/keys/process_keys.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/security/keys/internal.h b/security/keys/internal.h
index e66a16cb63e1..b8960c4959a5 100644
--- a/security/keys/internal.h
+++ b/security/keys/internal.h
@@ -127,8 +127,8 @@ struct keyring_search_context {
127 struct timespec now; 127 struct timespec now;
128}; 128};
129 129
130extern int key_default_cmp(const struct key *key, 130extern bool key_default_cmp(const struct key *key,
131 const struct key_match_data *match_data); 131 const struct key_match_data *match_data);
132extern key_ref_t keyring_search_aux(key_ref_t keyring_ref, 132extern key_ref_t keyring_search_aux(key_ref_t keyring_ref,
133 struct keyring_search_context *ctx); 133 struct keyring_search_context *ctx);
134 134
@@ -150,8 +150,8 @@ extern struct key *request_key_and_link(struct key_type *type,
150 struct key *dest_keyring, 150 struct key *dest_keyring,
151 unsigned long flags); 151 unsigned long flags);
152 152
153extern int lookup_user_key_possessed(const struct key *key, 153extern bool lookup_user_key_possessed(const struct key *key,
154 const struct key_match_data *match_data); 154 const struct key_match_data *match_data);
155extern key_ref_t lookup_user_key(key_serial_t id, unsigned long flags, 155extern key_ref_t lookup_user_key(key_serial_t id, unsigned long flags,
156 key_perm_t perm); 156 key_perm_t perm);
157#define KEY_LOOKUP_CREATE 0x01 157#define KEY_LOOKUP_CREATE 0x01
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index 253c9a0eb092..8177010174f7 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -513,8 +513,8 @@ EXPORT_SYMBOL(keyring_alloc);
513/* 513/*
514 * By default, we keys found by getting an exact match on their descriptions. 514 * By default, we keys found by getting an exact match on their descriptions.
515 */ 515 */
516int key_default_cmp(const struct key *key, 516bool key_default_cmp(const struct key *key,
517 const struct key_match_data *match_data) 517 const struct key_match_data *match_data)
518{ 518{
519 return strcmp(key->description, match_data->raw_data) == 0; 519 return strcmp(key->description, match_data->raw_data) == 0;
520} 520}
diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
index 08bd533d014f..bd536cb221e2 100644
--- a/security/keys/process_keys.c
+++ b/security/keys/process_keys.c
@@ -489,8 +489,8 @@ found:
489/* 489/*
490 * See if the key we're looking at is the target key. 490 * See if the key we're looking at is the target key.
491 */ 491 */
492int lookup_user_key_possessed(const struct key *key, 492bool lookup_user_key_possessed(const struct key *key,
493 const struct key_match_data *match_data) 493 const struct key_match_data *match_data)
494{ 494{
495 return key == match_data->raw_data; 495 return key == match_data->raw_data;
496} 496}