mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Add crypt_get_old_volume_key_size API.
It allows to get former (old) volume key size from LUKS2 device in reencryption state when there's at least one keyslot containing encrypted volume key.
This commit is contained in:
committed by
Milan Broz
parent
3dcb532bd3
commit
4e94c8d809
13
lib/setup.c
13
lib/setup.c
@@ -6413,6 +6413,19 @@ int crypt_get_volume_key_size(struct crypt_device *cd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int crypt_get_old_volume_key_size(struct crypt_device *cd)
|
||||
{
|
||||
int r = _onlyLUKS2(cd, CRYPT_CD_QUIET,
|
||||
CRYPT_REQUIREMENT_ONLINE_REENCRYPT | CRYPT_REQUIREMENT_OPAL);
|
||||
|
||||
if (r < 0)
|
||||
return 0;
|
||||
|
||||
r = LUKS2_get_old_volume_key_size(&cd->u.luks2.hdr);
|
||||
|
||||
return r < 0 ? 0 : r;
|
||||
}
|
||||
|
||||
int crypt_get_hw_encryption_key_size(struct crypt_device *cd)
|
||||
{
|
||||
if (!cd || !isLUKS2(cd->type))
|
||||
|
||||
Reference in New Issue
Block a user