-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Use a USB security key as a TPM work-alike in the absence of a physical TPM #836
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,6 +267,19 @@ combine_configs() { | |
cat /etc/config* > /tmp/config | ||
} | ||
|
||
# Generate secret value using first 40 chars of ROM SHA256 hash | ||
secret_from_rom_hash() { | ||
local ROM_IMAGE="/tmp/coreboot-notpm.rom" | ||
|
||
echo -e "\nTPM not detected; measuring ROM directly\n" 1>&2 | ||
# use a previously-copied image if it exists | ||
if [ -f ${ROM_IMAGE} ]; then | ||
sha256sum ${ROM_IMAGE} | cut -f1 -d ' ' | cut -c 1-40 | tr -d '\n' | ||
else | ||
flash.sh -s ${ROM_IMAGE} | cut -c 1-40 | tr -d '\n' | ||
fi | ||
} | ||
Comment on lines
+271
to
+281
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MrChromebox @daringer @jans23 @kylerankin @szszszsz @osresearch @fhvyhjriur @Tonux599 @Thrilleratplay @irelativism @blobless @lrvick Current security of TPM-less hardware, secured solely by USB Security dongle if we merge this :
Notes:
@osresearch : We merge? Please press the button if you will. Without a TPM, I would reflash my x230-hotp-maximized rom on my laptop prior of each use when left unattended.... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hilarious (although realistic) story @tlaurion , my favorite:
but seriously: seeing which misconceptions this (not even upstream) patch has already produced, |
||
|
||
update_checksums() | ||
{ | ||
# clear screen | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,13 @@ hwclock -l -s | |
. /etc/functions | ||
. /etc/config | ||
|
||
# set CONFIG_TPM dynamically before init | ||
if [ -e /dev/tpm0 ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if TPM lines are cut? What is the behavior and conditional codepath effects here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd assume that a TPM with cut lines would behave exactly like a device without a TPM, since there would be no communication and /dev/tpm0 would not exist There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MrChromebox my point here is that since the codepath is dynamic and not set inside of ROM inside of /etc/config anymore, cutting the lines of TPM would simply result in a different codepath without the user knowing the his TPM lines were cut, and from the LIBREM KEY/ Nitrokey Pro Nitrokey Storage being used for validation. I'm not sure this is desirable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the user would absolutely be notified, since there would be text indicating no TPM on the main menu, and LK/NK verification would fail as the secret would have changed from the TPM-backed one to the hash-based one. |
||
export CONFIG_TPM='y' | ||
else | ||
export CONFIG_TPM='n' | ||
fi | ||
|
||
if [ "$CONFIG_COREBOOT" = "y" ]; then | ||
/bin/cbfs-init | ||
fi | ||
|
@@ -89,6 +96,13 @@ if [ "$boot_option" = "r" ]; then | |
exit | ||
fi | ||
|
||
# Override CONFIG_TPM and persist via user config | ||
if [ -e /dev/tpm0 ]; then | ||
echo "CONFIG_TPM=y" >> /etc/config.user | ||
else | ||
echo "CONFIG_TPM=n" >> /etc/config.user | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not measured. No change detected. |
||
fi | ||
|
||
combine_configs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Combined in ram, no change detected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Point here is what is in cbfs is measured, but not the result of combine_configs, where the result is taken as the new applied config ( next line importing the actual config |
||
. /tmp/config | ||
|
||
|
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.
sha1sum fitting in available 40 chars as per TPM 1.1 equivalent?