Skip to content

Commit

Permalink
KEYS: Add a key restriction struct
Browse files Browse the repository at this point in the history
Key link restrictions require restriction-specific data as well as a
restriction-specific function pointer. As a first step toward replacing
the restrict_link pointer in struct key, define a more general
key_restriction structure that captures the required function, key, and
key type pointers. Key type modules should not be pinned on account of
this key type pointer because the pointer will be cleared by the garbage
collector if the key type is unregistered.

Signed-off-by: Mat Martineau <[email protected]>
  • Loading branch information
mjmartineau committed Apr 3, 2017
1 parent aaf66c8 commit e9cc0f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/linux/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ typedef int (*key_restrict_link_func_t)(struct key *dest_keyring,
const union key_payload *payload,
struct key *restriction_key);

struct key_restriction {
key_restrict_link_func_t check;
struct key *key;
struct key_type *keytype;
};

/*****************************************************************************/
/*
* authentication token / access credential / keyring
Expand Down

0 comments on commit e9cc0f6

Please sign in to comment.