Allow --test-passphrase for detached header alone.

Before this fix we required data device specified on cmd line
even though it was not necessary for testing passphrase.

Fixes: #487.
This commit is contained in:
Ondrej Kozina
2019-11-18 17:33:20 +01:00
parent 5e4dbf33be
commit de6258d366
3 changed files with 7 additions and 1 deletions

View File

@@ -1374,7 +1374,7 @@ static int action_open_luks(void)
goto out;
}
if (!data_device && (crypt_get_data_offset(cd) < 8)) {
if (!data_device && (crypt_get_data_offset(cd) < 8) && !opt_test_passphrase) {
log_err(_("Reduced data offset is allowed only for detached LUKS header."));
r = -EINVAL;
goto out;