diff --git a/man/common_options.adoc b/man/common_options.adoc index fd250922..ff07dd5f 100644 --- a/man/common_options.adoc +++ b/man/common_options.adoc @@ -441,7 +441,7 @@ it is requested. Reencrypt only the LUKS1 header and keyslots. Skips data in-place reencryption. endif::[] -ifdef::ACTION_OPEN,ACTION_LUKSFORMAT,ACTION_LUKSDUMP,ACTION_RESIZE,ACTION_TOKEN[] +ifdef::ACTION_OPEN,ACTION_LUKSFORMAT,ACTION_LUKSDUMP,ACTION_RESIZE,ACTION_LUKSRESUME,ACTION_TOKEN[] *--key-description *:: Set key description in keyring that will be used for passphrase retrieval. endif::[] diff --git a/src/cryptsetup.c b/src/cryptsetup.c index f6cc5b46..598500ad 100644 --- a/src/cryptsetup.c +++ b/src/cryptsetup.c @@ -2913,16 +2913,16 @@ static int action_luksResume(void) goto out; } - tries = set_tries_tty(false); + tries = set_tries_tty(true); do { - r = tools_get_key(NULL, &password, &passwordLen, - ARG_UINT64(OPT_KEYFILE_OFFSET_ID), ARG_UINT32(OPT_KEYFILE_SIZE_ID), ARG_STR(OPT_KEY_FILE_ID), - ARG_UINT32(OPT_TIMEOUT_ID), verify_passphrase(0), 0, cd); + r = init_keyslot_context(cd, &password, &passwordLen, verify_passphrase(0), false, false, &kc); if (r < 0) goto out; - r = crypt_resume_by_passphrase(cd, action_argv[0], ARG_INT32(OPT_KEY_SLOT_ID), - password, passwordLen); + r = crypt_resume_by_keyslot_context(cd, action_argv[0], ARG_INT32(OPT_KEY_SLOT_ID), kc); + crypt_keyslot_context_free(kc); + kc = NULL; + tools_passphrase_msg(r); check_signal(&r); tools_keyslot_msg(r, UNLOCKED); diff --git a/src/cryptsetup_args.h b/src/cryptsetup_args.h index 42af648c..3d30f4dc 100644 --- a/src/cryptsetup_args.h +++ b/src/cryptsetup_args.h @@ -71,7 +71,7 @@ #define OPT_ITER_TIME_ACTIONS { BENCHMARK_ACTION, FORMAT_ACTION, ADDKEY_ACTION, CHANGEKEY_ACTION, CONVERTKEY_ACTION, REENCRYPT_ACTION } #define OPT_IV_LARGE_SECTORS_ACTIONS { OPEN_ACTION } #define OPT_KEEP_KEY_ACTIONS { REENCRYPT_ACTION } -#define OPT_KEY_DESCRIPTION_ACTIONS { TOKEN_ACTION, LUKSDUMP_ACTION, FORMAT_ACTION, RESIZE_ACTION, OPEN_ACTION } +#define OPT_KEY_DESCRIPTION_ACTIONS { TOKEN_ACTION, LUKSDUMP_ACTION, FORMAT_ACTION, RESIZE_ACTION, OPEN_ACTION, RESUME_ACTION } #define OPT_KEY_SIZE_ACTIONS { OPEN_ACTION, BENCHMARK_ACTION, FORMAT_ACTION, REENCRYPT_ACTION, ADDKEY_ACTION } #define OPT_KEY_SLOT_ACTIONS { OPEN_ACTION, REENCRYPT_ACTION, CONFIG_ACTION, FORMAT_ACTION, ADDKEY_ACTION, CHANGEKEY_ACTION, CONVERTKEY_ACTION, LUKSDUMP_ACTION, TOKEN_ACTION, RESUME_ACTION } #define OPT_KEYSLOT_CIPHER_ACTIONS { FORMAT_ACTION, REENCRYPT_ACTION, ADDKEY_ACTION, CHANGEKEY_ACTION, CONVERTKEY_ACTION }