mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-16 21:29:59 +01:00
Support specifying keyring and key using keyctl syntax.
When using the --link-vk-to-keyring option, allow specifying the keyring using the same syntax as keyctl (see "man keyctl"). E.g. "@u" for user keyring and "%:testring" for a user-created keyring.
This commit is contained in:
@@ -1664,8 +1664,10 @@ static int action_open_luks(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (ARG_SET(OPT_LINK_VK_TO_KEYRING_ID))
|
||||
crypt_set_keyring_to_link(cd, ARG_INT32(OPT_LINK_VK_TO_KEYRING_ID));
|
||||
if (ARG_SET(OPT_LINK_VK_TO_KEYRING_ID)) {
|
||||
if ((r = crypt_set_keyring_to_link(cd, ARG_STR(OPT_LINK_VK_TO_KEYRING_ID))))
|
||||
return r;
|
||||
}
|
||||
|
||||
if (ARG_SET(OPT_VOLUME_KEY_FILE_ID)) {
|
||||
keysize = crypt_get_volume_key_size(cd);
|
||||
@@ -2532,8 +2534,10 @@ static int action_luksResume(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (ARG_SET(OPT_LINK_VK_TO_KEYRING_ID))
|
||||
crypt_set_keyring_to_link(cd, ARG_INT32(OPT_LINK_VK_TO_KEYRING_ID));
|
||||
if (ARG_SET(OPT_LINK_VK_TO_KEYRING_ID)) {
|
||||
if ((r = crypt_set_keyring_to_link(cd, ARG_STR(OPT_LINK_VK_TO_KEYRING_ID))))
|
||||
return r;
|
||||
}
|
||||
|
||||
if (!isLUKS(crypt_get_type(cd))) {
|
||||
log_err(_("%s is not active LUKS device name or header is missing."), action_argv[0]);
|
||||
|
||||
Reference in New Issue
Block a user