Fix verbose message about key removal in luksKillSlot,luksErase and luksKremoveKey.

The crypt_keyslot_destroy() does not return keyslot number,
so return value 0 was always used as a keyslot reference.
This commit is contained in:
Milan Broz
2018-10-27 17:36:17 +02:00
parent bb29c5b322
commit 7213d5a76b
3 changed files with 16 additions and 4 deletions

View File

@@ -1288,7 +1288,7 @@ static int action_luksKillSlot(void)
}
r = crypt_keyslot_destroy(cd, opt_key_slot);
tools_keyslot_msg(r, REMOVED);
tools_keyslot_msg(opt_key_slot, REMOVED);
out:
crypt_free(cd);
return r;
@@ -1341,7 +1341,7 @@ static int action_luksRemoveKey(void)
}
r = crypt_keyslot_destroy(cd, opt_key_slot);
tools_keyslot_msg(r, REMOVED);
tools_keyslot_msg(opt_key_slot, REMOVED);
out:
crypt_safe_free(password);
crypt_free(cd);
@@ -1911,7 +1911,7 @@ static int action_luksErase(void)
r = crypt_keyslot_destroy(cd, i);
if (r < 0)
goto out;
tools_keyslot_msg(r, REMOVED);
tools_keyslot_msg(i, REMOVED);
}
}
out: