mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-09 18:00:01 +01:00
Add LUKS2 uuid component in underlying dm-integrity device.
This commit is contained in:
committed by
Milan Broz
parent
59bed375d0
commit
249e6af3a6
@@ -2166,6 +2166,7 @@ int LUKS2_activate(struct crypt_device *cd,
|
||||
return r;
|
||||
|
||||
dmdi.flags |= CRYPT_ACTIVATE_PRIVATE;
|
||||
dmdi.uuid = dmd.uuid;
|
||||
dmd.segment.u.crypt.offset = 0;
|
||||
dmd.segment.size = dmdi.segment.size;
|
||||
|
||||
|
||||
@@ -2239,9 +2239,9 @@ static int _compare_device_types(struct crypt_device *cd,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (isLUKS2(cd->type) && !src->uuid) {
|
||||
if (strncmp("INTEGRITY-", tgt->uuid, strlen("INTEGRITY-"))) {
|
||||
log_dbg(cd, "Unexpected uuid prefix %s in target integrity device.", tgt->uuid);
|
||||
if (isLUKS2(cd->type) && !strncmp("INTEGRITY-", tgt->uuid, strlen("INTEGRITY-"))) {
|
||||
if (crypt_uuid_cmp(tgt->uuid, src->uuid)) {
|
||||
log_dbg(cd, "LUKS UUID mismatch.");
|
||||
return -EINVAL;
|
||||
}
|
||||
} else if (isLUKS(cd->type)) {
|
||||
|
||||
Reference in New Issue
Block a user