Skip to content

Commit 5d69c34

Browse files
committed
Reinstate pbkdf serialization flag in device activation.
crypt_activate_by_keyslot_context never respected pbkdf serialation flag (CRYPT_ACTIVATE_SERIALIZE_MEMORY_HARD_PBKDF). In fact it worked only when device was activated via passphrase or via passphrase file. It was never respected when device was activated by a token for example. When the internal code was fully switched to activation via keyslot context the legacy code for passphrase based activation was dropped and we lost track of serialization flag completely. This fixes all of the issues so now the serialization flag will be respected also with tokens (and all other activation methods unlocking LUKS2 keyslot with memory hard pbkdf). Fixes: 58385d6 (Allow activation via keyslot context) Fixes: #968.
1 parent e1cbd4e commit 5d69c34

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/setup.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5450,6 +5450,9 @@ int crypt_activate_by_keyslot_context(struct crypt_device *cd,
54505450
return _activate_loopaes(cd, name, passphrase, passphrase_size, flags);
54515451
}
54525452

5453+
if (flags & CRYPT_ACTIVATE_SERIALIZE_MEMORY_HARD_PBKDF)
5454+
cd->memory_hard_pbkdf_lock_enabled = true;
5455+
54535456
/* acquire the volume key(s) */
54545457
r = -EINVAL;
54555458
if (isLUKS1(cd->type)) {

0 commit comments

Comments
 (0)