Skip to content

Conversation

rcatolino
Copy link
Contributor

The keyring has a "logon" key type for keys that userspace can create and update but not read. This method allows to add such keys.

@mathstuf
Copy link
Owner

Thanks. Where is this documented? Is it a freedesktop.org thing?

@rcatolino
Copy link
Contributor Author

It's documented in the kernel doc (search for 'logon'). I don't think it has anything to do with freedesktop.org, personally I need it to use the ext4 encryption feature.

@mathstuf
Copy link
Owner

Thanks. The libkeyutils docs don't mention it (which where I usually look). Could the subclass be added as a separate argument since it seems required as well?

@rcatolino
Copy link
Contributor Author

It would probably be better to only have an additional argument to add_key but I didn't want to break backward compatibility by changing add_key signature. If you prefer I can update the pull request to use

pub fn add_key(&mut self, keytype: KeyType, description: &str, payload: &[u8] -> Result<Key>

Withg KeyType a suitable enum

@mathstuf
Copy link
Owner

That sounds good to me. I think once this and #7 land, I'll do 0.2 in preparation for 1.0.

@rcatolino
Copy link
Contributor Author

I've updated my pull request. And I just realized you were talking about the subclass prefix in the key description, not the key type...
If we add the subclass as a separate argument, add_logon_key does needs to be a separate method since the subclass isn't used for user keys.

I initially thought of using a separate subclass argument but if user gets a key description string already containing the subclass from somewhere else, they would have to split it on ":" and pass both pieces separately. Although I'm not sure how likely this is to happen. I don't feel too strongly about it anyway, so if you want I can create an add_logon_key method with a subclass instead.

@mathstuf mathstuf merged commit 21a776b into mathstuf:master Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants