Skip to content

Commit 3b8c4a0

Browse files
committed
keys: Kill off request_key_async{,_with_auxdata}
Kill off request_key_async{,_with_auxdata}() as they're not currently used. Signed-off-by: David Howells <[email protected]>
1 parent 7743c48 commit 3b8c4a0

File tree

4 files changed

+2
-114
lines changed

4 files changed

+2
-114
lines changed

Documentation/security/keys/core.rst

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,38 +1115,6 @@ payload contents" for more information.
11151115
is a blob of length callout_len, if given (the length may be 0).
11161116

11171117

1118-
* A key can be requested asynchronously by calling one of::
1119-
1120-
struct key *request_key_async(const struct key_type *type,
1121-
const char *description,
1122-
const void *callout_info,
1123-
size_t callout_len);
1124-
1125-
or::
1126-
1127-
struct key *request_key_async_with_auxdata(const struct key_type *type,
1128-
const char *description,
1129-
const char *callout_info,
1130-
size_t callout_len,
1131-
void *aux);
1132-
1133-
which are asynchronous equivalents of request_key() and
1134-
request_key_with_auxdata() respectively.
1135-
1136-
These two functions return with the key potentially still under
1137-
construction. To wait for construction completion, the following should be
1138-
called::
1139-
1140-
int wait_for_key_construction(struct key *key, bool intr);
1141-
1142-
The function will wait for the key to finish being constructed and then
1143-
invokes key_validate() to return an appropriate value to indicate the state
1144-
of the key (0 indicates the key is usable).
1145-
1146-
If intr is true, then the wait can be interrupted by a signal, in which
1147-
case error ERESTARTSYS will be returned.
1148-
1149-
11501118
* To search for a key under RCU conditions, call::
11511119

11521120
struct key *request_key_rcu(const struct key_type *type,

Documentation/security/keys/request-key.rst

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,6 @@ or::
2121
size_t callout_len,
2222
void *aux);
2323

24-
or::
25-
26-
struct key *request_key_async(const struct key_type *type,
27-
const char *description,
28-
const char *callout_info,
29-
size_t callout_len);
30-
31-
or::
32-
33-
struct key *request_key_async_with_auxdata(const struct key_type *type,
34-
const char *description,
35-
const char *callout_info,
36-
size_t callout_len,
37-
void *aux);
38-
3924
or::
4025

4126
struct key *request_key_rcu(const struct key_type *type,
@@ -53,15 +38,11 @@ does not need to link the key to a keyring to prevent it from being immediately
5338
destroyed. The kernel interface returns a pointer directly to the key, and
5439
it's up to the caller to destroy the key.
5540

56-
The request_key*_with_auxdata() calls are like the in-kernel request_key*()
57-
calls, except that they permit auxiliary data to be passed to the upcaller (the
41+
The request_key_with_auxdata() calls is like the in-kernel request_key() call,
42+
except that they permit auxiliary data to be passed to the upcaller (the
5843
default is NULL). This is only useful for those key types that define their
5944
own upcall mechanism rather than using /sbin/request-key.
6045

61-
The two async in-kernel calls may return keys that are still in the process of
62-
being constructed. The two non-async ones will wait for construction to
63-
complete first.
64-
6546
The request_key_rcu() call is like the in-kernel request_key() call, except
6647
that it doesn't check for keys that are under construction and doesn't attempt
6748
to construct missing keys.

include/linux/key.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,6 @@ extern struct key *request_key_with_auxdata(struct key_type *type,
283283
size_t callout_len,
284284
void *aux);
285285

286-
extern struct key *request_key_async(struct key_type *type,
287-
const char *description,
288-
const void *callout_info,
289-
size_t callout_len);
290-
291-
extern struct key *request_key_async_with_auxdata(struct key_type *type,
292-
const char *description,
293-
const void *callout_info,
294-
size_t callout_len,
295-
void *aux);
296-
297286
extern int wait_for_key_construction(struct key *key, bool intr);
298287

299288
extern int key_validate(const struct key *key);

security/keys/request_key.c

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -739,56 +739,6 @@ struct key *request_key_with_auxdata(struct key_type *type,
739739
}
740740
EXPORT_SYMBOL(request_key_with_auxdata);
741741

742-
/*
743-
* request_key_async - Request a key (allow async construction)
744-
* @type: Type of key.
745-
* @description: The searchable description of the key.
746-
* @callout_info: The data to pass to the instantiation upcall (or NULL).
747-
* @callout_len: The length of callout_info.
748-
*
749-
* As for request_key_and_link() except that it does not add the returned key
750-
* to a keyring if found, new keys are always allocated in the user's quota and
751-
* no auxiliary data can be passed.
752-
*
753-
* The caller should call wait_for_key_construction() to wait for the
754-
* completion of the returned key if it is still undergoing construction.
755-
*/
756-
struct key *request_key_async(struct key_type *type,
757-
const char *description,
758-
const void *callout_info,
759-
size_t callout_len)
760-
{
761-
return request_key_and_link(type, description, callout_info,
762-
callout_len, NULL, NULL,
763-
KEY_ALLOC_IN_QUOTA);
764-
}
765-
EXPORT_SYMBOL(request_key_async);
766-
767-
/*
768-
* request a key with auxiliary data for the upcaller (allow async construction)
769-
* @type: Type of key.
770-
* @description: The searchable description of the key.
771-
* @callout_info: The data to pass to the instantiation upcall (or NULL).
772-
* @callout_len: The length of callout_info.
773-
* @aux: Auxiliary data for the upcall.
774-
*
775-
* As for request_key_and_link() except that it does not add the returned key
776-
* to a keyring if found and new keys are always allocated in the user's quota.
777-
*
778-
* The caller should call wait_for_key_construction() to wait for the
779-
* completion of the returned key if it is still undergoing construction.
780-
*/
781-
struct key *request_key_async_with_auxdata(struct key_type *type,
782-
const char *description,
783-
const void *callout_info,
784-
size_t callout_len,
785-
void *aux)
786-
{
787-
return request_key_and_link(type, description, callout_info,
788-
callout_len, aux, NULL, KEY_ALLOC_IN_QUOTA);
789-
}
790-
EXPORT_SYMBOL(request_key_async_with_auxdata);
791-
792742
/**
793743
* request_key_rcu - Request key from RCU-read-locked context
794744
* @type: The type of key we want.

0 commit comments

Comments
 (0)