aboutsummaryrefslogtreecommitdiffstats
path: root/include/keys/asymmetric-type.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-10-21 14:04:48 +0100
committerDavid Howells <dhowells@redhat.com>2015-10-21 15:18:36 +0100
commit146aa8b1453bd8f1ff2304ffb71b4ee0eb9acdcc (patch)
treea89ef2cd2e8029b0c09a58739cca0e7e2e68f4db /include/keys/asymmetric-type.h
parentKEYS: Provide a script to extract a module signature (diff)
downloadlinux-dev-146aa8b1453bd8f1ff2304ffb71b4ee0eb9acdcc.tar.xz
linux-dev-146aa8b1453bd8f1ff2304ffb71b4ee0eb9acdcc.zip
KEYS: Merge the type-specific data with the payload data
Merge the type-specific data with the payload data into one four-word chunk as it seems pointless to keep them separate. Use user_key_payload() for accessing the payloads of overloaded user-defined keys. Signed-off-by: David Howells <dhowells@redhat.com> cc: linux-cifs@vger.kernel.org cc: ecryptfs@vger.kernel.org cc: linux-ext4@vger.kernel.org cc: linux-f2fs-devel@lists.sourceforge.net cc: linux-nfs@vger.kernel.org cc: ceph-devel@vger.kernel.org cc: linux-ima-devel@lists.sourceforge.net
Diffstat (limited to 'include/keys/asymmetric-type.h')
-rw-r--r--include/keys/asymmetric-type.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/keys/asymmetric-type.h b/include/keys/asymmetric-type.h
index c0754abb2f56..59c1df9cf922 100644
--- a/include/keys/asymmetric-type.h
+++ b/include/keys/asymmetric-type.h
@@ -19,6 +19,16 @@
extern struct key_type key_type_asymmetric;
/*
+ * The key payload is four words. The asymmetric-type key uses them as
+ * follows:
+ */
+enum asymmetric_payload_bits {
+ asym_crypto,
+ asym_subtype,
+ asym_key_ids,
+};
+
+/*
* Identifiers for an asymmetric key ID. We have three ways of looking up a
* key derived from an X.509 certificate:
*
@@ -58,6 +68,11 @@ extern struct asymmetric_key_id *asymmetric_key_generate_id(const void *val_1,
size_t len_1,
const void *val_2,
size_t len_2);
+static inline
+const struct asymmetric_key_ids *asymmetric_key_ids(const struct key *key)
+{
+ return key->payload.data[asym_key_ids];
+}
/*
* The payload is at the discretion of the subtype.