X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Finclude%2Fkeys%2Fasymmetric-type.h;h=59c1df9cf922dfd7f3da0ad251dea1a8c0494866;hb=e09b41010ba33a20a87472ee821fa407a5b8da36;hp=c0754abb2f5676b8d8df7c0df4d44efdc3767d48;hpb=f93b97fd65072de626c074dbe099a1fff05ce060;p=kvmfornfv.git diff --git a/kernel/include/keys/asymmetric-type.h b/kernel/include/keys/asymmetric-type.h index c0754abb2..59c1df9cf 100644 --- a/kernel/include/keys/asymmetric-type.h +++ b/kernel/include/keys/asymmetric-type.h @@ -18,6 +18,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.