cryptsetup: port cryptsetup's main key file logic over to read_full_file_full()
authorLennart Poettering <lennart@poettering.net>
Wed, 4 Nov 2020 16:24:53 +0000 (17:24 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Dec 2020 13:17:47 +0000 (14:17 +0100)
commite2c2f868b28f1445e061bf7eb475b0c49efe3ac2
tree079bbb0b1c1c9c3d97d279693363e929f81e491a
parent4d1bb8f39702630c52d6b3599e4fc96ee31b84aa
cryptsetup: port cryptsetup's main key file logic over to read_full_file_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 → #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.
src/cryptsetup/cryptsetup.c