LUKS multiple passphrase retries
Hi there,
I've recently moved to using a LUKS2 encrypted boot and it's working great, however one of the frustrating things is that you get dropped to grub rescue after a single failed passphrase attempt.
I see there was a patch proposed back in 2019, but it didn't seem to progress any further (and the guy's git repo has since disappeared).
https://lists.gnu.org/archive/html/grub-devel/2019-08/msg00015.html
Anyway, I was wondering if any future consideration would be given to adding a feature allowing multiple retries when entering a passphrase?
Appreciate your time.
Cheers.
Signature · 1 line
Simon Perry (aka Pezz)
Hi,
I've recently built a custom config as a workaround for this, and embedded it into a custom grub image using grub-mkimage:
https://github.com/stendler/grub-fde
This repo should already be as generic as possible, but you might want to double-check that all your needed modules are loaded (e.g. filesystems, luks2, hash functions) and try out the test with qemu before actually installing and rebooting the file.
Also: friendly reminder to backup any working efi files within the esp before experimenting, to spare you the hassle of recovery, if something goes wrong.
Kind regards
Quoted 14 lines · Simon Perry via Grub-devel
Hi there,
I've recently moved to using a LUKS2 encrypted boot and it's working great, however one of the frustrating things is that you get dropped to grub rescue after a single failed passphrase attempt.
I see there was a patch proposed back in 2019, but it didn't seem to progress any further (and the guy's git repo has since disappeared).
https://lists.gnu.org/archive/html/grub-devel/2019-08/msg00015.html
Anyway, I was wondering if any future consideration would be given to adding a feature allowing multiple retries when entering a passphrase?
Appreciate your time.
Cheers.
Quoted 4 lines · Maximilian Stendler
Hi,
I've recently built a custom config as a workaround for this, and embedded it into a custom grub image using grub-mkimage:
https://github.com/stendler/grub-fde
Oh wow, this is great and will give me plenty to experiment with!
I reckon I might just adapt your try_mount function.
Thank you!
---
Simon Perry (aka Pezz)
------- Original Message -------
Quoted 19 lines · Simon Perry via Grub-devel
Hi there,
I've recently moved to using a LUKS2 encrypted boot and it's working great, however one of the frustrating things is that you get dropped to grub rescue after a single failed passphrase attempt.
I see there was a patch proposed back in 2019, but it didn't seem to progress any further (and the guy's git repo has since disappeared).
https://lists.gnu.org/archive/html/grub-devel/2019-08/msg00015.html
Anyway, I was wondering if any future consideration would be given to adding a feature allowing multiple retries when entering a passphrase?
Appreciate your time.
Cheers.
Quoted 7 lines
--
Simon Perry (aka Pezz)_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
AFAIK this patch[1] allows to have several passphrase attempts. It was originally proposed by John Lane as a part of crypto enhancement patch set[2]. Several versions of this patch set were sent to grub-devel mailing list in 2015-2018, but nothing was directly included into git. The patch was written for LUKS1 version because support for LUKS2 in grub was included later. However, it seems it would be trivial to add support for LUKS2.
[1] https://lists.gnu.org/archive/html/grub-devel/2015-06/msg00113.html
Quoted 3 lines · Maxim Fomin
AFAIK this patch[1] allows to have several passphrase attempts. It was originally proposed by John Lane as a part of crypto enhancement patch set[2]. Several versions of this patch set were sent to grub-devel mailing list in 2015-2018, but nothing was directly included into git. The patch was written for LUKS1 version because support for LUKS2 in grub was included later. However, it seems it would be trivial to add support for LUKS2.
I've actually completely solved this through scripting thanks to what I've learned from Maximilian Stendler's Github repo (who replied earlier).
There's a weird trick to it though, where you make a tar file with a simple cfg in it that sources another config and then you have things like functions, loops and if tests available.
Working great now, thanks to him.
Cheers.
---
Simon Perry (aka Pezz)