mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 19:00:02 +01:00
crypt_activate_by_token functions did not respect LUKS2 keyslot priorities. These calls were able to activate device via keyslot with CRYPT_SLOT_PRIORITY_IGNORE even when token was set to CRYPT_ANY_TOKEN. This commit changes the token based activation so that keyslot with priority ignore is eligible for unlock only when specific token is selected. Also when activating with token set to CRYPT_ANY_TOKEN keyslots with higher priority take precedence over keyslots with normal priority. Keyslot with priority ignore are correctly ignored when token is CRYPT_ANY_TOKEN.