diff --git a/zkey/keystore.c b/zkey/keystore.c index ee0fb8b3..9dcac075 100644 --- a/zkey/keystore.c +++ b/zkey/keystore.c @@ -3301,10 +3301,16 @@ static int _keystore_process_cryptsetup(struct keystore *keystore, printf("%s\n", cmd); } } else if (strcasecmp(volume_type, VOLUME_TYPE_LUKS2) == 0) { + /* + * Use PBKDF2 as key derivation function for LUKS2 volumes. + * LUKS2 uses Argon2i as default, but this might cause + * out-of-memory errors when multiple LUKS2 volumes are opened + * automatically via /etc/crypttab + */ util_asprintf(&cmd, "cryptsetup luksFormat %s--type luks2 " "--master-key-file '%s' --key-size %lu " - "--cipher %s %s%s", + "--cipher %s --pbkdf pbkdf2 %s%s", keystore->verbose ? "-v " : "", key_file_name, key_file_size * 8, cipher_spec, sector_size > 0 ? temp : "", volume); diff --git a/zkey/zkey.1 b/zkey/zkey.1 index 19ef1a4a..93595dc0 100644 --- a/zkey/zkey.1 +++ b/zkey/zkey.1 @@ -567,6 +567,15 @@ option to generate cryptsetup commands for the specified volume type only. Specify the .B \-\-run option to run the generated cryptsetup commands. +.P +For LUKS2 volumes, the generated \fBcryptsetup luksFormat\fP contains +option \fB\-\-pbkdf pbkdf2\fP to set \fBPBKDF2\fP as password based key +derivation function. LUKS2 volumes typically default to \fBArgon2i\fP as +password based key derivation function, but this might cause out-of-memory +errors when multiple encrypted volumes are unlocked automatically at boot +through /etc/crypttab. Because PAES uses secure AES keys as volume keys, the +security of the key derivation function used to encrypt the volume key in the +LUKS key slots is of less relevance. . . .