Introduce LUKS2-OPAL private dm uuid prefix.

LUKS2 devices with configured HW OPAL encryption (any configuration)
get activated with private dm uuid prefix LUKS2-OPAL so that we
can properly detect devices with HW OPAL encryption even with
missing LUKS2 header (detached header). Internally LUKS2-OPAL
prefix matches LUKS2 device type.
This commit is contained in:
Ondrej Kozina
2023-07-31 16:24:49 +02:00
parent fc04761cdc
commit b60ffe9e06
3 changed files with 11 additions and 2 deletions

View File

@@ -2754,9 +2754,13 @@ int LUKS2_activate(struct crypt_device *cd,
if (dynamic)
dmd.segment.size = dmdi.segment.size;
r = create_or_reload_device_with_integrity(cd, name, CRYPT_LUKS2, &dmd, &dmdi);
r = create_or_reload_device_with_integrity(cd, name,
opal_key ? CRYPT_LUKS2_HW_OPAL : CRYPT_LUKS2,
&dmd, &dmdi);
} else
r = create_or_reload_device(cd, name, CRYPT_LUKS2, &dmd);
r = create_or_reload_device(cd, name,
opal_key ? CRYPT_LUKS2_HW_OPAL : CRYPT_LUKS2,
&dmd);
dm_targets_free(cd, &dmd);
dm_targets_free(cd, &dmdi);