-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TPM DUK retry loop (bogus), uniformize related vocabulary #1595
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tlaurion, good find, improvements to wording consistency are great too. Posted a few notes but generally looks good. Not sure if the fix is 100% correct from a read over but made a suggestion, details on kexec-unseal-key.
e96673e
to
f66dd2b
Compare
…output to check active keyslot 1 is not the only one existing Signed-off-by: Thierry Laurion <[email protected]>
d701946
to
5a52c67
Compare
When playing with long fbwhiptail/whiptail messages, this commit played around the long string using fold. ''' echo -e "This will replace the encrypted container content and its LUKS Disk Recovery Key.\n\nThe passphrase associated with this key will be asked from the user under the following conditions:\n 1-Every boot if no Disk Unlock Key was added to the TPM\n 2-If the TPM fails (hardware failure)\n 3-If the firmware has been tampered with/modified by the user\n\nThis process requires you to type the current LUKS Disk Recovery Key passphrase and will delete the LUKS TPM Disk Unlock Key slot, if set up, by setting a default boot LUKS key slot (1) if present.\n\nAt the next prompt, you may be asked to select which file corresponds to the LUKS device container.\n\nHit Enter to continue." | fold -w 70 -s ''' Which gave the exact output of what will be inside of the fbwhiptail prompt, fixed to 70 chars width: ''' This will replace the encrypted container content and its LUKS Disk Recovery Key. The passphrase associated with this key will be asked from the user under the following conditions: 1-Every boot if no Disk Unlock Key was added to the TPM 2-If the TPM fails (hardware failure) 3-If the firmware has been tampered with/modified by the user This process requires you to type the current LUKS Disk Recovery Key passphrase and will delete the LUKS TPM Disk Unlock Key slot, if set up, by setting a default boot LUKS key slot (1) if present. At the next prompt, you may be asked to select which file corresponds to the LUKS device container. Hit Enter to continue. ''' Therefore, for long prompts in the future, one can just deal with "\n 1-" alignments to be respected in prompts and have fold deal with cutting the length of strings properly. Signed-off-by: Thierry Laurion <[email protected]>
…UG mode/Recovery Shell Next steps on this is introspection and PCRs reconstruction helpers, which will output in DEBUG and be usable from recovery shell. We have to keep in mind that providing those tools is useful in DEBUG mode and for users having access to Recovery Shell. But currently, having access to cbmem -L output and final PCRs content is making it too easy for Evil Maid to know what needs to be hardcoded to pass measured boot. Signed-off-by: Thierry Laurion <[email protected]>
5a52c67
to
4f2b1b6
Compare
@JonathonHall-Purism Ready for merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks 👍
#1588 related: fixes retry. Left behind: capslock key detection and fix.
@JonathonHall-Purism please review
Tested:
Basically, the loop code was bogues because of pipefail, TPM DUK passphrase failing to unseal caused pipefail and exiting without retrying input as codepath expected.
TODO: find a nice way to get capslock state from tty. Only way found as of now would be through kbd, and extracting ioctl call to tty to get state of key modifiers. That is estimated to be 7kb of compiled c code that would need to be an independent app. I have not found any other easy way to get capslock state. Reminder, there is no capslock led on old lenovos, and exposing those leds through kernel modules successfully exposes capclock but since EC firmware doesn't interact in any way with abent leds, the state cannot be read from LEDs so not an alternative solution. If anybody has an idea that could go through exposed /sys /proc or even agetty/stty, I tried a lot but didn't succeed. @JonathonHall-Purism ideas there?