Commit 1c6d66fc authored by Ondrej Kozina's avatar Ondrej Kozina Committed by Milan Broz

Emit error message for converting inactive keyslot.

Fixes: #416.
parent 114356ad
......@@ -1535,6 +1535,12 @@ static int action_luksConvertKey(void)
if ((r = crypt_load(cd, CRYPT_LUKS2, NULL)))
goto out;
if (crypt_keyslot_status(cd, opt_key_slot) == CRYPT_SLOT_INACTIVE) {
r = -EINVAL;
log_err(_("Keyslot %d is not active."), opt_key_slot);
goto out;
r = set_pbkdf_params(cd, crypt_get_type(cd));
if (r) {
log_err(_("Failed to set pbkdf parameters."));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment