mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 19:00:02 +01:00
Validate LUKS2 keyslot json before opening it.
This commit is contained in:
committed by
Milan Broz
parent
7bee66fe36
commit
1e2ad19d68
@@ -220,6 +220,12 @@ static int LUKS2_open_and_verify(struct crypt_device *cd,
|
||||
if (!(h = LUKS2_keyslot_handler(cd, keyslot)))
|
||||
return -ENOENT;
|
||||
|
||||
r = h->validate(cd, keyslot);
|
||||
if (r) {
|
||||
log_dbg("Keyslot %d validation failed.", keyslot);
|
||||
return r;
|
||||
}
|
||||
|
||||
r = LUKS2_keyslot_for_segment(hdr, keyslot, segment);
|
||||
if (r) {
|
||||
if (r == -ENOENT)
|
||||
|
||||
Reference in New Issue
Block a user