All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] How to get PBKDF settings of an existing key slot via libcryptsetup ?
@ 2019-01-31 10:14 Ingo Franzki
  2019-02-04 13:22 ` Milan Broz
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Franzki @ 2019-01-31 10:14 UTC (permalink / raw)
  To: dm-crypt

Hi,

is there a way to get the PBKDF settings (struct crypt_pbkdf_type) of an existing key slot in a LUKS2 volume via the libcryptsetup API? 

This question is related to the default PBKDF algorithm Argon2i for LUKS2 and the out-of-memory errors that you might get when you unlock multiple LUKS2 volumes during system startup via /etc/crypttab.

One of my application uses crypt_keyslot_add_by_key() to add a new unbound key slot. Unfortunately this new key slot gets the default PBKDF settings, thus it gets Argon2i. I guess if I would use crypt_set_pbkdf_type() before to set PBKDF2, then the new key slot would get PBKDF2 instead of Argon2i. However, I don't want to hard code PBKDF2 here, but I would like to use the PBKDF settings of the key slot that was unlocked before. So I would need a way to get the PBKDF settings of a key slot and then use crypt_set_pbkdf_type() with those settings before calling crypt_keyslot_add_by_key(). That way the new key slot would get the same PBKDF settings as the current one.

Using crypt_get_pbkdf_type() seems to return the default PBKDF algorithm, thus Argon2i for LUKS2. 

Kind regards,
Ingo

-- 
Ingo Franzki
eMail: ifranzki@linux.ibm.com  
Tel: ++49 (0)7031-16-4648
Fax: ++49 (0)7031-16-3456
Linux on IBM Z Development, Schoenaicher Str. 220, 71032 Boeblingen, Germany

IBM Deutschland Research & Development GmbH / Vorsitzender des Aufsichtsrats: Matthias Hartmann
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM DATA Privacy Statement: https://www.ibm.com/privacy/us/en/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-02-15 12:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-31 10:14 [dm-crypt] How to get PBKDF settings of an existing key slot via libcryptsetup ? Ingo Franzki
2019-02-04 13:22 ` Milan Broz
2019-02-04 13:44   ` Ingo Franzki
2019-02-04 15:15     ` Ingo Franzki
2019-02-04 17:47       ` Milan Broz
2019-02-14  9:28         ` Ingo Franzki
2019-02-15 12:12           ` Milan Broz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.