mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +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
@@ -2461,6 +2461,19 @@ int LUKS2_get_volume_key_size(struct luks2_hdr *hdr, int segment)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int LUKS2_get_old_volume_key_size(struct luks2_hdr *hdr)
|
||||
{
|
||||
int old_segment;
|
||||
|
||||
assert(hdr);
|
||||
|
||||
old_segment = LUKS2_reencrypt_segment_old(hdr);
|
||||
if (old_segment < 0)
|
||||
return old_segment;
|
||||
|
||||
return LUKS2_get_volume_key_size(hdr, old_segment);
|
||||
}
|
||||
|
||||
uint32_t LUKS2_get_sector_size(struct luks2_hdr *hdr)
|
||||
{
|
||||
return json_segment_get_sector_size(LUKS2_get_segment_jobj(hdr, CRYPT_DEFAULT_SEGMENT));
|
||||
|
||||
Reference in New Issue
Block a user