bitlk: Fix working with 4k sector devices

We need to use the iv_large_sectors flag and correct sector size
for the crypt segments for these devices. Used sector size is
read from the device header. This commit also adds two new test
images with 4k sectors.

Fixes: #557
This commit is contained in:
Vojtěch Trefný
2020-05-05 18:47:49 +02:00
committed by Milan Broz
parent e759ebe0bd
commit 2e345a1059
5 changed files with 22 additions and 2 deletions

View File

@@ -1101,6 +1101,8 @@ int crypt_keyslot_destroy(struct crypt_device *cd, int keyslot);
#define CRYPT_ACTIVATE_NO_JOURNAL_BITMAP (1 << 20)
/** device is suspended (key should be wiped from memory), output only */
#define CRYPT_ACTIVATE_SUSPENDED (1 << 21)
/** use IV sector counted in sector_size instead of default 512 bytes sectors */
#define CRYPT_ACTIVATE_IV_LARGE_SECTORS (1 << 22)
/**
* Active device runtime attributes