Retain keyslot number in luksChangeKey for LUKS2.

With JSON, we can actually retain the slot number in all cases
(except user intentionally set new slot #).

This patch changes the crypt_keyslot_change_by_passphrase() API
call to retain keyslot number for LUKS2.

Fixes: #464
This commit is contained in:
Milan Broz
2021-01-29 09:54:49 +01:00
parent 5a252c9166
commit 04b781d613
5 changed files with 68 additions and 16 deletions

View File

@@ -224,6 +224,11 @@ int LUKS2_keyslot_priority_set(struct crypt_device *cd,
crypt_keyslot_priority priority,
int commit);
int LUKS2_keyslot_swap(struct crypt_device *cd,
struct luks2_hdr *hdr,
int keyslot,
int keyslot2);
/*
* Generic LUKS2 token
*/