mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-07 00:40:01 +01:00
Use integrity key during integritysetup format.
Kernel could reject HMAC without a key during format, we must set a key here as well. Because there is no data area (device size is 8 sectors), it is actually never used, so we can use zeroed key here. The real HMAC key is used later during device activation with the real size.
This commit is contained in:
@@ -275,7 +275,13 @@ int INTEGRITY_format(struct crypt_device *cd,
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
/* There is no data area, we can actually use fake zeroed key */
|
||||
if (params->integrity_key_size)
|
||||
dmdi.u.integrity.vk = crypt_alloc_volume_key(params->integrity_key_size, NULL);
|
||||
|
||||
r = dm_create_device(cd, tmp_name, "INTEGRITY", &dmdi, 0);
|
||||
|
||||
crypt_free_volume_key(dmdi.u.integrity.vk);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user