Switch away from accessing volume key internals directly.

Switch current code to use following volume key helpers
for accessing internal properties:

crypt_volume_key_length(), crypt_volume_key_get_key(),
crypt_volume_key_description() and crypt_volume_key_kernel_key_type()

Remaining direct access to volume key internals will be dealt with in
later commits since it requires some further changes.
This commit is contained in:
Ondrej Kozina
2025-01-31 16:03:44 +01:00
committed by Milan Broz
parent fd9be9e777
commit 54d937dfc7
17 changed files with 165 additions and 124 deletions

View File

@@ -948,7 +948,7 @@ static int _crypt_keyslot_context_init_by_volume_key(const char *volume_key,
free(tmp);
return -ENOMEM;
}
volume_key = i_vk->key;
volume_key = crypt_volume_key_get_key(i_vk);
}
crypt_keyslot_context_init_by_key_internal(tmp, volume_key, volume_key_size);
@@ -1003,13 +1003,13 @@ static int _crypt_keyslot_context_init_by_signed_key(const char *volume_key,
if (self_contained && volume_key) {
if (!(i_vk = crypt_alloc_volume_key(volume_key_size, volume_key)))
goto err;
volume_key = i_vk->key;
volume_key = crypt_volume_key_get_key(i_vk);
}
if (self_contained && signature) {
if (!(i_vk_sig = crypt_alloc_volume_key(signature_size, signature)))
goto err;
signature = i_vk_sig->key;
signature = crypt_volume_key_get_key(i_vk_sig);
}
crypt_keyslot_context_init_by_signed_key_internal(tmp, volume_key, volume_key_size,