repart: add basic support for LUKS2 integrity verification

Authenticated disk encryption is experimentally supported by cryptsetup since
v2.0.0 and allows for automatic dm-integrity setup for LUKS devices. Add
support for the mode to systemd-repart. Currently, the option can only be used
in 'online' mode as libcryptsetup does not support creating integrity data
without the use of in-kernel dm-integrity infrastructure.

Integrity=/IntegrityAlgorithm= are added in the anticipation of other integrity
protection options, e.g. enabling dm-integrity for a plain unencrypted
partition.
This commit is contained in:
Vitaly Kuznetsov
2025-12-18 09:12:49 +01:00
parent 27aba70b3b
commit 1a4a34287f
4 changed files with 133 additions and 7 deletions
+3 -1
View File
@@ -70,6 +70,7 @@ DLSYM_PROTOTYPE(crypt_token_set_external_path) = NULL;
DLSYM_PROTOTYPE(crypt_token_status) = NULL;
DLSYM_PROTOTYPE(crypt_volume_key_get) = NULL;
DLSYM_PROTOTYPE(crypt_volume_key_keyring) = NULL;
DLSYM_PROTOTYPE(crypt_wipe) = NULL;
static void cryptsetup_log_glue(int level, const char *msg, void *usrptr) {
@@ -274,7 +275,8 @@ int dlopen_cryptsetup(void) {
#endif
DLSYM_ARG(crypt_token_status),
DLSYM_ARG(crypt_volume_key_get),
DLSYM_ARG(crypt_volume_key_keyring));
DLSYM_ARG(crypt_volume_key_keyring),
DLSYM_ARG(crypt_wipe));
if (r <= 0)
return r;