heads/initrd
Thierry Laurion f43fe1a836 initrd/bin/kexec-seal-key initrd/etc/luks-functions: last fixups
- fi misplaced
- rework reencryption loop
- added verbose output on TPM DUK key addition when LUKS container can be unlocked with DRK

Current state, left todo for future work:

TPM DUK:
- TPM DUK setup on defautl boot reuses /boot/kexec_key_devices.txt if present
- If not, list all LUKS partitions, asks user for selection and makes sure LUKS passphrase can unlock all
- Works on both LUKSv1 and LUKSv2 containers, reusing OS installer settings (Heads doesn't enforce better then OS installer LUKS parameters)

LUKS passphrase change/LUKS reencryption:
- Reuses /boot/kexec_key_devices.txt if existing
- If not, prompts for LUKS passphase, list all LUKS containers not being USB based and attempt to unlock all those, listing only the ones successfully unlocked
- Prompts user to reuse found unlockable LUKS partitions with LUKS passphrase, caches and reuse in other LUKS operations (passphrase change as well from oem factory reset/re-ownership)
- Deals properly with LUKSv1/LUKSv2/multiple LUKS containers and reencrypt/passphrase changes them all if accepted, otherwise asks user to select individual LUKS container

Tested on luksv1,luksv2, btrfs under luks (2x containers) and TPM DUK setup up to booting OS. All good

TODO:
- LUKS passphrase check is done multiple times across TPM DUK, reencryption and luks passphrase. Could refactor to change this, but since this op is done only one reencrypt+passphrase change) upon hardare reception from OEM, I stopped caring here.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2024-10-30 14:18:20 -04:00
..
.gnupg gpg2: make sure dirmngr is not spawn to refresh keys under initrd/.gnupg/gpg.conf 2024-01-09 12:53:56 -05:00
bin initrd/bin/kexec-seal-key initrd/etc/luks-functions: last fixups 2024-10-30 14:18:20 -04:00
etc initrd/bin/kexec-seal-key initrd/etc/luks-functions: last fixups 2024-10-30 14:18:20 -04:00
run/cryptsetup [WIP] cross build json-c and cryptsetup 2020-10-28 15:28:05 +02:00
sbin TPM extend ops: Augment output of TPM1/TMP22 for filename and file content hash ops 2024-09-06 17:15:53 -04:00
.ash_history Merge pull request #1515 from tlaurion/inmemory_keygen-gpg_backup_usable_for_RSA_only-copy_to_card_working_for_RSA_only-gpg_auth_for_recovery_and_sub_boot 2023-11-13 16:05:26 -05:00
init GUI scripts: add whiptail_error and whiptail_warning since https://github.com/linuxboot/heads/pull/1787 fixed the issue 2024-10-30 14:18:20 -04:00
mount-boot Add dual support for real bash and busybox's bash(ash) 2023-03-08 12:45:44 -05:00