Commit 954214e4 authored by Milan Broz's avatar Milan Broz

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.
parent 828e6f20
......@@ -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);
if (r)
return r;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment