Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9cc0f68 authored by Mat Martineau's avatar Mat Martineau
Browse files

KEYS: Add a key restriction struct



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: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
parent aaf66c88
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -132,6 +132,12 @@ typedef int (*key_restrict_link_func_t)(struct key *dest_keyring,
					const union key_payload *payload,
					const union key_payload *payload,
					struct key *restriction_key);
					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
 * authentication token / access credential / keyring