Commit Graph

11 Commits

Author SHA1 Message Date
Richard Hughes
0d4e2ca4c5 Make tss2-esys conditional
This is not provided in RHEL 8 in the default build root.
2020-04-22 09:36:14 +01:00
Mario Limonciello
069449e427 trivial: uefi: don't add PCRs with all 0's
I was seeing on a CML laptop with a Nuvoton TPM the following which
is definitely wrong:
```
  Checksum:             SHA1(791183aa2c4993dfaf75e95c91bdad067ac2cce1)
  Checksum:             SHA256(8a0656fe0024cc3300cc4dc8af4fc336112a51013aeb74b21c138ed116bb8691)
  Checksum:             SHA1(000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
```
2019-10-14 08:58:14 -05:00
Mario Limonciello
42ee62ef34 trivial: uefi: allow forcing to TPM2 via environment variable
Use this environment variable to ensure that TPM2 is used in self
tests even if the system has TPM1.2.
2019-09-25 08:38:04 -05:00
Mario Limonciello
5206592347 trivial: uefi: Make the TCTI output less verbose 2019-09-17 23:41:41 +01:00
Mario Limonciello
0f490525f0 trivial: UEFI skip self tests if library fails to initialize
This means no simulator or TPM actually available
2019-08-29 12:52:27 -05:00
Jonas Witschel
5a7575d947 uefi: add test for TPM 2.0 PCR read function
The test is run if a physical TPM is available or if the environment
variable "TPM_SERVER_RUNNING" is set. In the latter case, the user is
expected to start a TPM simulator on their own, like we do in the Arch
Linux CI script here.
2019-08-27 06:23:42 -05:00
Jonas Witschel
1b5f1da202 uefi: use tpm2-tss library to read PCR values
Using the library instead of the command line tools provides a more
stable interface. This implementation only fetches PCR 0 for all
available hash algorithms since this is the only PCR that is actually
used in fwupd.
2019-08-27 06:23:42 -05:00
Jonas Witschel
db82620413 uefi: add support for tpm2-tools 4.X
tpm2_pcrlist has been renamed to tpm2_pcrread in
aedb0291d2
and the output format has changed slightly to include a leading "0x" in
9374bd70f4
Also add an example of the new output format to the self test.
2019-08-25 09:56:16 +01:00
Richard Hughes
0a57b90d75 uefi: More carefully check the output from tpm2_pcrlist
Otherwise we can get a PCR0 of 'getcapability:getpcrallocationstatuserror'...
2019-03-27 14:18:19 -04:00
Richard Hughes
b768e4d924 Do not fail to start the daemon if tpm2_pcrlist hangs
In some situations SELinux prevents fwupd from executing tpm2_pcrlist, but the
failure mode is that the process just hangs and never completes. This causes
systemd to time out the fwupd daemon startup and then errors to be shown in
GNOME Software.

To prevent this happening, add an optional timeout argument to
fu_common_spawn_sync() and cancel the subprocess if it takes longer than this
to complete.

See https://bugzilla.redhat.com/show_bug.cgi?id=1665701 for details.
2019-02-26 14:27:13 +00:00
Richard Hughes
b56015ed3f uefi: Add the PCR0 value as the device checksum for system firmware
We can't actually access the UEFI ROM from userspace, but the PCR0 is a hash
built from the ROM itself. We could use this value to ensure the firmware has
been written correctly, and that the PCR0 matches the expected value specified
in the metadata.
2018-12-14 19:23:04 +00:00