Commit Graph

1012 Commits

Author SHA1 Message Date
Trammell Hudson
d876776ed7
enable coreboot console support 2018-07-18 06:23:13 -04:00
Trammell Hudson
a75d8a0c92
increase CBMEM log level 2018-07-18 06:22:50 -04:00
Trammell Hudson
977c1c3987
update qemu-coreboot Linux config to 4.14.56, enable the CBMEM console 2018-07-17 06:51:38 -04:00
Trammell Hudson
d400c4dd4d
update paths for Linux 4.14.56 (issue #423) 2018-07-17 06:48:06 -04:00
Trammell Hudson
6033015454 Exit if patch fails to apply (issue #429) 2018-07-17 06:28:18 -04:00
Trammell Hudson
22b1241475
Exit if patch fails to apply (issue #429) 2018-07-17 06:22:52 -04:00
Kyle Rankin
fd99d160e8
Improve status messages for Librem Key HOTP output 2018-07-03 12:40:52 -07:00
Kyle Rankin
acb2b34873
Show warning bg color in main menu when HOTP key not found 2018-06-21 16:30:35 -07:00
Kyle Rankin
be665ac4f9
Show red background when HOTP code is invalid
Granted the user should really be using the Librem Key/phone to check
for tampering (since an attacker could control the Heads background
color) but this provides another visual queue for the user with
the GUI menu to catch less sophisticated tampering.
2018-06-21 16:04:46 -07:00
Kyle Rankin
ec3248dbc9
Shorten timeout for Librem Key
Currently the Librem Key tests will time out after 40 seconds, which
adds to the boot time significantly if the user wants to boot without
inserting it. This patch changes that timeout to one second.
2018-06-20 16:20:15 -07:00
Kyle Rankin
fe34aba719
Store HOTP counter directly in /boot instead of TPM
The HOTP counter isn't a secret but is just used to prevent replay
attacks (the time-based counter in TOTP isn't a secret either) so it
doesn't need to be protected in the TPM and storing it as a TPM
monotonic counter was causing conflicts with the Heads configuration
counter as TPM 1.2 can only increment one counter per reboot.

This change moves the HOTP counter into the file in /boot that was
previously keeping track of the TPM counter id.
2018-06-20 09:20:39 -07:00
Kyle Rankin
7dde5c2aca
Revert "Use HOTP TPM counter instead of Heads when signing, if present"
This reverts commit c42084406d.
2018-06-19 16:28:37 -07:00
Kyle Rankin
c42084406d
Use HOTP TPM counter instead of Heads when signing, if present
TPM v1.2 has a limitation in that only a single monotonic counter can be
incremented between reboots [1]. So in the event we are using HOTP
monotonic counters, we need to reference those for the Heads rollback
counter when we update file signatures in /boot, otherwise the increment
stage at kexec-sign-config will fail since at each boot, the HOTP
monotonic counter has already been incremented.

[1] https://projects.csail.mit.edu/tc/tpmj/UsersGuide.html#inccounter
2018-06-19 16:18:10 -07:00
Kyle Rankin
2cacb15729
Add back TPM config counter section to gui-init
The section in gui-init that modifies the Heads TPM counter when signing
config was accidentally removed. This change adds that section back.
2018-06-19 13:03:01 -07:00
Kyle Rankin
31cf85b707
Add Librem Key support to Heads
The Librem Key is a custom device USB-based security token Nitrokey is
producing for Purism and among other things it has custom firmware
created for use with Heads. In particular, when a board is configured
with CONFIG_LIBREMKEY, this custom firmware allows Heads to use the
sealed TOTP secret to also send an HOTP authentication to the Librem
Key. If the HOTP code is successful, the Librem Key will blink a green
LED, if unsuccessful it will blink red, thereby informing the user that
Heads has been tampered with without requiring them to use a phone to
validate the TOTP secret.

Heads will still use and show the TOTP secret, in case the user wants to
validate both codes (in case the Librem Key was lost or is no longer
trusted). It will also show the result of the HOTP verification (but not
the code itself), even though the user should trust only what the Librem
Key displays, so the user can confirm that both the device and Heads are
in sync. If HOTP is enabled, Heads will maintain a new TPM counter
separate from the Heads TPM counter that will increment each time HOTP
codes are checked.

This change also modifies the routines that update TOTP so that if
the Librem Key executables are present it will also update HOTP codes
and synchronize them with a Librem Key.
2018-06-19 12:27:27 -07:00
tlaurion
85eebd0487
Modify flash command to use generic flash.sh 2018-06-06 22:09:57 -04:00
Martin Kepplinger
4ea175838f x230: remove 4M and 8M split-images from the build
The bios regions of the 12M coreboot image is 7M: 4M and 3 of the 8M split
image. The rest of the 8M image _generated_ with fake data and not usable
on real systems! It's dangerous to create them and suggest flashing them
externally.

That's exactly why the x230-flash build target is there: To
have a self-contained 4M image and enable easy unlocking of the 8M image
using the _original_ data.

the heads-wiki project is updated accordingly.

Closes #307
Closes #302
2018-06-04 09:22:05 +02:00
Trammell hudson
584c07042e
Merge branch 'generic_flashrom_script' of https://github.com/kylerankin/heads 2018-06-01 12:40:16 -04:00
Trammell hudson
1d366546f1
Merge branch 'gpg' of https://github.com/flammit/heads 2018-06-01 12:39:41 -04:00
Trammell hudson
4b264fba70
Merge branch 'librem_vbt' of https://github.com/kakaroto/heads 2018-06-01 12:38:53 -04:00
Trammell hudson
d88cc4fe3c
use tpmtotp git and add hotp command 2018-06-01 12:36:21 -04:00
Trammell hudson
c7bad87e42
update URL for popt since rpm5.or gis down (issue #421) 2018-05-29 17:28:47 -04:00
Trammell hudson
2c44800c65
Merge branch 'master' of ssh://github.com/osresearch/heads 2018-05-29 17:12:07 -04:00
Trammell hudson
29f0f914c5
do not create empty file if wget fails (issue #422) 2018-05-29 17:09:26 -04:00
Kyle Rankin
8d50b6a1ab
Add option to flash cleaned ROM to GUI 2018-05-28 11:38:04 -07:00
Kyle Rankin
8dc2f8602f
Add trivial word-wrapping for long output line 2018-05-23 16:14:44 -07:00
Youness Alaoui
4b34cca555
Add VBT file to coreboot image.
Adding the VBT file makes it available through some ACPI memory area
and apparently the VBT contains the information needed by the i915 driver
in order to figure out how to control the screen's backlight.
Without the VBT, we can't control the screen backlight with Fn-F5/Fn-F6
anymore.
2018-05-23 16:49:27 -04:00
Francis Lam
736538a8a2
Add additional kernel command line options for ISO boot
Allows Qubes/Ubuntu/Fedora ISO media to be used by default
without a custom kexec_iso_add.txt config
2018-05-19 10:52:49 -07:00
Kyle Rankin
cfa6c3a374
Make x230 board option a glob to match x230-flash option 2018-05-18 14:04:00 -07:00
Trammell hudson
6d9b0a7c6c
enable cgroups and the various controllers (issue #384) 2018-05-18 16:14:27 -04:00
Trammell hudson
33e9dda884
Merge branch 'add-boot-devices-to-qemu-coreboot' of https://github.com/paulmenzel/heads 2018-05-18 15:39:19 -04:00
Trammell hudson
eda252568c
Merge branch 'variable_counter_label' of https://github.com/kylerankin/heads 2018-05-18 15:13:57 -04:00
Trammell hudson
191ef56797
Merge branch 'add-ata-ahci-modules-to-qemu-coreboot' of https://github.com/paulmenzel/heads 2018-05-18 15:13:07 -04:00
Paul Menzel
2839364d43 boards/qemu-coreboot: Set /dev/sdb1 as USB boot device
QEMU’s USB device is detected as `/dev/sdb1`.
2018-05-18 18:38:29 +02:00
Paul Menzel
c5665b7882 boards/qemu-coreboot: Set boot device to /dev/sda1
QEMU emulated drive is detected as `/dev/sda1`. Set it up as the boot
device.

Use the same value as in for `qemu-linuxboot.config`.
2018-05-18 18:35:54 +02:00
Francis Lam
c1be56c5ad
Separate trusted ISO signers from trusted config signers 2018-05-17 19:52:11 -07:00
Kyle Rankin
258420d75d
Add BIOS ROM editing features to flash GUI
In addition to being able to flash a ROM from the GUI, it would also be
useful for a user to be able to add a GPG key to their keyring using the
flashing tool. This change adds the ability for a user to edit both a
ROM located on a USB key and also edit the running BIOS by using
flashrom to make a local copy of the running BIOS, edit it, then reflash
it. This also supports the upcoming delete feature in CBFS for
circumstances where keyring files already exist within CBFS.
2018-05-17 15:31:23 -07:00
Kyle Rankin
a9bf4eb874
Add read mode to flash.sh
If we want to modify a running BIOS we will need the ability to pull
down the current BIOS, modify it, and then reflash. This change adds a
read option to flash.sh and pulls down three versions of the BIOS and
only exists successfully if all three match.
2018-05-15 16:24:24 -07:00
Paul Menzel
1585f596d1 qemu-coreboot: Add modules libata, libahci and ahci to initrd
To be able to boot a disk image, passed to QEMU with `-hda
/path/qemu.img`, the appropriate modules are needed. Strange, `libata`
is not enough, and the drive is only detected, when the module `ahci` is
loaded.

> ata1.00: ATA-7: QEMU HARDDISK, 2.5+, max UDMA/100

Tested with QEMU emulator version 2.11.1(Debian 1:2.11+dfsg-1ubuntu7)
with the command below,

    qemu-system-x86_64 -enable-kvm -M q35 -m 1G -bios \
    qemu-coreboot/coreboot.rom -serial stdio -L /dev/shm -hda \
    /dev/shm/qemu-debian.img

where `qemu-debian.img` is created with grml-debootstrap.

    grml-debootstrap --vmfile --vmsize 3G --target \
    /dev/shm/qemu-debian.img -r sid
2018-05-12 22:53:44 +02:00
Kyle Rankin
b276e355d9
Re-add the flashrom script for kgpe-d16-openbmc 2018-05-11 14:23:48 -07:00
Kyle Rankin
3c88bc5d86
Split flash GUI into separate script
To keep the flash logic simpler the GUI logic has been split into a
flash-gui.sh program so flash.sh behaves closer to the original flashrom
scripts it was based from. I've also removed the previous flashrom
scripts and incorporated their options into flash.sh. Finally I set
CONFIG_BOARD via the Makefile instead of setting a duplicate option in
each board's config.
2018-05-11 14:08:31 -07:00
Kyle Rankin
89b008a042
Use explicit path for flash.sh 2018-05-11 12:32:04 -07:00
Kyle Rankin
45ae20fc12
Add generic flash script
Based on the conversation for PR #406, we decided to go with a more
generic script for general-purpose flashing instead of having individual
(and therefore very similar) flash scripts for each board type. This
script currently handles flashrom on Librem and X230 board types and
introduces a new CONFIG_BOARD option that sets specific flashrom
arguments based on the board.

It also adds support to gui-init to call this flash script.
2018-05-11 12:27:50 -07:00
Kyle Rankin
fc72daa6e3
Fix tabbing 2018-05-09 14:28:36 -07:00
Kyle Rankin
ec2d7dfc2c
Make TPM counter label a variable
Currently the TPM counter label is hard-coded. By changing it to a
variable in this function we can reuse all of the TPM counter functions
to create other monotonic counters in the TPM (if the hardware supports
it) with custom labels.
2018-05-09 14:25:43 -07:00
Thierry Laurion
b0ca83dbca reverting changes on linux-x230.config 2018-05-07 16:56:54 -04:00
Thierry Laurion
93e77c3ade reverting changes on coreboot-x230.config 2018-05-07 16:55:26 -04:00
Thierry Laurion
fbcedd77dc reverting changes on x230.config 2018-05-07 16:52:54 -04:00
Thierry Laurion
3d23cadd15 x230-flash depends on independent and minimal linux-x230-flash.config. ash_history content replaced with usefull commands. Everything is there to generate keys from Yubikey/Nitrokey, export armored versions to external media and cbfs them into reproducible rom and flash resulting rom with flashrom-x230.sh. 2018-05-07 16:45:47 -04:00
Thierry Laurion
2ede0b355d Merge branch 'master' of https://github.com/osresearch/heads into X230-CCACHE-GUI_INIT-LINUX_I915FB-COREBOOT_NO_TEXTBUFFER 2018-05-07 14:27:44 -04:00