aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/request_key_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/keys/request_key_auth.c')
-rw-r--r--security/keys/request_key_auth.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c
index 86747151ee5b..ba717b8163ab 100644
--- a/security/keys/request_key_auth.c
+++ b/security/keys/request_key_auth.c
@@ -38,7 +38,6 @@ struct key_type key_type_request_key_auth = {
38 .read = request_key_auth_read, 38 .read = request_key_auth_read,
39}; 39};
40 40
41/*****************************************************************************/
42/* 41/*
43 * instantiate a request-key authorisation key 42 * instantiate a request-key authorisation key
44 */ 43 */
@@ -48,10 +47,8 @@ static int request_key_auth_instantiate(struct key *key,
48{ 47{
49 key->payload.data = (struct request_key_auth *) data; 48 key->payload.data = (struct request_key_auth *) data;
50 return 0; 49 return 0;
50}
51 51
52} /* end request_key_auth_instantiate() */
53
54/*****************************************************************************/
55/* 52/*
56 * reading a request-key authorisation key retrieves the callout information 53 * reading a request-key authorisation key retrieves the callout information
57 */ 54 */
@@ -63,10 +60,8 @@ static void request_key_auth_describe(const struct key *key,
63 seq_puts(m, "key:"); 60 seq_puts(m, "key:");
64 seq_puts(m, key->description); 61 seq_puts(m, key->description);
65 seq_printf(m, " pid:%d ci:%zu", rka->pid, rka->callout_len); 62 seq_printf(m, " pid:%d ci:%zu", rka->pid, rka->callout_len);
63}
66 64
67} /* end request_key_auth_describe() */
68
69/*****************************************************************************/
70/* 65/*
71 * read the callout_info data 66 * read the callout_info data
72 * - the key's semaphore is read-locked 67 * - the key's semaphore is read-locked
@@ -91,10 +86,8 @@ static long request_key_auth_read(const struct key *key,
91 } 86 }
92 87
93 return ret; 88 return ret;
89}
94 90
95} /* end request_key_auth_read() */
96
97/*****************************************************************************/
98/* 91/*
99 * handle revocation of an authorisation token key 92 * handle revocation of an authorisation token key
100 * - called with the key sem write-locked 93 * - called with the key sem write-locked
@@ -109,10 +102,8 @@ static void request_key_auth_revoke(struct key *key)
109 put_cred(rka->cred); 102 put_cred(rka->cred);
110 rka->cred = NULL; 103 rka->cred = NULL;
111 } 104 }
105}
112 106
113} /* end request_key_auth_revoke() */
114
115/*****************************************************************************/
116/* 107/*
117 * destroy an instantiation authorisation token key 108 * destroy an instantiation authorisation token key
118 */ 109 */
@@ -131,10 +122,8 @@ static void request_key_auth_destroy(struct key *key)
131 key_put(rka->dest_keyring); 122 key_put(rka->dest_keyring);
132 kfree(rka->callout_info); 123 kfree(rka->callout_info);
133 kfree(rka); 124 kfree(rka);
125}
134 126
135} /* end request_key_auth_destroy() */
136
137/*****************************************************************************/
138/* 127/*
139 * create an authorisation token for /sbin/request-key or whoever to gain 128 * create an authorisation token for /sbin/request-key or whoever to gain
140 * access to the caller's security data 129 * access to the caller's security data
@@ -228,10 +217,8 @@ error_alloc:
228 kfree(rka); 217 kfree(rka);
229 kleave("= %d", ret); 218 kleave("= %d", ret);
230 return ERR_PTR(ret); 219 return ERR_PTR(ret);
220}
231 221
232} /* end request_key_auth_new() */
233
234/*****************************************************************************/
235/* 222/*
236 * see if an authorisation key is associated with a particular key 223 * see if an authorisation key is associated with a particular key
237 */ 224 */
@@ -242,10 +229,8 @@ static int key_get_instantiation_authkey_match(const struct key *key,
242 key_serial_t id = (key_serial_t)(unsigned long) _id; 229 key_serial_t id = (key_serial_t)(unsigned long) _id;
243 230
244 return rka->target_key->serial == id; 231 return rka->target_key->serial == id;
232}
245 233
246} /* end key_get_instantiation_authkey_match() */
247
248/*****************************************************************************/
249/* 234/*
250 * get the authorisation key for instantiation of a specific key if attached to 235 * get the authorisation key for instantiation of a specific key if attached to
251 * the current process's keyrings 236 * the current process's keyrings
@@ -278,5 +263,4 @@ struct key *key_get_instantiation_authkey(key_serial_t target_id)
278 263
279error: 264error:
280 return authkey; 265 return authkey;
281 266}
282} /* end key_get_instantiation_authkey() */