agherzan / yubikey-full-disk-encryption

Use YubiKey to unlock a LUKS partition
Apache License 2.0
817 stars 51 forks source link

Possibility to pass many parameters to cryptsetup #104

Open vaminakov opened 7 months ago

vaminakov commented 7 months ago

Now line 147 of hook have quotes to each parameter: _tmp="$(printf %s "$_ykfde_passphrase" | cryptsetup luksOpen "$YKFDE_LUKS_DEV" "$YKFDE_LUKS_NAME" "$YKFDE_LUKS_OPTIONS" 2>&1)" So it can handle only one of them. If you have rare setup which need to pass more than one parameter, you'll not able to boot. To fix this need just remove quotes: _tmp="$(printf %s "$_ykfde_passphrase" | cryptsetup luksOpen "$YKFDE_LUKS_DEV" "$YKFDE_LUKS_NAME" $YKFDE_LUKS_OPTIONS 2>&1)"

Vincent43 commented 7 months ago

Passing unquoted variable is something we want to avoid. Were the additional parameters about detached header?

It's also possible to store LUKS options in header

vaminakov commented 7 months ago

@Vincent43 for example, in my configuration I'm using --header=/header-luks.img --allow-discards

Vincent43 commented 7 months ago

Yeah so we had proposal for adding headers option before.

The cryptsetup config --header=/header-luks.img <device> also should work