Verify fvault2 key size in before activation by volume key.

This commit is contained in:
Ondrej Kozina
2024-10-29 14:41:59 +01:00
committed by Milan Broz
parent 00b89c4862
commit 652835a1f8

View File

@@ -5565,7 +5565,10 @@ static int _verify_key(struct crypt_device *cd,
r = KEY_VERIFIED; r = KEY_VERIFIED;
else if (isBITLK(cd->type)) else if (isBITLK(cd->type))
r = KEY_VERIFIED; r = KEY_VERIFIED;
else else if (isFVAULT2(cd->type)) {
if (vk && vk->keylength == FVAULT2_volume_key_size())
r = KEY_VERIFIED;
} else
log_err(cd, _("Device type is not properly initialized.")); log_err(cd, _("Device type is not properly initialized."));
if (r >= KEY_VERIFIED) if (r >= KEY_VERIFIED)