cryptsetup: if keyfile is specified as AF_UNIX socket in the fs, connect to it, and read key data from it - #17524
Conversation
bluca
left a comment
There was a problem hiding this comment.
Just left a minor comment about documentation phrasing. Rest of the patches all look good to me.
ac6a27f to
4f737f2
Compare
|
Force pushed a new version. Only change are the two suggested doc fixes. |
4f737f2 to
e6eb4c1
Compare
e6eb4c1 to
f21e5ec
Compare
keszybz
left a comment
There was a problem hiding this comment.
Looks very nice. Some minor suggestions only.
There was a problem hiding this comment.
There's just one caller that always specifies a search path. So this code might be simplified...
There was a problem hiding this comment.
true. I wrote this code also to prepare things for the credentials logic (so that you can supply key data via LoadCredential= too), but didn't include the patch for that yet. In that case we'd not specify a search path. I'd thus like to keep this in for now. will post patch for creds hookup shortly
We have easy support for this, hence use it for privileged key data.
…EADABLE when reading PEM secret key It's secret data, hence use the appropriate flags.
Now that we can read from offsets/with size, let's port the cryptsetup PKCS#11 key file logic over to read_full_file_full().
…ile_full() Previously, we'd load the file with libcryptsetup's calls. Let's do that in our own, so that we can make use of READ_FULL_FILE_CONNECT_SOCKET, i.e. read in keys via AF_UNIX sockets, so that people can plug key providers into our logic. This provides functionality similar to Debian's keyscript= crypttab option (see → systemd#3007), as it allows key scripts to be run as socket activated services, that have stdout connected to the activated socket. In contrast to traditional keyscript= support this logic runs stuff out of process however, which is beneficial, since it allows sandboxing and similar.
Let's move the 3rd way how cryptsetup acquires key files to read_file_full() too. Since load_key_file()'s raison d'etre now is just the search path logic, let's rename the function to find_key_file().
The comment is pointless, ECC systematically doesn't allow encryption/decryption directly, only RSA does that. If you want to use ECC for asymmetric encryption/decryption you have to combine it with key exchange scheme and symmetric scheme. This all is not a limitation of the Yubikey, hence don't claim so. It's just how ECC is.
f21e5ec to
8c43731
Compare
|
Force pushed a new version. Only changes are the two suggested ones, for the other one see comment above. Upgrading green label. Thanks for the review! This is great to get merged to make #17741 a lot smaller. |
No description provided.