diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/rxrpc/af_rxrpc.c | 1 | ||||
-rw-r--r-- | net/rxrpc/ar-key.c | 32 |
2 files changed, 30 insertions, 3 deletions
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c index 0803f305ed0..c680017f5c8 100644 --- a/net/rxrpc/af_rxrpc.c +++ b/net/rxrpc/af_rxrpc.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
15 | #include <linux/poll.h> | 15 | #include <linux/poll.h> |
16 | #include <linux/proc_fs.h> | 16 | #include <linux/proc_fs.h> |
17 | #include <linux/key-type.h> | ||
17 | #include <net/net_namespace.h> | 18 | #include <net/net_namespace.h> |
18 | #include <net/sock.h> | 19 | #include <net/sock.h> |
19 | #include <net/af_rxrpc.h> | 20 | #include <net/af_rxrpc.h> |
diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c index 7e049ff6ae6..9a8ff684da7 100644 --- a/net/rxrpc/ar-key.c +++ b/net/rxrpc/ar-key.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/net.h> | 16 | #include <linux/net.h> |
17 | #include <linux/skbuff.h> | 17 | #include <linux/skbuff.h> |
18 | #include <linux/key.h> | 18 | #include <linux/key-type.h> |
19 | #include <linux/crypto.h> | 19 | #include <linux/crypto.h> |
20 | #include <net/sock.h> | 20 | #include <net/sock.h> |
21 | #include <net/af_rxrpc.h> | 21 | #include <net/af_rxrpc.h> |
@@ -40,7 +40,6 @@ struct key_type key_type_rxrpc = { | |||
40 | .destroy = rxrpc_destroy, | 40 | .destroy = rxrpc_destroy, |
41 | .describe = rxrpc_describe, | 41 | .describe = rxrpc_describe, |
42 | }; | 42 | }; |
43 | |||
44 | EXPORT_SYMBOL(key_type_rxrpc); | 43 | EXPORT_SYMBOL(key_type_rxrpc); |
45 | 44 | ||
46 | /* | 45 | /* |
@@ -330,5 +329,32 @@ error: | |||
330 | _leave(" = -ENOMEM [ins %d]", ret); | 329 | _leave(" = -ENOMEM [ins %d]", ret); |
331 | return -ENOMEM; | 330 | return -ENOMEM; |
332 | } | 331 | } |
333 | |||
334 | EXPORT_SYMBOL(rxrpc_get_server_data_key); | 332 | EXPORT_SYMBOL(rxrpc_get_server_data_key); |
333 | |||
334 | /** | ||
335 | * rxrpc_get_null_key - Generate a null RxRPC key | ||
336 | * @keyname: The name to give the key. | ||
337 | * | ||
338 | * Generate a null RxRPC key that can be used to indicate anonymous security is | ||
339 | * required for a particular domain. | ||
340 | */ | ||
341 | struct key *rxrpc_get_null_key(const char *keyname) | ||
342 | { | ||
343 | struct key *key; | ||
344 | int ret; | ||
345 | |||
346 | key = key_alloc(&key_type_rxrpc, keyname, 0, 0, current, | ||
347 | KEY_POS_SEARCH, KEY_ALLOC_NOT_IN_QUOTA); | ||
348 | if (IS_ERR(key)) | ||
349 | return key; | ||
350 | |||
351 | ret = key_instantiate_and_link(key, NULL, 0, NULL, NULL); | ||
352 | if (ret < 0) { | ||
353 | key_revoke(key); | ||
354 | key_put(key); | ||
355 | return ERR_PTR(ret); | ||
356 | } | ||
357 | |||
358 | return key; | ||
359 | } | ||
360 | EXPORT_SYMBOL(rxrpc_get_null_key); | ||