In many ways, I think that the type and description describe the purpose of
the key, not its source or derivation.
I don't think you understood what I meant. If you look at the following
function:
+static struct key *request_master_key(struct encrypted_key_payload *epayload,
+ void **master_key,
+ unsigned int *master_keylen)
+{
+ struct key *mkey;
+
+ mkey = request_trusted_key(epayload->master_desc,
+ master_key, master_keylen);
+ if (IS_ERR(mkey)) {
+ mkey = request_user_key(epayload->master_desc,
+ master_key, master_keylen);
+ if (IS_ERR(mkey)) {
+ pr_info("encrypted_key: trusted/user key %s not found",
+ epayload->master_desc);
+ return mkey;
+ }
+ }
+ dump_master_key(*master_key, *master_keylen);
+ return mkey;
+}
In the bit where you go for a user key (having failed to get a trusted key),
you should prefix the description here (or in request_user_key()) with
something like "trusted:". Then you don't need to change the user interface.
David
--