-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid overwritting LUKS2 keyslot area if possible.
With LUKS2 crypt_keyslot_change_by_passphrase() call does not have to overwrite binary keyslot area in-place when user asked for specific keyslot id. If there's enough free space in keyslot binary area we can write new keyslot material in the the free area (identified temporarily by new keyslot id) and switch pointers (json metadata) to point to the new keyslot area after the keyslot area write is complete. The old keyslot area gets deleted after the new area write is finished. Otherwise we needlesly risk to lose the existing keyslot if the operation gets interupted. With this patch LUKS2 crypt_keyslot_change_by_passphrase() overwrites existing keyslot (including keyslot area) only if there's no free space and therefore in-place update is necessary. Fixes: #839.
- Loading branch information
Showing
3 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters