mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-15 04:40:05 +01:00
Fix cryptsetup resize using LUKS2 tokens.
Fix a bug where cryptsetup needlessly asked for passphrase even though volume key was already unlocked via LUKS2 token. Fixes: #601.
This commit is contained in:
committed by
Milan Broz
parent
42f4dcef88
commit
a00722e80c
@@ -665,7 +665,10 @@ static int action_resize(void)
|
||||
r = crypt_activate_by_token(cd, NULL, ARG_INT32(OPT_TOKEN_ID_ID), NULL,
|
||||
CRYPT_ACTIVATE_KEYRING_KEY);
|
||||
tools_keyslot_msg(r, UNLOCKED);
|
||||
if (r < 0 && ARG_SET(OPT_TOKEN_ONLY_ID))
|
||||
|
||||
if (r >= 0)
|
||||
goto resize;
|
||||
else if (ARG_SET(OPT_TOKEN_ONLY_ID))
|
||||
goto out;
|
||||
|
||||
r = tools_get_key(NULL, &password, &passwordLen,
|
||||
@@ -682,6 +685,7 @@ static int action_resize(void)
|
||||
crypt_safe_free(password);
|
||||
}
|
||||
|
||||
resize:
|
||||
if (ARG_UINT64(OPT_DEVICE_SIZE_ID))
|
||||
dev_size = ARG_UINT64(OPT_DEVICE_SIZE_ID) / SECTOR_SIZE;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user