path: root/include/keys
diff options
authorStefan Berger <>2021-03-16 17:07:38 -0400
committerHerbert Xu <>2021-03-26 19:41:59 +1100
commit947d70597236dd5ae65c1f68c8eabfb962ee5a6b (patch)
tree3023712de73708ee7236e770e51d4c279392ba55 /include/keys
parent299f561a66939debba70e6d7c67aa01ed32613d9 (diff)
ima: Support EC keys for signature verification
Add support for IMA signature verification for EC keys. Since SHA type of hashes can be used by RSA and ECDSA signature schemes we need to look at the key and derive from the key which signature scheme to use. Since this can be applied to all types of keys, we change the selection of the encoding type to be driven by the key's signature scheme rather than by the hash type. Cc: Dmitry Kasatkin <> Cc: Cc: David Howells <> Cc: Signed-off-by: Stefan Berger <> Reviewed-by: Vitaly Chikunov <> Reviewed-by: Tianjia Zhang <> Acked-by: Mimi Zohar <> Signed-off-by: Herbert Xu <>
Diffstat (limited to 'include/keys')
1 files changed, 6 insertions, 0 deletions
diff --git a/include/keys/asymmetric-type.h b/include/keys/asymmetric-type.h
index a29d3ff2e7e8..c432fdb8547f 100644
--- a/include/keys/asymmetric-type.h
+++ b/include/keys/asymmetric-type.h
@@ -72,6 +72,12 @@ const struct asymmetric_key_ids *asymmetric_key_ids(const struct key *key)
return key->[asym_key_ids];
+static inline
+const struct public_key *asymmetric_key_public_key(const struct key *key)
+ return key->[asym_crypto];
extern struct key *find_asymmetric_key(struct key *keyring,
const struct asymmetric_key_id *id_0,
const struct asymmetric_key_id *id_1,