diff options
author | David Howells <dhowells@redhat.com> | 2014-07-22 21:51:20 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2014-07-22 21:51:20 +0100 |
commit | a19e3c22b34ae599eafd9fd05c887fc8e7ec2e3a (patch) | |
tree | 44a93a6da7868c58606f39421870b32a920b3e77 /include/linux | |
parent | 32c2e6752ff0f48fe03b9e1c7c64bde580a840d2 (diff) | |
parent | f1dcde91a3503f68ef209667a8798ead2b50b02a (diff) |
Merge tag 'keys-preparse-1-20140722' into keys-next
Here are a set of changes that make all but encrypted and trusted keys use
preparsing. Unfortunately, encrypted and trusted keys incorrectly use the
update op to alter a key, so other changes will need to be made for them.
These changes permit payload parsing when instantiating or updating a key to be
done before locks are taken and to determine the amount of quota that will be
required in advance. The latter will make it possible to do LRU discard before
any locks are taken.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/key-type.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/key-type.h b/include/linux/key-type.h index a74c3a84dfdd..44792ee649de 100644 --- a/include/linux/key-type.h +++ b/include/linux/key-type.h @@ -41,10 +41,11 @@ struct key_construction { struct key_preparsed_payload { char *description; /* Proposed key description (or NULL) */ void *type_data[2]; /* Private key-type data */ - void *payload; /* Proposed payload */ + void *payload[2]; /* Proposed payload */ const void *data; /* Raw data */ size_t datalen; /* Raw datalen */ size_t quotalen; /* Quota length for proposed payload */ + time_t expiry; /* Expiry time of key */ bool trusted; /* True if key is trusted */ }; @@ -159,5 +160,7 @@ static inline int key_negate_and_link(struct key *key, return key_reject_and_link(key, timeout, ENOKEY, keyring, instkey); } +extern int generic_key_instantiate(struct key *key, struct key_preparsed_payload *prep); + #endif /* CONFIG_KEYS */ #endif /* _LINUX_KEY_TYPE_H */ |