Allow to use backup header for tcrypt format.

TrueCrypt/VeraCrypt supports backup header, it seems to have
the same format as normal header.

Let's use --header option here, it can be used to unlock data partition
with header backup (open and dump commands).

Fixes: #587.
This commit is contained in:
Milan Broz
2020-09-19 21:23:33 +02:00
parent fe05e47656
commit 5d07b0730c
3 changed files with 7 additions and 10 deletions

View File

@@ -458,7 +458,8 @@ static int action_open_tcrypt(void)
activated_name = ARG_SET(OPT_TEST_PASSPHRASE_ID) ? NULL : action_argv[1];
if ((r = crypt_init(&cd, action_argv[0])))
r = crypt_init_data_device(&cd, ARG_STR(OPT_HEADER_ID) ?: action_argv[0], action_argv[0]);
if (r < 0)
goto out;
r = tcrypt_load(cd, &params);
@@ -571,8 +572,8 @@ static int action_tcryptDump(void)
.veracrypt_pim = ARG_UINT32(OPT_VERACRYPT_PIM_ID)
};
int r;
if ((r = crypt_init(&cd, action_argv[0])))
r = crypt_init_data_device(&cd, ARG_STR(OPT_HEADER_ID) ?: action_argv[0], action_argv[0]);
if (r < 0)
goto out;
r = tcrypt_load(cd, &params);