Add --key-file support in luksErase action with LUKS2 opal.

This commit is contained in:
Ondrej Kozina
2023-10-27 11:18:04 +02:00
parent f15b2ffdec
commit 4081037bdb
3 changed files with 18 additions and 5 deletions

View File

@@ -2877,9 +2877,10 @@ static int opal_erase(struct crypt_device *cd, bool factory_reset) {
int r;
r = tools_get_key(factory_reset ? _("Enter OPAL PSID: ") : _("Enter OPAL Admin password: "),
&password, &password_size,
0, 0, NULL,
ARG_UINT32(OPT_TIMEOUT_ID), verify_passphrase(1), !ARG_SET(OPT_FORCE_PASSWORD_ID), cd);
&password, &password_size, 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(1),
!ARG_SET(OPT_FORCE_PASSWORD_ID), cd);
if (r < 0)
return r;